{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
module GenAI.Client.Model where
import GenAI.Client.Core
import GenAI.Client.MimeTypes
import Data.Aeson ((.:), (.:!), (.:?), (.=))
import Control.Arrow qualified as P (left)
import Data.Aeson qualified as A
import Data.ByteString qualified as B
import Data.ByteString.Base64 qualified as B64
import Data.ByteString.Char8 qualified as BC
import Data.ByteString.Lazy qualified as BL
import Data.Data qualified as P (TypeRep, Typeable, typeOf, typeRep)
import Data.Foldable qualified as P
import Data.HashMap.Lazy qualified as HM
import Data.Map qualified as Map
import Data.Maybe qualified as P
import Data.Set qualified as Set
import Data.Text qualified as T
import Data.Text.Encoding qualified as T
import Data.Time qualified as TI
import Lens.Micro qualified as L
import Web.FormUrlEncoded qualified as WH
import Web.HttpApiData qualified as WH
import Control.Applicative (Alternative, (<|>))
import Data.Function ((&))
import Data.Monoid ((<>))
import Data.Text (Text)
import Prelude (Applicative, Bool (..), Char, Double, FilePath, Float, Functor, Int, Integer, Maybe (..), Monad, String, fmap, maybe, mempty, pure, undefined, ($), (.), (/=), (<$>), (<*>), (=<<), (>>=))
import Prelude qualified as P
newtype Alt = Alt {Alt -> E'Alt
unAlt :: E'Alt} deriving (Alt -> Alt -> Bool
(Alt -> Alt -> Bool) -> (Alt -> Alt -> Bool) -> Eq Alt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Alt -> Alt -> Bool
== :: Alt -> Alt -> Bool
$c/= :: Alt -> Alt -> Bool
/= :: Alt -> Alt -> Bool
P.Eq, Int -> Alt -> ShowS
[Alt] -> ShowS
Alt -> [Char]
(Int -> Alt -> ShowS)
-> (Alt -> [Char]) -> ([Alt] -> ShowS) -> Show Alt
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Alt -> ShowS
showsPrec :: Int -> Alt -> ShowS
$cshow :: Alt -> [Char]
show :: Alt -> [Char]
$cshowList :: [Alt] -> ShowS
showList :: [Alt] -> ShowS
P.Show)
newtype Callback = Callback {Callback -> Text
unCallback :: Text} deriving (Callback -> Callback -> Bool
(Callback -> Callback -> Bool)
-> (Callback -> Callback -> Bool) -> Eq Callback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Callback -> Callback -> Bool
== :: Callback -> Callback -> Bool
$c/= :: Callback -> Callback -> Bool
/= :: Callback -> Callback -> Bool
P.Eq, Int -> Callback -> ShowS
[Callback] -> ShowS
Callback -> [Char]
(Int -> Callback -> ShowS)
-> (Callback -> [Char]) -> ([Callback] -> ShowS) -> Show Callback
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Callback -> ShowS
showsPrec :: Int -> Callback -> ShowS
$cshow :: Callback -> [Char]
show :: Callback -> [Char]
$cshowList :: [Callback] -> ShowS
showList :: [Callback] -> ShowS
P.Show)
newtype Chunk2 = Chunk2 {Chunk2 -> Text
unChunk2 :: Text} deriving (Chunk2 -> Chunk2 -> Bool
(Chunk2 -> Chunk2 -> Bool)
-> (Chunk2 -> Chunk2 -> Bool) -> Eq Chunk2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Chunk2 -> Chunk2 -> Bool
== :: Chunk2 -> Chunk2 -> Bool
$c/= :: Chunk2 -> Chunk2 -> Bool
/= :: Chunk2 -> Chunk2 -> Bool
P.Eq, Int -> Chunk2 -> ShowS
[Chunk2] -> ShowS
Chunk2 -> [Char]
(Int -> Chunk2 -> ShowS)
-> (Chunk2 -> [Char]) -> ([Chunk2] -> ShowS) -> Show Chunk2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Chunk2 -> ShowS
showsPrec :: Int -> Chunk2 -> ShowS
$cshow :: Chunk2 -> [Char]
show :: Chunk2 -> [Char]
$cshowList :: [Chunk2] -> ShowS
showList :: [Chunk2] -> ShowS
P.Show)
newtype Corpus2 = Corpus2 {Corpus2 -> Text
unCorpus2 :: Text} deriving (Corpus2 -> Corpus2 -> Bool
(Corpus2 -> Corpus2 -> Bool)
-> (Corpus2 -> Corpus2 -> Bool) -> Eq Corpus2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Corpus2 -> Corpus2 -> Bool
== :: Corpus2 -> Corpus2 -> Bool
$c/= :: Corpus2 -> Corpus2 -> Bool
/= :: Corpus2 -> Corpus2 -> Bool
P.Eq, Int -> Corpus2 -> ShowS
[Corpus2] -> ShowS
Corpus2 -> [Char]
(Int -> Corpus2 -> ShowS)
-> (Corpus2 -> [Char]) -> ([Corpus2] -> ShowS) -> Show Corpus2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Corpus2 -> ShowS
showsPrec :: Int -> Corpus2 -> ShowS
$cshow :: Corpus2 -> [Char]
show :: Corpus2 -> [Char]
$cshowList :: [Corpus2] -> ShowS
showList :: [Corpus2] -> ShowS
P.Show)
newtype Document2 = Document2 {Document2 -> Text
unDocument2 :: Text} deriving (Document2 -> Document2 -> Bool
(Document2 -> Document2 -> Bool)
-> (Document2 -> Document2 -> Bool) -> Eq Document2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Document2 -> Document2 -> Bool
== :: Document2 -> Document2 -> Bool
$c/= :: Document2 -> Document2 -> Bool
/= :: Document2 -> Document2 -> Bool
P.Eq, Int -> Document2 -> ShowS
[Document2] -> ShowS
Document2 -> [Char]
(Int -> Document2 -> ShowS)
-> (Document2 -> [Char])
-> ([Document2] -> ShowS)
-> Show Document2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Document2 -> ShowS
showsPrec :: Int -> Document2 -> ShowS
$cshow :: Document2 -> [Char]
show :: Document2 -> [Char]
$cshowList :: [Document2] -> ShowS
showList :: [Document2] -> ShowS
P.Show)
newtype DynamicId = DynamicId {DynamicId -> Text
unDynamicId :: Text} deriving (DynamicId -> DynamicId -> Bool
(DynamicId -> DynamicId -> Bool)
-> (DynamicId -> DynamicId -> Bool) -> Eq DynamicId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DynamicId -> DynamicId -> Bool
== :: DynamicId -> DynamicId -> Bool
$c/= :: DynamicId -> DynamicId -> Bool
/= :: DynamicId -> DynamicId -> Bool
P.Eq, Int -> DynamicId -> ShowS
[DynamicId] -> ShowS
DynamicId -> [Char]
(Int -> DynamicId -> ShowS)
-> (DynamicId -> [Char])
-> ([DynamicId] -> ShowS)
-> Show DynamicId
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DynamicId -> ShowS
showsPrec :: Int -> DynamicId -> ShowS
$cshow :: DynamicId -> [Char]
show :: DynamicId -> [Char]
$cshowList :: [DynamicId] -> ShowS
showList :: [DynamicId] -> ShowS
P.Show)
newtype File2 = File2 {File2 -> Text
unFile2 :: Text} deriving (File2 -> File2 -> Bool
(File2 -> File2 -> Bool) -> (File2 -> File2 -> Bool) -> Eq File2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: File2 -> File2 -> Bool
== :: File2 -> File2 -> Bool
$c/= :: File2 -> File2 -> Bool
/= :: File2 -> File2 -> Bool
P.Eq, Int -> File2 -> ShowS
[File2] -> ShowS
File2 -> [Char]
(Int -> File2 -> ShowS)
-> (File2 -> [Char]) -> ([File2] -> ShowS) -> Show File2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> File2 -> ShowS
showsPrec :: Int -> File2 -> ShowS
$cshow :: File2 -> [Char]
show :: File2 -> [Char]
$cshowList :: [File2] -> ShowS
showList :: [File2] -> ShowS
P.Show)
newtype Filter = Filter {Filter -> Text
unFilter :: Text} deriving (Filter -> Filter -> Bool
(Filter -> Filter -> Bool)
-> (Filter -> Filter -> Bool) -> Eq Filter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Filter -> Filter -> Bool
== :: Filter -> Filter -> Bool
$c/= :: Filter -> Filter -> Bool
/= :: Filter -> Filter -> Bool
P.Eq, Int -> Filter -> ShowS
[Filter] -> ShowS
Filter -> [Char]
(Int -> Filter -> ShowS)
-> (Filter -> [Char]) -> ([Filter] -> ShowS) -> Show Filter
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Filter -> ShowS
showsPrec :: Int -> Filter -> ShowS
$cshow :: Filter -> [Char]
show :: Filter -> [Char]
$cshowList :: [Filter] -> ShowS
showList :: [Filter] -> ShowS
P.Show)
newtype Force = Force {Force -> Bool
unForce :: Bool} deriving (Force -> Force -> Bool
(Force -> Force -> Bool) -> (Force -> Force -> Bool) -> Eq Force
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Force -> Force -> Bool
== :: Force -> Force -> Bool
$c/= :: Force -> Force -> Bool
/= :: Force -> Force -> Bool
P.Eq, Int -> Force -> ShowS
[Force] -> ShowS
Force -> [Char]
(Int -> Force -> ShowS)
-> (Force -> [Char]) -> ([Force] -> ShowS) -> Show Force
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Force -> ShowS
showsPrec :: Int -> Force -> ShowS
$cshow :: Force -> [Char]
show :: Force -> [Char]
$cshowList :: [Force] -> ShowS
showList :: [Force] -> ShowS
P.Show)
newtype GenerateContentBatch = GenerateContentBatch {GenerateContentBatch -> Text
unGenerateContentBatch :: Text} deriving (GenerateContentBatch -> GenerateContentBatch -> Bool
(GenerateContentBatch -> GenerateContentBatch -> Bool)
-> (GenerateContentBatch -> GenerateContentBatch -> Bool)
-> Eq GenerateContentBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateContentBatch -> GenerateContentBatch -> Bool
== :: GenerateContentBatch -> GenerateContentBatch -> Bool
$c/= :: GenerateContentBatch -> GenerateContentBatch -> Bool
/= :: GenerateContentBatch -> GenerateContentBatch -> Bool
P.Eq, Int -> GenerateContentBatch -> ShowS
[GenerateContentBatch] -> ShowS
GenerateContentBatch -> [Char]
(Int -> GenerateContentBatch -> ShowS)
-> (GenerateContentBatch -> [Char])
-> ([GenerateContentBatch] -> ShowS)
-> Show GenerateContentBatch
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateContentBatch -> ShowS
showsPrec :: Int -> GenerateContentBatch -> ShowS
$cshow :: GenerateContentBatch -> [Char]
show :: GenerateContentBatch -> [Char]
$cshowList :: [GenerateContentBatch] -> ShowS
showList :: [GenerateContentBatch] -> ShowS
P.Show)
newtype GeneratedFile2 = GeneratedFile2 {GeneratedFile2 -> Text
unGeneratedFile2 :: Text} deriving (GeneratedFile2 -> GeneratedFile2 -> Bool
(GeneratedFile2 -> GeneratedFile2 -> Bool)
-> (GeneratedFile2 -> GeneratedFile2 -> Bool) -> Eq GeneratedFile2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GeneratedFile2 -> GeneratedFile2 -> Bool
== :: GeneratedFile2 -> GeneratedFile2 -> Bool
$c/= :: GeneratedFile2 -> GeneratedFile2 -> Bool
/= :: GeneratedFile2 -> GeneratedFile2 -> Bool
P.Eq, Int -> GeneratedFile2 -> ShowS
[GeneratedFile2] -> ShowS
GeneratedFile2 -> [Char]
(Int -> GeneratedFile2 -> ShowS)
-> (GeneratedFile2 -> [Char])
-> ([GeneratedFile2] -> ShowS)
-> Show GeneratedFile2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GeneratedFile2 -> ShowS
showsPrec :: Int -> GeneratedFile2 -> ShowS
$cshow :: GeneratedFile2 -> [Char]
show :: GeneratedFile2 -> [Char]
$cshowList :: [GeneratedFile2] -> ShowS
showList :: [GeneratedFile2] -> ShowS
P.Show)
newtype Id = Id {Id -> Text
unId :: Text} deriving (Id -> Id -> Bool
(Id -> Id -> Bool) -> (Id -> Id -> Bool) -> Eq Id
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Id -> Id -> Bool
== :: Id -> Id -> Bool
$c/= :: Id -> Id -> Bool
/= :: Id -> Id -> Bool
P.Eq, Int -> Id -> ShowS
[Id] -> ShowS
Id -> [Char]
(Int -> Id -> ShowS)
-> (Id -> [Char]) -> ([Id] -> ShowS) -> Show Id
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Id -> ShowS
showsPrec :: Int -> Id -> ShowS
$cshow :: Id -> [Char]
show :: Id -> [Char]
$cshowList :: [Id] -> ShowS
showList :: [Id] -> ShowS
P.Show)
newtype Model2 = Model2 {Model2 -> Text
unModel2 :: Text} deriving (Model2 -> Model2 -> Bool
(Model2 -> Model2 -> Bool)
-> (Model2 -> Model2 -> Bool) -> Eq Model2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Model2 -> Model2 -> Bool
== :: Model2 -> Model2 -> Bool
$c/= :: Model2 -> Model2 -> Bool
/= :: Model2 -> Model2 -> Bool
P.Eq, Int -> Model2 -> ShowS
[Model2] -> ShowS
Model2 -> [Char]
(Int -> Model2 -> ShowS)
-> (Model2 -> [Char]) -> ([Model2] -> ShowS) -> Show Model2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Model2 -> ShowS
showsPrec :: Int -> Model2 -> ShowS
$cshow :: Model2 -> [Char]
show :: Model2 -> [Char]
$cshowList :: [Model2] -> ShowS
showList :: [Model2] -> ShowS
P.Show)
newtype Operation2 = Operation2 {Operation2 -> Text
unOperation2 :: Text} deriving (Operation2 -> Operation2 -> Bool
(Operation2 -> Operation2 -> Bool)
-> (Operation2 -> Operation2 -> Bool) -> Eq Operation2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Operation2 -> Operation2 -> Bool
== :: Operation2 -> Operation2 -> Bool
$c/= :: Operation2 -> Operation2 -> Bool
/= :: Operation2 -> Operation2 -> Bool
P.Eq, Int -> Operation2 -> ShowS
[Operation2] -> ShowS
Operation2 -> [Char]
(Int -> Operation2 -> ShowS)
-> (Operation2 -> [Char])
-> ([Operation2] -> ShowS)
-> Show Operation2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Operation2 -> ShowS
showsPrec :: Int -> Operation2 -> ShowS
$cshow :: Operation2 -> [Char]
show :: Operation2 -> [Char]
$cshowList :: [Operation2] -> ShowS
showList :: [Operation2] -> ShowS
P.Show)
newtype PageSize = PageSize {PageSize -> Int
unPageSize :: Int} deriving (PageSize -> PageSize -> Bool
(PageSize -> PageSize -> Bool)
-> (PageSize -> PageSize -> Bool) -> Eq PageSize
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageSize -> PageSize -> Bool
== :: PageSize -> PageSize -> Bool
$c/= :: PageSize -> PageSize -> Bool
/= :: PageSize -> PageSize -> Bool
P.Eq, Int -> PageSize -> ShowS
[PageSize] -> ShowS
PageSize -> [Char]
(Int -> PageSize -> ShowS)
-> (PageSize -> [Char]) -> ([PageSize] -> ShowS) -> Show PageSize
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageSize -> ShowS
showsPrec :: Int -> PageSize -> ShowS
$cshow :: PageSize -> [Char]
show :: PageSize -> [Char]
$cshowList :: [PageSize] -> ShowS
showList :: [PageSize] -> ShowS
P.Show)
newtype PageToken = PageToken {PageToken -> Text
unPageToken :: Text} deriving (PageToken -> PageToken -> Bool
(PageToken -> PageToken -> Bool)
-> (PageToken -> PageToken -> Bool) -> Eq PageToken
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageToken -> PageToken -> Bool
== :: PageToken -> PageToken -> Bool
$c/= :: PageToken -> PageToken -> Bool
/= :: PageToken -> PageToken -> Bool
P.Eq, Int -> PageToken -> ShowS
[PageToken] -> ShowS
PageToken -> [Char]
(Int -> PageToken -> ShowS)
-> (PageToken -> [Char])
-> ([PageToken] -> ShowS)
-> Show PageToken
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageToken -> ShowS
showsPrec :: Int -> PageToken -> ShowS
$cshow :: PageToken -> [Char]
show :: PageToken -> [Char]
$cshowList :: [PageToken] -> ShowS
showList :: [PageToken] -> ShowS
P.Show)
newtype Permission2 = Permission2 {Permission2 -> Text
unPermission2 :: Text} deriving (Permission2 -> Permission2 -> Bool
(Permission2 -> Permission2 -> Bool)
-> (Permission2 -> Permission2 -> Bool) -> Eq Permission2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Permission2 -> Permission2 -> Bool
== :: Permission2 -> Permission2 -> Bool
$c/= :: Permission2 -> Permission2 -> Bool
/= :: Permission2 -> Permission2 -> Bool
P.Eq, Int -> Permission2 -> ShowS
[Permission2] -> ShowS
Permission2 -> [Char]
(Int -> Permission2 -> ShowS)
-> (Permission2 -> [Char])
-> ([Permission2] -> ShowS)
-> Show Permission2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Permission2 -> ShowS
showsPrec :: Int -> Permission2 -> ShowS
$cshow :: Permission2 -> [Char]
show :: Permission2 -> [Char]
$cshowList :: [Permission2] -> ShowS
showList :: [Permission2] -> ShowS
P.Show)
newtype PrettyPrint = PrettyPrint {PrettyPrint -> Bool
unPrettyPrint :: Bool} deriving (PrettyPrint -> PrettyPrint -> Bool
(PrettyPrint -> PrettyPrint -> Bool)
-> (PrettyPrint -> PrettyPrint -> Bool) -> Eq PrettyPrint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PrettyPrint -> PrettyPrint -> Bool
== :: PrettyPrint -> PrettyPrint -> Bool
$c/= :: PrettyPrint -> PrettyPrint -> Bool
/= :: PrettyPrint -> PrettyPrint -> Bool
P.Eq, Int -> PrettyPrint -> ShowS
[PrettyPrint] -> ShowS
PrettyPrint -> [Char]
(Int -> PrettyPrint -> ShowS)
-> (PrettyPrint -> [Char])
-> ([PrettyPrint] -> ShowS)
-> Show PrettyPrint
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrettyPrint -> ShowS
showsPrec :: Int -> PrettyPrint -> ShowS
$cshow :: PrettyPrint -> [Char]
show :: PrettyPrint -> [Char]
$cshowList :: [PrettyPrint] -> ShowS
showList :: [PrettyPrint] -> ShowS
P.Show)
newtype TunedModel2 = TunedModel2 {TunedModel2 -> Text
unTunedModel2 :: Text} deriving (TunedModel2 -> TunedModel2 -> Bool
(TunedModel2 -> TunedModel2 -> Bool)
-> (TunedModel2 -> TunedModel2 -> Bool) -> Eq TunedModel2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TunedModel2 -> TunedModel2 -> Bool
== :: TunedModel2 -> TunedModel2 -> Bool
$c/= :: TunedModel2 -> TunedModel2 -> Bool
/= :: TunedModel2 -> TunedModel2 -> Bool
P.Eq, Int -> TunedModel2 -> ShowS
[TunedModel2] -> ShowS
TunedModel2 -> [Char]
(Int -> TunedModel2 -> ShowS)
-> (TunedModel2 -> [Char])
-> ([TunedModel2] -> ShowS)
-> Show TunedModel2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TunedModel2 -> ShowS
showsPrec :: Int -> TunedModel2 -> ShowS
$cshow :: TunedModel2 -> [Char]
show :: TunedModel2 -> [Char]
$cshowList :: [TunedModel2] -> ShowS
showList :: [TunedModel2] -> ShowS
P.Show)
newtype TunedModelId = TunedModelId {TunedModelId -> Text
unTunedModelId :: Text} deriving (TunedModelId -> TunedModelId -> Bool
(TunedModelId -> TunedModelId -> Bool)
-> (TunedModelId -> TunedModelId -> Bool) -> Eq TunedModelId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TunedModelId -> TunedModelId -> Bool
== :: TunedModelId -> TunedModelId -> Bool
$c/= :: TunedModelId -> TunedModelId -> Bool
/= :: TunedModelId -> TunedModelId -> Bool
P.Eq, Int -> TunedModelId -> ShowS
[TunedModelId] -> ShowS
TunedModelId -> [Char]
(Int -> TunedModelId -> ShowS)
-> (TunedModelId -> [Char])
-> ([TunedModelId] -> ShowS)
-> Show TunedModelId
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TunedModelId -> ShowS
showsPrec :: Int -> TunedModelId -> ShowS
$cshow :: TunedModelId -> [Char]
show :: TunedModelId -> [Char]
$cshowList :: [TunedModelId] -> ShowS
showList :: [TunedModelId] -> ShowS
P.Show)
newtype UpdateMask = UpdateMask {UpdateMask -> Text
unUpdateMask :: Text} deriving (UpdateMask -> UpdateMask -> Bool
(UpdateMask -> UpdateMask -> Bool)
-> (UpdateMask -> UpdateMask -> Bool) -> Eq UpdateMask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UpdateMask -> UpdateMask -> Bool
== :: UpdateMask -> UpdateMask -> Bool
$c/= :: UpdateMask -> UpdateMask -> Bool
/= :: UpdateMask -> UpdateMask -> Bool
P.Eq, Int -> UpdateMask -> ShowS
[UpdateMask] -> ShowS
UpdateMask -> [Char]
(Int -> UpdateMask -> ShowS)
-> (UpdateMask -> [Char])
-> ([UpdateMask] -> ShowS)
-> Show UpdateMask
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UpdateMask -> ShowS
showsPrec :: Int -> UpdateMask -> ShowS
$cshow :: UpdateMask -> [Char]
show :: UpdateMask -> [Char]
$cshowList :: [UpdateMask] -> ShowS
showList :: [UpdateMask] -> ShowS
P.Show)
newtype Xgafv = Xgafv {Xgafv -> E'Xgafv
unXgafv :: E'Xgafv} deriving (Xgafv -> Xgafv -> Bool
(Xgafv -> Xgafv -> Bool) -> (Xgafv -> Xgafv -> Bool) -> Eq Xgafv
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Xgafv -> Xgafv -> Bool
== :: Xgafv -> Xgafv -> Bool
$c/= :: Xgafv -> Xgafv -> Bool
/= :: Xgafv -> Xgafv -> Bool
P.Eq, Int -> Xgafv -> ShowS
[Xgafv] -> ShowS
Xgafv -> [Char]
(Int -> Xgafv -> ShowS)
-> (Xgafv -> [Char]) -> ([Xgafv] -> ShowS) -> Show Xgafv
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Xgafv -> ShowS
showsPrec :: Int -> Xgafv -> ShowS
$cshow :: Xgafv -> [Char]
show :: Xgafv -> [Char]
$cshowList :: [Xgafv] -> ShowS
showList :: [Xgafv] -> ShowS
P.Show)
data AttributionSourceId = AttributionSourceId
{ AttributionSourceId -> Maybe GroundingPassageId
attributionSourceIdGroundingPassage :: !(Maybe GroundingPassageId)
, AttributionSourceId -> Maybe SemanticRetrieverChunk
attributionSourceIdSemanticRetrieverChunk :: !(Maybe SemanticRetrieverChunk)
}
deriving (Int -> AttributionSourceId -> ShowS
[AttributionSourceId] -> ShowS
AttributionSourceId -> [Char]
(Int -> AttributionSourceId -> ShowS)
-> (AttributionSourceId -> [Char])
-> ([AttributionSourceId] -> ShowS)
-> Show AttributionSourceId
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AttributionSourceId -> ShowS
showsPrec :: Int -> AttributionSourceId -> ShowS
$cshow :: AttributionSourceId -> [Char]
show :: AttributionSourceId -> [Char]
$cshowList :: [AttributionSourceId] -> ShowS
showList :: [AttributionSourceId] -> ShowS
P.Show, AttributionSourceId -> AttributionSourceId -> Bool
(AttributionSourceId -> AttributionSourceId -> Bool)
-> (AttributionSourceId -> AttributionSourceId -> Bool)
-> Eq AttributionSourceId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AttributionSourceId -> AttributionSourceId -> Bool
== :: AttributionSourceId -> AttributionSourceId -> Bool
$c/= :: AttributionSourceId -> AttributionSourceId -> Bool
/= :: AttributionSourceId -> AttributionSourceId -> Bool
P.Eq, P.Typeable)
instance A.FromJSON AttributionSourceId where
parseJSON :: Value -> Parser AttributionSourceId
parseJSON = [Char]
-> (Object -> Parser AttributionSourceId)
-> Value
-> Parser AttributionSourceId
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"AttributionSourceId" ((Object -> Parser AttributionSourceId)
-> Value -> Parser AttributionSourceId)
-> (Object -> Parser AttributionSourceId)
-> Value
-> Parser AttributionSourceId
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe GroundingPassageId
-> Maybe SemanticRetrieverChunk -> AttributionSourceId
AttributionSourceId
(Maybe GroundingPassageId
-> Maybe SemanticRetrieverChunk -> AttributionSourceId)
-> Parser (Maybe GroundingPassageId)
-> Parser (Maybe SemanticRetrieverChunk -> AttributionSourceId)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe GroundingPassageId)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"groundingPassage")
Parser (Maybe SemanticRetrieverChunk -> AttributionSourceId)
-> Parser (Maybe SemanticRetrieverChunk)
-> Parser AttributionSourceId
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe SemanticRetrieverChunk)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"semanticRetrieverChunk")
instance A.ToJSON AttributionSourceId where
toJSON :: AttributionSourceId -> Value
toJSON AttributionSourceId {Maybe GroundingPassageId
Maybe SemanticRetrieverChunk
attributionSourceIdGroundingPassage :: AttributionSourceId -> Maybe GroundingPassageId
attributionSourceIdSemanticRetrieverChunk :: AttributionSourceId -> Maybe SemanticRetrieverChunk
attributionSourceIdGroundingPassage :: Maybe GroundingPassageId
attributionSourceIdSemanticRetrieverChunk :: Maybe SemanticRetrieverChunk
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"groundingPassage" Key -> Maybe GroundingPassageId -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GroundingPassageId
attributionSourceIdGroundingPassage
, Key
"semanticRetrieverChunk" Key -> Maybe SemanticRetrieverChunk -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe SemanticRetrieverChunk
attributionSourceIdSemanticRetrieverChunk
]
mkAttributionSourceId ::
AttributionSourceId
mkAttributionSourceId :: AttributionSourceId
mkAttributionSourceId =
AttributionSourceId
{ attributionSourceIdGroundingPassage :: Maybe GroundingPassageId
attributionSourceIdGroundingPassage = Maybe GroundingPassageId
forall a. Maybe a
Nothing
, attributionSourceIdSemanticRetrieverChunk :: Maybe SemanticRetrieverChunk
attributionSourceIdSemanticRetrieverChunk = Maybe SemanticRetrieverChunk
forall a. Maybe a
Nothing
}
data BaseOperation = BaseOperation
{ BaseOperation -> Maybe Bool
baseOperationDone :: !(Maybe Bool)
, BaseOperation -> Maybe Text
baseOperationName :: !(Maybe Text)
, BaseOperation -> Maybe Status
baseOperationError :: !(Maybe Status)
}
deriving (Int -> BaseOperation -> ShowS
[BaseOperation] -> ShowS
BaseOperation -> [Char]
(Int -> BaseOperation -> ShowS)
-> (BaseOperation -> [Char])
-> ([BaseOperation] -> ShowS)
-> Show BaseOperation
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BaseOperation -> ShowS
showsPrec :: Int -> BaseOperation -> ShowS
$cshow :: BaseOperation -> [Char]
show :: BaseOperation -> [Char]
$cshowList :: [BaseOperation] -> ShowS
showList :: [BaseOperation] -> ShowS
P.Show, BaseOperation -> BaseOperation -> Bool
(BaseOperation -> BaseOperation -> Bool)
-> (BaseOperation -> BaseOperation -> Bool) -> Eq BaseOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BaseOperation -> BaseOperation -> Bool
== :: BaseOperation -> BaseOperation -> Bool
$c/= :: BaseOperation -> BaseOperation -> Bool
/= :: BaseOperation -> BaseOperation -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BaseOperation where
parseJSON :: Value -> Parser BaseOperation
parseJSON = [Char]
-> (Object -> Parser BaseOperation)
-> Value
-> Parser BaseOperation
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BaseOperation" ((Object -> Parser BaseOperation) -> Value -> Parser BaseOperation)
-> (Object -> Parser BaseOperation)
-> Value
-> Parser BaseOperation
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Bool -> Maybe Text -> Maybe Status -> BaseOperation
BaseOperation
(Maybe Bool -> Maybe Text -> Maybe Status -> BaseOperation)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Status -> BaseOperation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"done")
Parser (Maybe Text -> Maybe Status -> BaseOperation)
-> Parser (Maybe Text) -> Parser (Maybe Status -> BaseOperation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser (Maybe Status -> BaseOperation)
-> Parser (Maybe Status) -> Parser BaseOperation
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"error")
instance A.ToJSON BaseOperation where
toJSON :: BaseOperation -> Value
toJSON BaseOperation {Maybe Bool
Maybe Text
Maybe Status
baseOperationDone :: BaseOperation -> Maybe Bool
baseOperationName :: BaseOperation -> Maybe Text
baseOperationError :: BaseOperation -> Maybe Status
baseOperationDone :: Maybe Bool
baseOperationName :: Maybe Text
baseOperationError :: Maybe Status
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"done" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
baseOperationDone
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
baseOperationName
, Key
"error" Key -> Maybe Status -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Status
baseOperationError
]
mkBaseOperation ::
BaseOperation
mkBaseOperation :: BaseOperation
mkBaseOperation =
BaseOperation
{ baseOperationDone :: Maybe Bool
baseOperationDone = Maybe Bool
forall a. Maybe a
Nothing
, baseOperationName :: Maybe Text
baseOperationName = Maybe Text
forall a. Maybe a
Nothing
, baseOperationError :: Maybe Status
baseOperationError = Maybe Status
forall a. Maybe a
Nothing
}
data BatchCreateChunksRequest = BatchCreateChunksRequest
{ BatchCreateChunksRequest -> [CreateChunkRequest]
batchCreateChunksRequestRequests :: !([CreateChunkRequest])
}
deriving (Int -> BatchCreateChunksRequest -> ShowS
[BatchCreateChunksRequest] -> ShowS
BatchCreateChunksRequest -> [Char]
(Int -> BatchCreateChunksRequest -> ShowS)
-> (BatchCreateChunksRequest -> [Char])
-> ([BatchCreateChunksRequest] -> ShowS)
-> Show BatchCreateChunksRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchCreateChunksRequest -> ShowS
showsPrec :: Int -> BatchCreateChunksRequest -> ShowS
$cshow :: BatchCreateChunksRequest -> [Char]
show :: BatchCreateChunksRequest -> [Char]
$cshowList :: [BatchCreateChunksRequest] -> ShowS
showList :: [BatchCreateChunksRequest] -> ShowS
P.Show, BatchCreateChunksRequest -> BatchCreateChunksRequest -> Bool
(BatchCreateChunksRequest -> BatchCreateChunksRequest -> Bool)
-> (BatchCreateChunksRequest -> BatchCreateChunksRequest -> Bool)
-> Eq BatchCreateChunksRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchCreateChunksRequest -> BatchCreateChunksRequest -> Bool
== :: BatchCreateChunksRequest -> BatchCreateChunksRequest -> Bool
$c/= :: BatchCreateChunksRequest -> BatchCreateChunksRequest -> Bool
/= :: BatchCreateChunksRequest -> BatchCreateChunksRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchCreateChunksRequest where
parseJSON :: Value -> Parser BatchCreateChunksRequest
parseJSON = [Char]
-> (Object -> Parser BatchCreateChunksRequest)
-> Value
-> Parser BatchCreateChunksRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchCreateChunksRequest" ((Object -> Parser BatchCreateChunksRequest)
-> Value -> Parser BatchCreateChunksRequest)
-> (Object -> Parser BatchCreateChunksRequest)
-> Value
-> Parser BatchCreateChunksRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[CreateChunkRequest] -> BatchCreateChunksRequest
BatchCreateChunksRequest
([CreateChunkRequest] -> BatchCreateChunksRequest)
-> Parser [CreateChunkRequest] -> Parser BatchCreateChunksRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser [CreateChunkRequest]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"requests")
instance A.ToJSON BatchCreateChunksRequest where
toJSON :: BatchCreateChunksRequest -> Value
toJSON BatchCreateChunksRequest {[CreateChunkRequest]
batchCreateChunksRequestRequests :: BatchCreateChunksRequest -> [CreateChunkRequest]
batchCreateChunksRequestRequests :: [CreateChunkRequest]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"requests" Key -> [CreateChunkRequest] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [CreateChunkRequest]
batchCreateChunksRequestRequests
]
mkBatchCreateChunksRequest ::
[CreateChunkRequest] ->
BatchCreateChunksRequest
mkBatchCreateChunksRequest :: [CreateChunkRequest] -> BatchCreateChunksRequest
mkBatchCreateChunksRequest [CreateChunkRequest]
batchCreateChunksRequestRequests =
BatchCreateChunksRequest
{ [CreateChunkRequest]
batchCreateChunksRequestRequests :: [CreateChunkRequest]
batchCreateChunksRequestRequests :: [CreateChunkRequest]
batchCreateChunksRequestRequests
}
data BatchCreateChunksResponse = BatchCreateChunksResponse
{ BatchCreateChunksResponse -> Maybe [Chunk]
batchCreateChunksResponseChunks :: !(Maybe [Chunk])
}
deriving (Int -> BatchCreateChunksResponse -> ShowS
[BatchCreateChunksResponse] -> ShowS
BatchCreateChunksResponse -> [Char]
(Int -> BatchCreateChunksResponse -> ShowS)
-> (BatchCreateChunksResponse -> [Char])
-> ([BatchCreateChunksResponse] -> ShowS)
-> Show BatchCreateChunksResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchCreateChunksResponse -> ShowS
showsPrec :: Int -> BatchCreateChunksResponse -> ShowS
$cshow :: BatchCreateChunksResponse -> [Char]
show :: BatchCreateChunksResponse -> [Char]
$cshowList :: [BatchCreateChunksResponse] -> ShowS
showList :: [BatchCreateChunksResponse] -> ShowS
P.Show, BatchCreateChunksResponse -> BatchCreateChunksResponse -> Bool
(BatchCreateChunksResponse -> BatchCreateChunksResponse -> Bool)
-> (BatchCreateChunksResponse -> BatchCreateChunksResponse -> Bool)
-> Eq BatchCreateChunksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchCreateChunksResponse -> BatchCreateChunksResponse -> Bool
== :: BatchCreateChunksResponse -> BatchCreateChunksResponse -> Bool
$c/= :: BatchCreateChunksResponse -> BatchCreateChunksResponse -> Bool
/= :: BatchCreateChunksResponse -> BatchCreateChunksResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchCreateChunksResponse where
parseJSON :: Value -> Parser BatchCreateChunksResponse
parseJSON = [Char]
-> (Object -> Parser BatchCreateChunksResponse)
-> Value
-> Parser BatchCreateChunksResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchCreateChunksResponse" ((Object -> Parser BatchCreateChunksResponse)
-> Value -> Parser BatchCreateChunksResponse)
-> (Object -> Parser BatchCreateChunksResponse)
-> Value
-> Parser BatchCreateChunksResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Chunk] -> BatchCreateChunksResponse
BatchCreateChunksResponse
(Maybe [Chunk] -> BatchCreateChunksResponse)
-> Parser (Maybe [Chunk]) -> Parser BatchCreateChunksResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Chunk])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"chunks")
instance A.ToJSON BatchCreateChunksResponse where
toJSON :: BatchCreateChunksResponse -> Value
toJSON BatchCreateChunksResponse {Maybe [Chunk]
batchCreateChunksResponseChunks :: BatchCreateChunksResponse -> Maybe [Chunk]
batchCreateChunksResponseChunks :: Maybe [Chunk]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"chunks" Key -> Maybe [Chunk] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Chunk]
batchCreateChunksResponseChunks
]
mkBatchCreateChunksResponse ::
BatchCreateChunksResponse
mkBatchCreateChunksResponse :: BatchCreateChunksResponse
mkBatchCreateChunksResponse =
BatchCreateChunksResponse
{ batchCreateChunksResponseChunks :: Maybe [Chunk]
batchCreateChunksResponseChunks = Maybe [Chunk]
forall a. Maybe a
Nothing
}
data BatchDeleteChunksRequest = BatchDeleteChunksRequest
{ BatchDeleteChunksRequest -> [DeleteChunkRequest]
batchDeleteChunksRequestRequests :: !([DeleteChunkRequest])
}
deriving (Int -> BatchDeleteChunksRequest -> ShowS
[BatchDeleteChunksRequest] -> ShowS
BatchDeleteChunksRequest -> [Char]
(Int -> BatchDeleteChunksRequest -> ShowS)
-> (BatchDeleteChunksRequest -> [Char])
-> ([BatchDeleteChunksRequest] -> ShowS)
-> Show BatchDeleteChunksRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchDeleteChunksRequest -> ShowS
showsPrec :: Int -> BatchDeleteChunksRequest -> ShowS
$cshow :: BatchDeleteChunksRequest -> [Char]
show :: BatchDeleteChunksRequest -> [Char]
$cshowList :: [BatchDeleteChunksRequest] -> ShowS
showList :: [BatchDeleteChunksRequest] -> ShowS
P.Show, BatchDeleteChunksRequest -> BatchDeleteChunksRequest -> Bool
(BatchDeleteChunksRequest -> BatchDeleteChunksRequest -> Bool)
-> (BatchDeleteChunksRequest -> BatchDeleteChunksRequest -> Bool)
-> Eq BatchDeleteChunksRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchDeleteChunksRequest -> BatchDeleteChunksRequest -> Bool
== :: BatchDeleteChunksRequest -> BatchDeleteChunksRequest -> Bool
$c/= :: BatchDeleteChunksRequest -> BatchDeleteChunksRequest -> Bool
/= :: BatchDeleteChunksRequest -> BatchDeleteChunksRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchDeleteChunksRequest where
parseJSON :: Value -> Parser BatchDeleteChunksRequest
parseJSON = [Char]
-> (Object -> Parser BatchDeleteChunksRequest)
-> Value
-> Parser BatchDeleteChunksRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchDeleteChunksRequest" ((Object -> Parser BatchDeleteChunksRequest)
-> Value -> Parser BatchDeleteChunksRequest)
-> (Object -> Parser BatchDeleteChunksRequest)
-> Value
-> Parser BatchDeleteChunksRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[DeleteChunkRequest] -> BatchDeleteChunksRequest
BatchDeleteChunksRequest
([DeleteChunkRequest] -> BatchDeleteChunksRequest)
-> Parser [DeleteChunkRequest] -> Parser BatchDeleteChunksRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser [DeleteChunkRequest]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"requests")
instance A.ToJSON BatchDeleteChunksRequest where
toJSON :: BatchDeleteChunksRequest -> Value
toJSON BatchDeleteChunksRequest {[DeleteChunkRequest]
batchDeleteChunksRequestRequests :: BatchDeleteChunksRequest -> [DeleteChunkRequest]
batchDeleteChunksRequestRequests :: [DeleteChunkRequest]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"requests" Key -> [DeleteChunkRequest] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [DeleteChunkRequest]
batchDeleteChunksRequestRequests
]
mkBatchDeleteChunksRequest ::
[DeleteChunkRequest] ->
BatchDeleteChunksRequest
mkBatchDeleteChunksRequest :: [DeleteChunkRequest] -> BatchDeleteChunksRequest
mkBatchDeleteChunksRequest [DeleteChunkRequest]
batchDeleteChunksRequestRequests =
BatchDeleteChunksRequest
{ [DeleteChunkRequest]
batchDeleteChunksRequestRequests :: [DeleteChunkRequest]
batchDeleteChunksRequestRequests :: [DeleteChunkRequest]
batchDeleteChunksRequestRequests
}
data BatchEmbedContentsRequest = BatchEmbedContentsRequest
{ BatchEmbedContentsRequest -> [EmbedContentRequest]
batchEmbedContentsRequestRequests :: !([EmbedContentRequest])
}
deriving (Int -> BatchEmbedContentsRequest -> ShowS
[BatchEmbedContentsRequest] -> ShowS
BatchEmbedContentsRequest -> [Char]
(Int -> BatchEmbedContentsRequest -> ShowS)
-> (BatchEmbedContentsRequest -> [Char])
-> ([BatchEmbedContentsRequest] -> ShowS)
-> Show BatchEmbedContentsRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchEmbedContentsRequest -> ShowS
showsPrec :: Int -> BatchEmbedContentsRequest -> ShowS
$cshow :: BatchEmbedContentsRequest -> [Char]
show :: BatchEmbedContentsRequest -> [Char]
$cshowList :: [BatchEmbedContentsRequest] -> ShowS
showList :: [BatchEmbedContentsRequest] -> ShowS
P.Show, BatchEmbedContentsRequest -> BatchEmbedContentsRequest -> Bool
(BatchEmbedContentsRequest -> BatchEmbedContentsRequest -> Bool)
-> (BatchEmbedContentsRequest -> BatchEmbedContentsRequest -> Bool)
-> Eq BatchEmbedContentsRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchEmbedContentsRequest -> BatchEmbedContentsRequest -> Bool
== :: BatchEmbedContentsRequest -> BatchEmbedContentsRequest -> Bool
$c/= :: BatchEmbedContentsRequest -> BatchEmbedContentsRequest -> Bool
/= :: BatchEmbedContentsRequest -> BatchEmbedContentsRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchEmbedContentsRequest where
parseJSON :: Value -> Parser BatchEmbedContentsRequest
parseJSON = [Char]
-> (Object -> Parser BatchEmbedContentsRequest)
-> Value
-> Parser BatchEmbedContentsRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchEmbedContentsRequest" ((Object -> Parser BatchEmbedContentsRequest)
-> Value -> Parser BatchEmbedContentsRequest)
-> (Object -> Parser BatchEmbedContentsRequest)
-> Value
-> Parser BatchEmbedContentsRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[EmbedContentRequest] -> BatchEmbedContentsRequest
BatchEmbedContentsRequest
([EmbedContentRequest] -> BatchEmbedContentsRequest)
-> Parser [EmbedContentRequest] -> Parser BatchEmbedContentsRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser [EmbedContentRequest]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"requests")
instance A.ToJSON BatchEmbedContentsRequest where
toJSON :: BatchEmbedContentsRequest -> Value
toJSON BatchEmbedContentsRequest {[EmbedContentRequest]
batchEmbedContentsRequestRequests :: BatchEmbedContentsRequest -> [EmbedContentRequest]
batchEmbedContentsRequestRequests :: [EmbedContentRequest]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"requests" Key -> [EmbedContentRequest] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [EmbedContentRequest]
batchEmbedContentsRequestRequests
]
mkBatchEmbedContentsRequest ::
[EmbedContentRequest] ->
BatchEmbedContentsRequest
mkBatchEmbedContentsRequest :: [EmbedContentRequest] -> BatchEmbedContentsRequest
mkBatchEmbedContentsRequest [EmbedContentRequest]
batchEmbedContentsRequestRequests =
BatchEmbedContentsRequest
{ [EmbedContentRequest]
batchEmbedContentsRequestRequests :: [EmbedContentRequest]
batchEmbedContentsRequestRequests :: [EmbedContentRequest]
batchEmbedContentsRequestRequests
}
data BatchEmbedContentsResponse = BatchEmbedContentsResponse
{ BatchEmbedContentsResponse -> Maybe [ContentEmbedding]
batchEmbedContentsResponseEmbeddings :: !(Maybe [ContentEmbedding])
}
deriving (Int -> BatchEmbedContentsResponse -> ShowS
[BatchEmbedContentsResponse] -> ShowS
BatchEmbedContentsResponse -> [Char]
(Int -> BatchEmbedContentsResponse -> ShowS)
-> (BatchEmbedContentsResponse -> [Char])
-> ([BatchEmbedContentsResponse] -> ShowS)
-> Show BatchEmbedContentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchEmbedContentsResponse -> ShowS
showsPrec :: Int -> BatchEmbedContentsResponse -> ShowS
$cshow :: BatchEmbedContentsResponse -> [Char]
show :: BatchEmbedContentsResponse -> [Char]
$cshowList :: [BatchEmbedContentsResponse] -> ShowS
showList :: [BatchEmbedContentsResponse] -> ShowS
P.Show, BatchEmbedContentsResponse -> BatchEmbedContentsResponse -> Bool
(BatchEmbedContentsResponse -> BatchEmbedContentsResponse -> Bool)
-> (BatchEmbedContentsResponse
-> BatchEmbedContentsResponse -> Bool)
-> Eq BatchEmbedContentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchEmbedContentsResponse -> BatchEmbedContentsResponse -> Bool
== :: BatchEmbedContentsResponse -> BatchEmbedContentsResponse -> Bool
$c/= :: BatchEmbedContentsResponse -> BatchEmbedContentsResponse -> Bool
/= :: BatchEmbedContentsResponse -> BatchEmbedContentsResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchEmbedContentsResponse where
parseJSON :: Value -> Parser BatchEmbedContentsResponse
parseJSON = [Char]
-> (Object -> Parser BatchEmbedContentsResponse)
-> Value
-> Parser BatchEmbedContentsResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchEmbedContentsResponse" ((Object -> Parser BatchEmbedContentsResponse)
-> Value -> Parser BatchEmbedContentsResponse)
-> (Object -> Parser BatchEmbedContentsResponse)
-> Value
-> Parser BatchEmbedContentsResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [ContentEmbedding] -> BatchEmbedContentsResponse
BatchEmbedContentsResponse
(Maybe [ContentEmbedding] -> BatchEmbedContentsResponse)
-> Parser (Maybe [ContentEmbedding])
-> Parser BatchEmbedContentsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [ContentEmbedding])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"embeddings")
instance A.ToJSON BatchEmbedContentsResponse where
toJSON :: BatchEmbedContentsResponse -> Value
toJSON BatchEmbedContentsResponse {Maybe [ContentEmbedding]
batchEmbedContentsResponseEmbeddings :: BatchEmbedContentsResponse -> Maybe [ContentEmbedding]
batchEmbedContentsResponseEmbeddings :: Maybe [ContentEmbedding]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"embeddings" Key -> Maybe [ContentEmbedding] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ContentEmbedding]
batchEmbedContentsResponseEmbeddings
]
mkBatchEmbedContentsResponse ::
BatchEmbedContentsResponse
mkBatchEmbedContentsResponse :: BatchEmbedContentsResponse
mkBatchEmbedContentsResponse =
BatchEmbedContentsResponse
{ batchEmbedContentsResponseEmbeddings :: Maybe [ContentEmbedding]
batchEmbedContentsResponseEmbeddings = Maybe [ContentEmbedding]
forall a. Maybe a
Nothing
}
data BatchEmbedTextRequest = BatchEmbedTextRequest
{ BatchEmbedTextRequest -> Maybe [EmbedTextRequest]
batchEmbedTextRequestRequests :: !(Maybe [EmbedTextRequest])
, BatchEmbedTextRequest -> Maybe [Text]
batchEmbedTextRequestTexts :: !(Maybe [Text])
}
deriving (Int -> BatchEmbedTextRequest -> ShowS
[BatchEmbedTextRequest] -> ShowS
BatchEmbedTextRequest -> [Char]
(Int -> BatchEmbedTextRequest -> ShowS)
-> (BatchEmbedTextRequest -> [Char])
-> ([BatchEmbedTextRequest] -> ShowS)
-> Show BatchEmbedTextRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchEmbedTextRequest -> ShowS
showsPrec :: Int -> BatchEmbedTextRequest -> ShowS
$cshow :: BatchEmbedTextRequest -> [Char]
show :: BatchEmbedTextRequest -> [Char]
$cshowList :: [BatchEmbedTextRequest] -> ShowS
showList :: [BatchEmbedTextRequest] -> ShowS
P.Show, BatchEmbedTextRequest -> BatchEmbedTextRequest -> Bool
(BatchEmbedTextRequest -> BatchEmbedTextRequest -> Bool)
-> (BatchEmbedTextRequest -> BatchEmbedTextRequest -> Bool)
-> Eq BatchEmbedTextRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchEmbedTextRequest -> BatchEmbedTextRequest -> Bool
== :: BatchEmbedTextRequest -> BatchEmbedTextRequest -> Bool
$c/= :: BatchEmbedTextRequest -> BatchEmbedTextRequest -> Bool
/= :: BatchEmbedTextRequest -> BatchEmbedTextRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchEmbedTextRequest where
parseJSON :: Value -> Parser BatchEmbedTextRequest
parseJSON = [Char]
-> (Object -> Parser BatchEmbedTextRequest)
-> Value
-> Parser BatchEmbedTextRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchEmbedTextRequest" ((Object -> Parser BatchEmbedTextRequest)
-> Value -> Parser BatchEmbedTextRequest)
-> (Object -> Parser BatchEmbedTextRequest)
-> Value
-> Parser BatchEmbedTextRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [EmbedTextRequest] -> Maybe [Text] -> BatchEmbedTextRequest
BatchEmbedTextRequest
(Maybe [EmbedTextRequest] -> Maybe [Text] -> BatchEmbedTextRequest)
-> Parser (Maybe [EmbedTextRequest])
-> Parser (Maybe [Text] -> BatchEmbedTextRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [EmbedTextRequest])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"requests")
Parser (Maybe [Text] -> BatchEmbedTextRequest)
-> Parser (Maybe [Text]) -> Parser BatchEmbedTextRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"texts")
instance A.ToJSON BatchEmbedTextRequest where
toJSON :: BatchEmbedTextRequest -> Value
toJSON BatchEmbedTextRequest {Maybe [Text]
Maybe [EmbedTextRequest]
batchEmbedTextRequestRequests :: BatchEmbedTextRequest -> Maybe [EmbedTextRequest]
batchEmbedTextRequestTexts :: BatchEmbedTextRequest -> Maybe [Text]
batchEmbedTextRequestRequests :: Maybe [EmbedTextRequest]
batchEmbedTextRequestTexts :: Maybe [Text]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"requests" Key -> Maybe [EmbedTextRequest] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [EmbedTextRequest]
batchEmbedTextRequestRequests
, Key
"texts" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
batchEmbedTextRequestTexts
]
mkBatchEmbedTextRequest ::
BatchEmbedTextRequest
mkBatchEmbedTextRequest :: BatchEmbedTextRequest
mkBatchEmbedTextRequest =
BatchEmbedTextRequest
{ batchEmbedTextRequestRequests :: Maybe [EmbedTextRequest]
batchEmbedTextRequestRequests = Maybe [EmbedTextRequest]
forall a. Maybe a
Nothing
, batchEmbedTextRequestTexts :: Maybe [Text]
batchEmbedTextRequestTexts = Maybe [Text]
forall a. Maybe a
Nothing
}
data BatchEmbedTextResponse = BatchEmbedTextResponse
{ BatchEmbedTextResponse -> Maybe [Embedding]
batchEmbedTextResponseEmbeddings :: !(Maybe [Embedding])
}
deriving (Int -> BatchEmbedTextResponse -> ShowS
[BatchEmbedTextResponse] -> ShowS
BatchEmbedTextResponse -> [Char]
(Int -> BatchEmbedTextResponse -> ShowS)
-> (BatchEmbedTextResponse -> [Char])
-> ([BatchEmbedTextResponse] -> ShowS)
-> Show BatchEmbedTextResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchEmbedTextResponse -> ShowS
showsPrec :: Int -> BatchEmbedTextResponse -> ShowS
$cshow :: BatchEmbedTextResponse -> [Char]
show :: BatchEmbedTextResponse -> [Char]
$cshowList :: [BatchEmbedTextResponse] -> ShowS
showList :: [BatchEmbedTextResponse] -> ShowS
P.Show, BatchEmbedTextResponse -> BatchEmbedTextResponse -> Bool
(BatchEmbedTextResponse -> BatchEmbedTextResponse -> Bool)
-> (BatchEmbedTextResponse -> BatchEmbedTextResponse -> Bool)
-> Eq BatchEmbedTextResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchEmbedTextResponse -> BatchEmbedTextResponse -> Bool
== :: BatchEmbedTextResponse -> BatchEmbedTextResponse -> Bool
$c/= :: BatchEmbedTextResponse -> BatchEmbedTextResponse -> Bool
/= :: BatchEmbedTextResponse -> BatchEmbedTextResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchEmbedTextResponse where
parseJSON :: Value -> Parser BatchEmbedTextResponse
parseJSON = [Char]
-> (Object -> Parser BatchEmbedTextResponse)
-> Value
-> Parser BatchEmbedTextResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchEmbedTextResponse" ((Object -> Parser BatchEmbedTextResponse)
-> Value -> Parser BatchEmbedTextResponse)
-> (Object -> Parser BatchEmbedTextResponse)
-> Value
-> Parser BatchEmbedTextResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Embedding] -> BatchEmbedTextResponse
BatchEmbedTextResponse
(Maybe [Embedding] -> BatchEmbedTextResponse)
-> Parser (Maybe [Embedding]) -> Parser BatchEmbedTextResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Embedding])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"embeddings")
instance A.ToJSON BatchEmbedTextResponse where
toJSON :: BatchEmbedTextResponse -> Value
toJSON BatchEmbedTextResponse {Maybe [Embedding]
batchEmbedTextResponseEmbeddings :: BatchEmbedTextResponse -> Maybe [Embedding]
batchEmbedTextResponseEmbeddings :: Maybe [Embedding]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"embeddings" Key -> Maybe [Embedding] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Embedding]
batchEmbedTextResponseEmbeddings
]
mkBatchEmbedTextResponse ::
BatchEmbedTextResponse
mkBatchEmbedTextResponse :: BatchEmbedTextResponse
mkBatchEmbedTextResponse =
BatchEmbedTextResponse
{ batchEmbedTextResponseEmbeddings :: Maybe [Embedding]
batchEmbedTextResponseEmbeddings = Maybe [Embedding]
forall a. Maybe a
Nothing
}
data BatchUpdateChunksRequest = BatchUpdateChunksRequest
{ BatchUpdateChunksRequest -> [UpdateChunkRequest]
batchUpdateChunksRequestRequests :: !([UpdateChunkRequest])
}
deriving (Int -> BatchUpdateChunksRequest -> ShowS
[BatchUpdateChunksRequest] -> ShowS
BatchUpdateChunksRequest -> [Char]
(Int -> BatchUpdateChunksRequest -> ShowS)
-> (BatchUpdateChunksRequest -> [Char])
-> ([BatchUpdateChunksRequest] -> ShowS)
-> Show BatchUpdateChunksRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchUpdateChunksRequest -> ShowS
showsPrec :: Int -> BatchUpdateChunksRequest -> ShowS
$cshow :: BatchUpdateChunksRequest -> [Char]
show :: BatchUpdateChunksRequest -> [Char]
$cshowList :: [BatchUpdateChunksRequest] -> ShowS
showList :: [BatchUpdateChunksRequest] -> ShowS
P.Show, BatchUpdateChunksRequest -> BatchUpdateChunksRequest -> Bool
(BatchUpdateChunksRequest -> BatchUpdateChunksRequest -> Bool)
-> (BatchUpdateChunksRequest -> BatchUpdateChunksRequest -> Bool)
-> Eq BatchUpdateChunksRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchUpdateChunksRequest -> BatchUpdateChunksRequest -> Bool
== :: BatchUpdateChunksRequest -> BatchUpdateChunksRequest -> Bool
$c/= :: BatchUpdateChunksRequest -> BatchUpdateChunksRequest -> Bool
/= :: BatchUpdateChunksRequest -> BatchUpdateChunksRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchUpdateChunksRequest where
parseJSON :: Value -> Parser BatchUpdateChunksRequest
parseJSON = [Char]
-> (Object -> Parser BatchUpdateChunksRequest)
-> Value
-> Parser BatchUpdateChunksRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchUpdateChunksRequest" ((Object -> Parser BatchUpdateChunksRequest)
-> Value -> Parser BatchUpdateChunksRequest)
-> (Object -> Parser BatchUpdateChunksRequest)
-> Value
-> Parser BatchUpdateChunksRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[UpdateChunkRequest] -> BatchUpdateChunksRequest
BatchUpdateChunksRequest
([UpdateChunkRequest] -> BatchUpdateChunksRequest)
-> Parser [UpdateChunkRequest] -> Parser BatchUpdateChunksRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser [UpdateChunkRequest]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"requests")
instance A.ToJSON BatchUpdateChunksRequest where
toJSON :: BatchUpdateChunksRequest -> Value
toJSON BatchUpdateChunksRequest {[UpdateChunkRequest]
batchUpdateChunksRequestRequests :: BatchUpdateChunksRequest -> [UpdateChunkRequest]
batchUpdateChunksRequestRequests :: [UpdateChunkRequest]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"requests" Key -> [UpdateChunkRequest] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [UpdateChunkRequest]
batchUpdateChunksRequestRequests
]
mkBatchUpdateChunksRequest ::
[UpdateChunkRequest] ->
BatchUpdateChunksRequest
mkBatchUpdateChunksRequest :: [UpdateChunkRequest] -> BatchUpdateChunksRequest
mkBatchUpdateChunksRequest [UpdateChunkRequest]
batchUpdateChunksRequestRequests =
BatchUpdateChunksRequest
{ [UpdateChunkRequest]
batchUpdateChunksRequestRequests :: [UpdateChunkRequest]
batchUpdateChunksRequestRequests :: [UpdateChunkRequest]
batchUpdateChunksRequestRequests
}
data BatchUpdateChunksResponse = BatchUpdateChunksResponse
{ BatchUpdateChunksResponse -> Maybe [Chunk]
batchUpdateChunksResponseChunks :: !(Maybe [Chunk])
}
deriving (Int -> BatchUpdateChunksResponse -> ShowS
[BatchUpdateChunksResponse] -> ShowS
BatchUpdateChunksResponse -> [Char]
(Int -> BatchUpdateChunksResponse -> ShowS)
-> (BatchUpdateChunksResponse -> [Char])
-> ([BatchUpdateChunksResponse] -> ShowS)
-> Show BatchUpdateChunksResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchUpdateChunksResponse -> ShowS
showsPrec :: Int -> BatchUpdateChunksResponse -> ShowS
$cshow :: BatchUpdateChunksResponse -> [Char]
show :: BatchUpdateChunksResponse -> [Char]
$cshowList :: [BatchUpdateChunksResponse] -> ShowS
showList :: [BatchUpdateChunksResponse] -> ShowS
P.Show, BatchUpdateChunksResponse -> BatchUpdateChunksResponse -> Bool
(BatchUpdateChunksResponse -> BatchUpdateChunksResponse -> Bool)
-> (BatchUpdateChunksResponse -> BatchUpdateChunksResponse -> Bool)
-> Eq BatchUpdateChunksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchUpdateChunksResponse -> BatchUpdateChunksResponse -> Bool
== :: BatchUpdateChunksResponse -> BatchUpdateChunksResponse -> Bool
$c/= :: BatchUpdateChunksResponse -> BatchUpdateChunksResponse -> Bool
/= :: BatchUpdateChunksResponse -> BatchUpdateChunksResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON BatchUpdateChunksResponse where
parseJSON :: Value -> Parser BatchUpdateChunksResponse
parseJSON = [Char]
-> (Object -> Parser BatchUpdateChunksResponse)
-> Value
-> Parser BatchUpdateChunksResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"BatchUpdateChunksResponse" ((Object -> Parser BatchUpdateChunksResponse)
-> Value -> Parser BatchUpdateChunksResponse)
-> (Object -> Parser BatchUpdateChunksResponse)
-> Value
-> Parser BatchUpdateChunksResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Chunk] -> BatchUpdateChunksResponse
BatchUpdateChunksResponse
(Maybe [Chunk] -> BatchUpdateChunksResponse)
-> Parser (Maybe [Chunk]) -> Parser BatchUpdateChunksResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Chunk])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"chunks")
instance A.ToJSON BatchUpdateChunksResponse where
toJSON :: BatchUpdateChunksResponse -> Value
toJSON BatchUpdateChunksResponse {Maybe [Chunk]
batchUpdateChunksResponseChunks :: BatchUpdateChunksResponse -> Maybe [Chunk]
batchUpdateChunksResponseChunks :: Maybe [Chunk]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"chunks" Key -> Maybe [Chunk] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Chunk]
batchUpdateChunksResponseChunks
]
mkBatchUpdateChunksResponse ::
BatchUpdateChunksResponse
mkBatchUpdateChunksResponse :: BatchUpdateChunksResponse
mkBatchUpdateChunksResponse =
BatchUpdateChunksResponse
{ batchUpdateChunksResponseChunks :: Maybe [Chunk]
batchUpdateChunksResponseChunks = Maybe [Chunk]
forall a. Maybe a
Nothing
}
data Blob = Blob
{ Blob -> Maybe ByteArray
blobData :: !(Maybe ByteArray)
, Blob -> Maybe Text
blobMimeType :: !(Maybe Text)
}
deriving (Int -> Blob -> ShowS
[Blob] -> ShowS
Blob -> [Char]
(Int -> Blob -> ShowS)
-> (Blob -> [Char]) -> ([Blob] -> ShowS) -> Show Blob
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Blob -> ShowS
showsPrec :: Int -> Blob -> ShowS
$cshow :: Blob -> [Char]
show :: Blob -> [Char]
$cshowList :: [Blob] -> ShowS
showList :: [Blob] -> ShowS
P.Show, Blob -> Blob -> Bool
(Blob -> Blob -> Bool) -> (Blob -> Blob -> Bool) -> Eq Blob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Blob -> Blob -> Bool
== :: Blob -> Blob -> Bool
$c/= :: Blob -> Blob -> Bool
/= :: Blob -> Blob -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Blob where
parseJSON :: Value -> Parser Blob
parseJSON = [Char] -> (Object -> Parser Blob) -> Value -> Parser Blob
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Blob" ((Object -> Parser Blob) -> Value -> Parser Blob)
-> (Object -> Parser Blob) -> Value -> Parser Blob
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe ByteArray -> Maybe Text -> Blob
Blob
(Maybe ByteArray -> Maybe Text -> Blob)
-> Parser (Maybe ByteArray) -> Parser (Maybe Text -> Blob)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe ByteArray)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"data")
Parser (Maybe Text -> Blob) -> Parser (Maybe Text) -> Parser Blob
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"mimeType")
instance A.ToJSON Blob where
toJSON :: Blob -> Value
toJSON Blob {Maybe Text
Maybe ByteArray
blobData :: Blob -> Maybe ByteArray
blobMimeType :: Blob -> Maybe Text
blobData :: Maybe ByteArray
blobMimeType :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"data" Key -> Maybe ByteArray -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ByteArray
blobData
, Key
"mimeType" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
blobMimeType
]
mkBlob ::
Blob
mkBlob :: Blob
mkBlob =
Blob
{ blobData :: Maybe ByteArray
blobData = Maybe ByteArray
forall a. Maybe a
Nothing
, blobMimeType :: Maybe Text
blobMimeType = Maybe Text
forall a. Maybe a
Nothing
}
data CachedContent = CachedContent
{ CachedContent -> Maybe [Tool]
cachedContentTools :: !(Maybe [Tool])
, CachedContent -> Maybe Text
cachedContentDisplayName :: !(Maybe Text)
, CachedContent -> Text
cachedContentModel :: !(Text)
, CachedContent -> Maybe DateTime
cachedContentExpireTime :: !(Maybe DateTime)
, CachedContent -> Maybe CachedContentUsageMetadata
cachedContentUsageMetadata :: !(Maybe CachedContentUsageMetadata)
, CachedContent -> Maybe Text
cachedContentName :: !(Maybe Text)
, CachedContent -> Maybe [Content]
cachedContentContents :: !(Maybe [Content])
, CachedContent -> Maybe Content
cachedContentSystemInstruction :: !(Maybe Content)
, CachedContent -> Maybe ToolConfig
cachedContentToolConfig :: !(Maybe ToolConfig)
, CachedContent -> Maybe DateTime
cachedContentCreateTime :: !(Maybe DateTime)
, CachedContent -> Maybe Text
cachedContentTtl :: !(Maybe Text)
, CachedContent -> Maybe DateTime
cachedContentUpdateTime :: !(Maybe DateTime)
}
deriving (Int -> CachedContent -> ShowS
[CachedContent] -> ShowS
CachedContent -> [Char]
(Int -> CachedContent -> ShowS)
-> (CachedContent -> [Char])
-> ([CachedContent] -> ShowS)
-> Show CachedContent
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CachedContent -> ShowS
showsPrec :: Int -> CachedContent -> ShowS
$cshow :: CachedContent -> [Char]
show :: CachedContent -> [Char]
$cshowList :: [CachedContent] -> ShowS
showList :: [CachedContent] -> ShowS
P.Show, CachedContent -> CachedContent -> Bool
(CachedContent -> CachedContent -> Bool)
-> (CachedContent -> CachedContent -> Bool) -> Eq CachedContent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CachedContent -> CachedContent -> Bool
== :: CachedContent -> CachedContent -> Bool
$c/= :: CachedContent -> CachedContent -> Bool
/= :: CachedContent -> CachedContent -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CachedContent where
parseJSON :: Value -> Parser CachedContent
parseJSON = [Char]
-> (Object -> Parser CachedContent)
-> Value
-> Parser CachedContent
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CachedContent" ((Object -> Parser CachedContent) -> Value -> Parser CachedContent)
-> (Object -> Parser CachedContent)
-> Value
-> Parser CachedContent
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Tool]
-> Maybe Text
-> Text
-> Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent
CachedContent
(Maybe [Tool]
-> Maybe Text
-> Text
-> Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser (Maybe [Tool])
-> Parser
(Maybe Text
-> Text
-> Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Tool])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tools")
Parser
(Maybe Text
-> Text
-> Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser (Maybe Text)
-> Parser
(Text
-> Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"displayName")
Parser
(Text
-> Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser Text
-> Parser
(Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"model")
Parser
(Maybe DateTime
-> Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser (Maybe DateTime)
-> Parser
(Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"expireTime")
Parser
(Maybe CachedContentUsageMetadata
-> Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser (Maybe CachedContentUsageMetadata)
-> Parser
(Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe CachedContentUsageMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"usageMetadata")
Parser
(Maybe Text
-> Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser (Maybe Text)
-> Parser
(Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser
(Maybe [Content]
-> Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser (Maybe [Content])
-> Parser
(Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Content])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"contents")
Parser
(Maybe Content
-> Maybe ToolConfig
-> Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> CachedContent)
-> Parser (Maybe Content)
-> Parser
(Maybe ToolConfig
-> Maybe DateTime -> Maybe Text -> Maybe DateTime -> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Content)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"systemInstruction")
Parser
(Maybe ToolConfig
-> Maybe DateTime -> Maybe Text -> Maybe DateTime -> CachedContent)
-> Parser (Maybe ToolConfig)
-> Parser
(Maybe DateTime -> Maybe Text -> Maybe DateTime -> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe ToolConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"toolConfig")
Parser
(Maybe DateTime -> Maybe Text -> Maybe DateTime -> CachedContent)
-> Parser (Maybe DateTime)
-> Parser (Maybe Text -> Maybe DateTime -> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"createTime")
Parser (Maybe Text -> Maybe DateTime -> CachedContent)
-> Parser (Maybe Text) -> Parser (Maybe DateTime -> CachedContent)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"ttl")
Parser (Maybe DateTime -> CachedContent)
-> Parser (Maybe DateTime) -> Parser CachedContent
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"updateTime")
instance A.ToJSON CachedContent where
toJSON :: CachedContent -> Value
toJSON CachedContent {Maybe [Content]
Maybe [Tool]
Maybe Text
Maybe DateTime
Maybe CachedContentUsageMetadata
Maybe Content
Maybe ToolConfig
Text
cachedContentTools :: CachedContent -> Maybe [Tool]
cachedContentDisplayName :: CachedContent -> Maybe Text
cachedContentModel :: CachedContent -> Text
cachedContentExpireTime :: CachedContent -> Maybe DateTime
cachedContentUsageMetadata :: CachedContent -> Maybe CachedContentUsageMetadata
cachedContentName :: CachedContent -> Maybe Text
cachedContentContents :: CachedContent -> Maybe [Content]
cachedContentSystemInstruction :: CachedContent -> Maybe Content
cachedContentToolConfig :: CachedContent -> Maybe ToolConfig
cachedContentCreateTime :: CachedContent -> Maybe DateTime
cachedContentTtl :: CachedContent -> Maybe Text
cachedContentUpdateTime :: CachedContent -> Maybe DateTime
cachedContentTools :: Maybe [Tool]
cachedContentDisplayName :: Maybe Text
cachedContentModel :: Text
cachedContentExpireTime :: Maybe DateTime
cachedContentUsageMetadata :: Maybe CachedContentUsageMetadata
cachedContentName :: Maybe Text
cachedContentContents :: Maybe [Content]
cachedContentSystemInstruction :: Maybe Content
cachedContentToolConfig :: Maybe ToolConfig
cachedContentCreateTime :: Maybe DateTime
cachedContentTtl :: Maybe Text
cachedContentUpdateTime :: Maybe DateTime
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"tools" Key -> Maybe [Tool] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Tool]
cachedContentTools
, Key
"displayName" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
cachedContentDisplayName
, Key
"model" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
cachedContentModel
, Key
"expireTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
cachedContentExpireTime
, Key
"usageMetadata" Key -> Maybe CachedContentUsageMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe CachedContentUsageMetadata
cachedContentUsageMetadata
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
cachedContentName
, Key
"contents" Key -> Maybe [Content] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Content]
cachedContentContents
, Key
"systemInstruction" Key -> Maybe Content -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Content
cachedContentSystemInstruction
, Key
"toolConfig" Key -> Maybe ToolConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ToolConfig
cachedContentToolConfig
, Key
"createTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
cachedContentCreateTime
, Key
"ttl" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
cachedContentTtl
, Key
"updateTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
cachedContentUpdateTime
]
mkCachedContent ::
Text ->
CachedContent
mkCachedContent :: Text -> CachedContent
mkCachedContent Text
cachedContentModel =
CachedContent
{ cachedContentTools :: Maybe [Tool]
cachedContentTools = Maybe [Tool]
forall a. Maybe a
Nothing
, cachedContentDisplayName :: Maybe Text
cachedContentDisplayName = Maybe Text
forall a. Maybe a
Nothing
, Text
cachedContentModel :: Text
cachedContentModel :: Text
cachedContentModel
, cachedContentExpireTime :: Maybe DateTime
cachedContentExpireTime = Maybe DateTime
forall a. Maybe a
Nothing
, cachedContentUsageMetadata :: Maybe CachedContentUsageMetadata
cachedContentUsageMetadata = Maybe CachedContentUsageMetadata
forall a. Maybe a
Nothing
, cachedContentName :: Maybe Text
cachedContentName = Maybe Text
forall a. Maybe a
Nothing
, cachedContentContents :: Maybe [Content]
cachedContentContents = Maybe [Content]
forall a. Maybe a
Nothing
, cachedContentSystemInstruction :: Maybe Content
cachedContentSystemInstruction = Maybe Content
forall a. Maybe a
Nothing
, cachedContentToolConfig :: Maybe ToolConfig
cachedContentToolConfig = Maybe ToolConfig
forall a. Maybe a
Nothing
, cachedContentCreateTime :: Maybe DateTime
cachedContentCreateTime = Maybe DateTime
forall a. Maybe a
Nothing
, cachedContentTtl :: Maybe Text
cachedContentTtl = Maybe Text
forall a. Maybe a
Nothing
, cachedContentUpdateTime :: Maybe DateTime
cachedContentUpdateTime = Maybe DateTime
forall a. Maybe a
Nothing
}
data CachedContentUsageMetadata = CachedContentUsageMetadata
{ CachedContentUsageMetadata -> Maybe Int
cachedContentUsageMetadataTotalTokenCount :: !(Maybe Int)
}
deriving (Int -> CachedContentUsageMetadata -> ShowS
[CachedContentUsageMetadata] -> ShowS
CachedContentUsageMetadata -> [Char]
(Int -> CachedContentUsageMetadata -> ShowS)
-> (CachedContentUsageMetadata -> [Char])
-> ([CachedContentUsageMetadata] -> ShowS)
-> Show CachedContentUsageMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CachedContentUsageMetadata -> ShowS
showsPrec :: Int -> CachedContentUsageMetadata -> ShowS
$cshow :: CachedContentUsageMetadata -> [Char]
show :: CachedContentUsageMetadata -> [Char]
$cshowList :: [CachedContentUsageMetadata] -> ShowS
showList :: [CachedContentUsageMetadata] -> ShowS
P.Show, CachedContentUsageMetadata -> CachedContentUsageMetadata -> Bool
(CachedContentUsageMetadata -> CachedContentUsageMetadata -> Bool)
-> (CachedContentUsageMetadata
-> CachedContentUsageMetadata -> Bool)
-> Eq CachedContentUsageMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CachedContentUsageMetadata -> CachedContentUsageMetadata -> Bool
== :: CachedContentUsageMetadata -> CachedContentUsageMetadata -> Bool
$c/= :: CachedContentUsageMetadata -> CachedContentUsageMetadata -> Bool
/= :: CachedContentUsageMetadata -> CachedContentUsageMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CachedContentUsageMetadata where
parseJSON :: Value -> Parser CachedContentUsageMetadata
parseJSON = [Char]
-> (Object -> Parser CachedContentUsageMetadata)
-> Value
-> Parser CachedContentUsageMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CachedContentUsageMetadata" ((Object -> Parser CachedContentUsageMetadata)
-> Value -> Parser CachedContentUsageMetadata)
-> (Object -> Parser CachedContentUsageMetadata)
-> Value
-> Parser CachedContentUsageMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int -> CachedContentUsageMetadata
CachedContentUsageMetadata
(Maybe Int -> CachedContentUsageMetadata)
-> Parser (Maybe Int) -> Parser CachedContentUsageMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"totalTokenCount")
instance A.ToJSON CachedContentUsageMetadata where
toJSON :: CachedContentUsageMetadata -> Value
toJSON CachedContentUsageMetadata {Maybe Int
cachedContentUsageMetadataTotalTokenCount :: CachedContentUsageMetadata -> Maybe Int
cachedContentUsageMetadataTotalTokenCount :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"totalTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
cachedContentUsageMetadataTotalTokenCount
]
mkCachedContentUsageMetadata ::
CachedContentUsageMetadata
mkCachedContentUsageMetadata :: CachedContentUsageMetadata
mkCachedContentUsageMetadata =
CachedContentUsageMetadata
{ cachedContentUsageMetadataTotalTokenCount :: Maybe Int
cachedContentUsageMetadataTotalTokenCount = Maybe Int
forall a. Maybe a
Nothing
}
data Candidate = Candidate
{ Candidate -> Maybe CitationMetadata
candidateCitationMetadata :: !(Maybe CitationMetadata)
, Candidate -> Maybe GroundingMetadata
candidateGroundingMetadata :: !(Maybe GroundingMetadata)
, Candidate -> Maybe UrlContextMetadata
candidateUrlContextMetadata :: !(Maybe UrlContextMetadata)
, Candidate -> Maybe [GroundingAttribution]
candidateGroundingAttributions :: !(Maybe [GroundingAttribution])
, Candidate -> Maybe LogprobsResult
candidateLogprobsResult :: !(Maybe LogprobsResult)
, Candidate -> Maybe Content
candidateContent :: !(Maybe Content)
, Candidate -> Maybe Double
candidateAvgLogprobs :: !(Maybe Double)
, Candidate -> Maybe Int
candidateIndex :: !(Maybe Int)
, Candidate -> Maybe E'FinishReason
candidateFinishReason :: !(Maybe E'FinishReason)
, Candidate -> Maybe [SafetyRating]
candidateSafetyRatings :: !(Maybe [SafetyRating])
, Candidate -> Maybe Int
candidateTokenCount :: !(Maybe Int)
}
deriving (Int -> Candidate -> ShowS
[Candidate] -> ShowS
Candidate -> [Char]
(Int -> Candidate -> ShowS)
-> (Candidate -> [Char])
-> ([Candidate] -> ShowS)
-> Show Candidate
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Candidate -> ShowS
showsPrec :: Int -> Candidate -> ShowS
$cshow :: Candidate -> [Char]
show :: Candidate -> [Char]
$cshowList :: [Candidate] -> ShowS
showList :: [Candidate] -> ShowS
P.Show, Candidate -> Candidate -> Bool
(Candidate -> Candidate -> Bool)
-> (Candidate -> Candidate -> Bool) -> Eq Candidate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Candidate -> Candidate -> Bool
== :: Candidate -> Candidate -> Bool
$c/= :: Candidate -> Candidate -> Bool
/= :: Candidate -> Candidate -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Candidate where
parseJSON :: Value -> Parser Candidate
parseJSON = [Char] -> (Object -> Parser Candidate) -> Value -> Parser Candidate
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Candidate" ((Object -> Parser Candidate) -> Value -> Parser Candidate)
-> (Object -> Parser Candidate) -> Value -> Parser Candidate
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe CitationMetadata
-> Maybe GroundingMetadata
-> Maybe UrlContextMetadata
-> Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate
Candidate
(Maybe CitationMetadata
-> Maybe GroundingMetadata
-> Maybe UrlContextMetadata
-> Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe CitationMetadata)
-> Parser
(Maybe GroundingMetadata
-> Maybe UrlContextMetadata
-> Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe CitationMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"citationMetadata")
Parser
(Maybe GroundingMetadata
-> Maybe UrlContextMetadata
-> Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe GroundingMetadata)
-> Parser
(Maybe UrlContextMetadata
-> Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe GroundingMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"groundingMetadata")
Parser
(Maybe UrlContextMetadata
-> Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe UrlContextMetadata)
-> Parser
(Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe UrlContextMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"urlContextMetadata")
Parser
(Maybe [GroundingAttribution]
-> Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe [GroundingAttribution])
-> Parser
(Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [GroundingAttribution])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"groundingAttributions")
Parser
(Maybe LogprobsResult
-> Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe LogprobsResult)
-> Parser
(Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe LogprobsResult)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"logprobsResult")
Parser
(Maybe Content
-> Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe Content)
-> Parser
(Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Content)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"content")
Parser
(Maybe Double
-> Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe Double)
-> Parser
(Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"avgLogprobs")
Parser
(Maybe Int
-> Maybe E'FinishReason
-> Maybe [SafetyRating]
-> Maybe Int
-> Candidate)
-> Parser (Maybe Int)
-> Parser
(Maybe E'FinishReason
-> Maybe [SafetyRating] -> Maybe Int -> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"index")
Parser
(Maybe E'FinishReason
-> Maybe [SafetyRating] -> Maybe Int -> Candidate)
-> Parser (Maybe E'FinishReason)
-> Parser (Maybe [SafetyRating] -> Maybe Int -> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'FinishReason)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"finishReason")
Parser (Maybe [SafetyRating] -> Maybe Int -> Candidate)
-> Parser (Maybe [SafetyRating]) -> Parser (Maybe Int -> Candidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [SafetyRating])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetyRatings")
Parser (Maybe Int -> Candidate)
-> Parser (Maybe Int) -> Parser Candidate
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tokenCount")
instance A.ToJSON Candidate where
toJSON :: Candidate -> Value
toJSON Candidate {Maybe Double
Maybe Int
Maybe [GroundingAttribution]
Maybe [SafetyRating]
Maybe CitationMetadata
Maybe Content
Maybe E'FinishReason
Maybe GroundingMetadata
Maybe LogprobsResult
Maybe UrlContextMetadata
candidateCitationMetadata :: Candidate -> Maybe CitationMetadata
candidateGroundingMetadata :: Candidate -> Maybe GroundingMetadata
candidateUrlContextMetadata :: Candidate -> Maybe UrlContextMetadata
candidateGroundingAttributions :: Candidate -> Maybe [GroundingAttribution]
candidateLogprobsResult :: Candidate -> Maybe LogprobsResult
candidateContent :: Candidate -> Maybe Content
candidateAvgLogprobs :: Candidate -> Maybe Double
candidateIndex :: Candidate -> Maybe Int
candidateFinishReason :: Candidate -> Maybe E'FinishReason
candidateSafetyRatings :: Candidate -> Maybe [SafetyRating]
candidateTokenCount :: Candidate -> Maybe Int
candidateCitationMetadata :: Maybe CitationMetadata
candidateGroundingMetadata :: Maybe GroundingMetadata
candidateUrlContextMetadata :: Maybe UrlContextMetadata
candidateGroundingAttributions :: Maybe [GroundingAttribution]
candidateLogprobsResult :: Maybe LogprobsResult
candidateContent :: Maybe Content
candidateAvgLogprobs :: Maybe Double
candidateIndex :: Maybe Int
candidateFinishReason :: Maybe E'FinishReason
candidateSafetyRatings :: Maybe [SafetyRating]
candidateTokenCount :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"citationMetadata" Key -> Maybe CitationMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe CitationMetadata
candidateCitationMetadata
, Key
"groundingMetadata" Key -> Maybe GroundingMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GroundingMetadata
candidateGroundingMetadata
, Key
"urlContextMetadata" Key -> Maybe UrlContextMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe UrlContextMetadata
candidateUrlContextMetadata
, Key
"groundingAttributions" Key -> Maybe [GroundingAttribution] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [GroundingAttribution]
candidateGroundingAttributions
, Key
"logprobsResult" Key -> Maybe LogprobsResult -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe LogprobsResult
candidateLogprobsResult
, Key
"content" Key -> Maybe Content -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Content
candidateContent
, Key
"avgLogprobs" Key -> Maybe Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Double
candidateAvgLogprobs
, Key
"index" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
candidateIndex
, Key
"finishReason" Key -> Maybe E'FinishReason -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'FinishReason
candidateFinishReason
, Key
"safetyRatings" Key -> Maybe [SafetyRating] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetyRating]
candidateSafetyRatings
, Key
"tokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
candidateTokenCount
]
mkCandidate ::
Candidate
mkCandidate :: Candidate
mkCandidate =
Candidate
{ candidateCitationMetadata :: Maybe CitationMetadata
candidateCitationMetadata = Maybe CitationMetadata
forall a. Maybe a
Nothing
, candidateGroundingMetadata :: Maybe GroundingMetadata
candidateGroundingMetadata = Maybe GroundingMetadata
forall a. Maybe a
Nothing
, candidateUrlContextMetadata :: Maybe UrlContextMetadata
candidateUrlContextMetadata = Maybe UrlContextMetadata
forall a. Maybe a
Nothing
, candidateGroundingAttributions :: Maybe [GroundingAttribution]
candidateGroundingAttributions = Maybe [GroundingAttribution]
forall a. Maybe a
Nothing
, candidateLogprobsResult :: Maybe LogprobsResult
candidateLogprobsResult = Maybe LogprobsResult
forall a. Maybe a
Nothing
, candidateContent :: Maybe Content
candidateContent = Maybe Content
forall a. Maybe a
Nothing
, candidateAvgLogprobs :: Maybe Double
candidateAvgLogprobs = Maybe Double
forall a. Maybe a
Nothing
, candidateIndex :: Maybe Int
candidateIndex = Maybe Int
forall a. Maybe a
Nothing
, candidateFinishReason :: Maybe E'FinishReason
candidateFinishReason = Maybe E'FinishReason
forall a. Maybe a
Nothing
, candidateSafetyRatings :: Maybe [SafetyRating]
candidateSafetyRatings = Maybe [SafetyRating]
forall a. Maybe a
Nothing
, candidateTokenCount :: Maybe Int
candidateTokenCount = Maybe Int
forall a. Maybe a
Nothing
}
data Chunk = Chunk
{ Chunk -> Maybe DateTime
chunkCreateTime :: !(Maybe DateTime)
, Chunk -> Maybe [CustomMetadata]
chunkCustomMetadata :: !(Maybe [CustomMetadata])
, Chunk -> ChunkData
chunkData :: !(ChunkData)
, Chunk -> Maybe DateTime
chunkUpdateTime :: !(Maybe DateTime)
, Chunk -> Maybe E'State4
chunkState :: !(Maybe E'State4)
, Chunk -> Maybe Text
chunkName :: !(Maybe Text)
}
deriving (Int -> Chunk -> ShowS
[Chunk] -> ShowS
Chunk -> [Char]
(Int -> Chunk -> ShowS)
-> (Chunk -> [Char]) -> ([Chunk] -> ShowS) -> Show Chunk
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Chunk -> ShowS
showsPrec :: Int -> Chunk -> ShowS
$cshow :: Chunk -> [Char]
show :: Chunk -> [Char]
$cshowList :: [Chunk] -> ShowS
showList :: [Chunk] -> ShowS
P.Show, Chunk -> Chunk -> Bool
(Chunk -> Chunk -> Bool) -> (Chunk -> Chunk -> Bool) -> Eq Chunk
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Chunk -> Chunk -> Bool
== :: Chunk -> Chunk -> Bool
$c/= :: Chunk -> Chunk -> Bool
/= :: Chunk -> Chunk -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Chunk where
parseJSON :: Value -> Parser Chunk
parseJSON = [Char] -> (Object -> Parser Chunk) -> Value -> Parser Chunk
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Chunk" ((Object -> Parser Chunk) -> Value -> Parser Chunk)
-> (Object -> Parser Chunk) -> Value -> Parser Chunk
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe DateTime
-> Maybe [CustomMetadata]
-> ChunkData
-> Maybe DateTime
-> Maybe E'State4
-> Maybe Text
-> Chunk
Chunk
(Maybe DateTime
-> Maybe [CustomMetadata]
-> ChunkData
-> Maybe DateTime
-> Maybe E'State4
-> Maybe Text
-> Chunk)
-> Parser (Maybe DateTime)
-> Parser
(Maybe [CustomMetadata]
-> ChunkData
-> Maybe DateTime
-> Maybe E'State4
-> Maybe Text
-> Chunk)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"createTime")
Parser
(Maybe [CustomMetadata]
-> ChunkData
-> Maybe DateTime
-> Maybe E'State4
-> Maybe Text
-> Chunk)
-> Parser (Maybe [CustomMetadata])
-> Parser
(ChunkData
-> Maybe DateTime -> Maybe E'State4 -> Maybe Text -> Chunk)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [CustomMetadata])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"customMetadata")
Parser
(ChunkData
-> Maybe DateTime -> Maybe E'State4 -> Maybe Text -> Chunk)
-> Parser ChunkData
-> Parser (Maybe DateTime -> Maybe E'State4 -> Maybe Text -> Chunk)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser ChunkData
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"data")
Parser (Maybe DateTime -> Maybe E'State4 -> Maybe Text -> Chunk)
-> Parser (Maybe DateTime)
-> Parser (Maybe E'State4 -> Maybe Text -> Chunk)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"updateTime")
Parser (Maybe E'State4 -> Maybe Text -> Chunk)
-> Parser (Maybe E'State4) -> Parser (Maybe Text -> Chunk)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'State4)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"state")
Parser (Maybe Text -> Chunk) -> Parser (Maybe Text) -> Parser Chunk
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
instance A.ToJSON Chunk where
toJSON :: Chunk -> Value
toJSON Chunk {Maybe [CustomMetadata]
Maybe Text
Maybe DateTime
Maybe E'State4
ChunkData
chunkCreateTime :: Chunk -> Maybe DateTime
chunkCustomMetadata :: Chunk -> Maybe [CustomMetadata]
chunkData :: Chunk -> ChunkData
chunkUpdateTime :: Chunk -> Maybe DateTime
chunkState :: Chunk -> Maybe E'State4
chunkName :: Chunk -> Maybe Text
chunkCreateTime :: Maybe DateTime
chunkCustomMetadata :: Maybe [CustomMetadata]
chunkData :: ChunkData
chunkUpdateTime :: Maybe DateTime
chunkState :: Maybe E'State4
chunkName :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"createTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
chunkCreateTime
, Key
"customMetadata" Key -> Maybe [CustomMetadata] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [CustomMetadata]
chunkCustomMetadata
, Key
"data" Key -> ChunkData -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ChunkData
chunkData
, Key
"updateTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
chunkUpdateTime
, Key
"state" Key -> Maybe E'State4 -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'State4
chunkState
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
chunkName
]
mkChunk ::
ChunkData ->
Chunk
mkChunk :: ChunkData -> Chunk
mkChunk ChunkData
chunkData =
Chunk
{ chunkCreateTime :: Maybe DateTime
chunkCreateTime = Maybe DateTime
forall a. Maybe a
Nothing
, chunkCustomMetadata :: Maybe [CustomMetadata]
chunkCustomMetadata = Maybe [CustomMetadata]
forall a. Maybe a
Nothing
, ChunkData
chunkData :: ChunkData
chunkData :: ChunkData
chunkData
, chunkUpdateTime :: Maybe DateTime
chunkUpdateTime = Maybe DateTime
forall a. Maybe a
Nothing
, chunkState :: Maybe E'State4
chunkState = Maybe E'State4
forall a. Maybe a
Nothing
, chunkName :: Maybe Text
chunkName = Maybe Text
forall a. Maybe a
Nothing
}
data ChunkData = ChunkData
{ ChunkData -> Maybe Text
chunkDataStringValue :: !(Maybe Text)
}
deriving (Int -> ChunkData -> ShowS
[ChunkData] -> ShowS
ChunkData -> [Char]
(Int -> ChunkData -> ShowS)
-> (ChunkData -> [Char])
-> ([ChunkData] -> ShowS)
-> Show ChunkData
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChunkData -> ShowS
showsPrec :: Int -> ChunkData -> ShowS
$cshow :: ChunkData -> [Char]
show :: ChunkData -> [Char]
$cshowList :: [ChunkData] -> ShowS
showList :: [ChunkData] -> ShowS
P.Show, ChunkData -> ChunkData -> Bool
(ChunkData -> ChunkData -> Bool)
-> (ChunkData -> ChunkData -> Bool) -> Eq ChunkData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChunkData -> ChunkData -> Bool
== :: ChunkData -> ChunkData -> Bool
$c/= :: ChunkData -> ChunkData -> Bool
/= :: ChunkData -> ChunkData -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ChunkData where
parseJSON :: Value -> Parser ChunkData
parseJSON = [Char] -> (Object -> Parser ChunkData) -> Value -> Parser ChunkData
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ChunkData" ((Object -> Parser ChunkData) -> Value -> Parser ChunkData)
-> (Object -> Parser ChunkData) -> Value -> Parser ChunkData
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> ChunkData
ChunkData
(Maybe Text -> ChunkData)
-> Parser (Maybe Text) -> Parser ChunkData
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"stringValue")
instance A.ToJSON ChunkData where
toJSON :: ChunkData -> Value
toJSON ChunkData {Maybe Text
chunkDataStringValue :: ChunkData -> Maybe Text
chunkDataStringValue :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"stringValue" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
chunkDataStringValue
]
mkChunkData ::
ChunkData
mkChunkData :: ChunkData
mkChunkData =
ChunkData
{ chunkDataStringValue :: Maybe Text
chunkDataStringValue = Maybe Text
forall a. Maybe a
Nothing
}
data CitationMetadata = CitationMetadata
{ CitationMetadata -> Maybe [CitationSource]
citationMetadataCitationSources :: !(Maybe [CitationSource])
}
deriving (Int -> CitationMetadata -> ShowS
[CitationMetadata] -> ShowS
CitationMetadata -> [Char]
(Int -> CitationMetadata -> ShowS)
-> (CitationMetadata -> [Char])
-> ([CitationMetadata] -> ShowS)
-> Show CitationMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CitationMetadata -> ShowS
showsPrec :: Int -> CitationMetadata -> ShowS
$cshow :: CitationMetadata -> [Char]
show :: CitationMetadata -> [Char]
$cshowList :: [CitationMetadata] -> ShowS
showList :: [CitationMetadata] -> ShowS
P.Show, CitationMetadata -> CitationMetadata -> Bool
(CitationMetadata -> CitationMetadata -> Bool)
-> (CitationMetadata -> CitationMetadata -> Bool)
-> Eq CitationMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CitationMetadata -> CitationMetadata -> Bool
== :: CitationMetadata -> CitationMetadata -> Bool
$c/= :: CitationMetadata -> CitationMetadata -> Bool
/= :: CitationMetadata -> CitationMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CitationMetadata where
parseJSON :: Value -> Parser CitationMetadata
parseJSON = [Char]
-> (Object -> Parser CitationMetadata)
-> Value
-> Parser CitationMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CitationMetadata" ((Object -> Parser CitationMetadata)
-> Value -> Parser CitationMetadata)
-> (Object -> Parser CitationMetadata)
-> Value
-> Parser CitationMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [CitationSource] -> CitationMetadata
CitationMetadata
(Maybe [CitationSource] -> CitationMetadata)
-> Parser (Maybe [CitationSource]) -> Parser CitationMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [CitationSource])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"citationSources")
instance A.ToJSON CitationMetadata where
toJSON :: CitationMetadata -> Value
toJSON CitationMetadata {Maybe [CitationSource]
citationMetadataCitationSources :: CitationMetadata -> Maybe [CitationSource]
citationMetadataCitationSources :: Maybe [CitationSource]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"citationSources" Key -> Maybe [CitationSource] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [CitationSource]
citationMetadataCitationSources
]
mkCitationMetadata ::
CitationMetadata
mkCitationMetadata :: CitationMetadata
mkCitationMetadata =
CitationMetadata
{ citationMetadataCitationSources :: Maybe [CitationSource]
citationMetadataCitationSources = Maybe [CitationSource]
forall a. Maybe a
Nothing
}
data CitationSource = CitationSource
{ CitationSource -> Maybe Int
citationSourceStartIndex :: !(Maybe Int)
, CitationSource -> Maybe Text
citationSourceUri :: !(Maybe Text)
, CitationSource -> Maybe Int
citationSourceEndIndex :: !(Maybe Int)
, CitationSource -> Maybe Text
citationSourceLicense :: !(Maybe Text)
}
deriving (Int -> CitationSource -> ShowS
[CitationSource] -> ShowS
CitationSource -> [Char]
(Int -> CitationSource -> ShowS)
-> (CitationSource -> [Char])
-> ([CitationSource] -> ShowS)
-> Show CitationSource
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CitationSource -> ShowS
showsPrec :: Int -> CitationSource -> ShowS
$cshow :: CitationSource -> [Char]
show :: CitationSource -> [Char]
$cshowList :: [CitationSource] -> ShowS
showList :: [CitationSource] -> ShowS
P.Show, CitationSource -> CitationSource -> Bool
(CitationSource -> CitationSource -> Bool)
-> (CitationSource -> CitationSource -> Bool) -> Eq CitationSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CitationSource -> CitationSource -> Bool
== :: CitationSource -> CitationSource -> Bool
$c/= :: CitationSource -> CitationSource -> Bool
/= :: CitationSource -> CitationSource -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CitationSource where
parseJSON :: Value -> Parser CitationSource
parseJSON = [Char]
-> (Object -> Parser CitationSource)
-> Value
-> Parser CitationSource
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CitationSource" ((Object -> Parser CitationSource)
-> Value -> Parser CitationSource)
-> (Object -> Parser CitationSource)
-> Value
-> Parser CitationSource
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int
-> Maybe Text -> Maybe Int -> Maybe Text -> CitationSource
CitationSource
(Maybe Int
-> Maybe Text -> Maybe Int -> Maybe Text -> CitationSource)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Int -> Maybe Text -> CitationSource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"startIndex")
Parser (Maybe Text -> Maybe Int -> Maybe Text -> CitationSource)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> CitationSource)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"uri")
Parser (Maybe Int -> Maybe Text -> CitationSource)
-> Parser (Maybe Int) -> Parser (Maybe Text -> CitationSource)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"endIndex")
Parser (Maybe Text -> CitationSource)
-> Parser (Maybe Text) -> Parser CitationSource
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"license")
instance A.ToJSON CitationSource where
toJSON :: CitationSource -> Value
toJSON CitationSource {Maybe Int
Maybe Text
citationSourceStartIndex :: CitationSource -> Maybe Int
citationSourceUri :: CitationSource -> Maybe Text
citationSourceEndIndex :: CitationSource -> Maybe Int
citationSourceLicense :: CitationSource -> Maybe Text
citationSourceStartIndex :: Maybe Int
citationSourceUri :: Maybe Text
citationSourceEndIndex :: Maybe Int
citationSourceLicense :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"startIndex" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
citationSourceStartIndex
, Key
"uri" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
citationSourceUri
, Key
"endIndex" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
citationSourceEndIndex
, Key
"license" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
citationSourceLicense
]
mkCitationSource ::
CitationSource
mkCitationSource :: CitationSource
mkCitationSource =
CitationSource
{ citationSourceStartIndex :: Maybe Int
citationSourceStartIndex = Maybe Int
forall a. Maybe a
Nothing
, citationSourceUri :: Maybe Text
citationSourceUri = Maybe Text
forall a. Maybe a
Nothing
, citationSourceEndIndex :: Maybe Int
citationSourceEndIndex = Maybe Int
forall a. Maybe a
Nothing
, citationSourceLicense :: Maybe Text
citationSourceLicense = Maybe Text
forall a. Maybe a
Nothing
}
data CodeExecutionResult = CodeExecutionResult
{ CodeExecutionResult -> E'Outcome
codeExecutionResultOutcome :: !(E'Outcome)
, CodeExecutionResult -> Maybe Text
codeExecutionResultOutput :: !(Maybe Text)
}
deriving (Int -> CodeExecutionResult -> ShowS
[CodeExecutionResult] -> ShowS
CodeExecutionResult -> [Char]
(Int -> CodeExecutionResult -> ShowS)
-> (CodeExecutionResult -> [Char])
-> ([CodeExecutionResult] -> ShowS)
-> Show CodeExecutionResult
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeExecutionResult -> ShowS
showsPrec :: Int -> CodeExecutionResult -> ShowS
$cshow :: CodeExecutionResult -> [Char]
show :: CodeExecutionResult -> [Char]
$cshowList :: [CodeExecutionResult] -> ShowS
showList :: [CodeExecutionResult] -> ShowS
P.Show, CodeExecutionResult -> CodeExecutionResult -> Bool
(CodeExecutionResult -> CodeExecutionResult -> Bool)
-> (CodeExecutionResult -> CodeExecutionResult -> Bool)
-> Eq CodeExecutionResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeExecutionResult -> CodeExecutionResult -> Bool
== :: CodeExecutionResult -> CodeExecutionResult -> Bool
$c/= :: CodeExecutionResult -> CodeExecutionResult -> Bool
/= :: CodeExecutionResult -> CodeExecutionResult -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CodeExecutionResult where
parseJSON :: Value -> Parser CodeExecutionResult
parseJSON = [Char]
-> (Object -> Parser CodeExecutionResult)
-> Value
-> Parser CodeExecutionResult
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CodeExecutionResult" ((Object -> Parser CodeExecutionResult)
-> Value -> Parser CodeExecutionResult)
-> (Object -> Parser CodeExecutionResult)
-> Value
-> Parser CodeExecutionResult
forall a b. (a -> b) -> a -> b
$ \Object
o ->
E'Outcome -> Maybe Text -> CodeExecutionResult
CodeExecutionResult
(E'Outcome -> Maybe Text -> CodeExecutionResult)
-> Parser E'Outcome -> Parser (Maybe Text -> CodeExecutionResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser E'Outcome
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"outcome")
Parser (Maybe Text -> CodeExecutionResult)
-> Parser (Maybe Text) -> Parser CodeExecutionResult
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"output")
instance A.ToJSON CodeExecutionResult where
toJSON :: CodeExecutionResult -> Value
toJSON CodeExecutionResult {Maybe Text
E'Outcome
codeExecutionResultOutcome :: CodeExecutionResult -> E'Outcome
codeExecutionResultOutput :: CodeExecutionResult -> Maybe Text
codeExecutionResultOutcome :: E'Outcome
codeExecutionResultOutput :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"outcome" Key -> E'Outcome -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= E'Outcome
codeExecutionResultOutcome
, Key
"output" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
codeExecutionResultOutput
]
mkCodeExecutionResult ::
E'Outcome ->
CodeExecutionResult
mkCodeExecutionResult :: E'Outcome -> CodeExecutionResult
mkCodeExecutionResult E'Outcome
codeExecutionResultOutcome =
CodeExecutionResult
{ E'Outcome
codeExecutionResultOutcome :: E'Outcome
codeExecutionResultOutcome :: E'Outcome
codeExecutionResultOutcome
, codeExecutionResultOutput :: Maybe Text
codeExecutionResultOutput = Maybe Text
forall a. Maybe a
Nothing
}
data Condition = Condition
{ Condition -> Maybe Float
conditionNumericValue :: !(Maybe Float)
, Condition -> E'Operation
conditionOperation :: !(E'Operation)
, Condition -> Maybe Text
conditionStringValue :: !(Maybe Text)
}
deriving (Int -> Condition -> ShowS
[Condition] -> ShowS
Condition -> [Char]
(Int -> Condition -> ShowS)
-> (Condition -> [Char])
-> ([Condition] -> ShowS)
-> Show Condition
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Condition -> ShowS
showsPrec :: Int -> Condition -> ShowS
$cshow :: Condition -> [Char]
show :: Condition -> [Char]
$cshowList :: [Condition] -> ShowS
showList :: [Condition] -> ShowS
P.Show, Condition -> Condition -> Bool
(Condition -> Condition -> Bool)
-> (Condition -> Condition -> Bool) -> Eq Condition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Condition -> Condition -> Bool
== :: Condition -> Condition -> Bool
$c/= :: Condition -> Condition -> Bool
/= :: Condition -> Condition -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Condition where
parseJSON :: Value -> Parser Condition
parseJSON = [Char] -> (Object -> Parser Condition) -> Value -> Parser Condition
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Condition" ((Object -> Parser Condition) -> Value -> Parser Condition)
-> (Object -> Parser Condition) -> Value -> Parser Condition
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Float -> E'Operation -> Maybe Text -> Condition
Condition
(Maybe Float -> E'Operation -> Maybe Text -> Condition)
-> Parser (Maybe Float)
-> Parser (E'Operation -> Maybe Text -> Condition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"numericValue")
Parser (E'Operation -> Maybe Text -> Condition)
-> Parser E'Operation -> Parser (Maybe Text -> Condition)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser E'Operation
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"operation")
Parser (Maybe Text -> Condition)
-> Parser (Maybe Text) -> Parser Condition
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"stringValue")
instance A.ToJSON Condition where
toJSON :: Condition -> Value
toJSON Condition {Maybe Float
Maybe Text
E'Operation
conditionNumericValue :: Condition -> Maybe Float
conditionOperation :: Condition -> E'Operation
conditionStringValue :: Condition -> Maybe Text
conditionNumericValue :: Maybe Float
conditionOperation :: E'Operation
conditionStringValue :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"numericValue" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
conditionNumericValue
, Key
"operation" Key -> E'Operation -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= E'Operation
conditionOperation
, Key
"stringValue" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
conditionStringValue
]
mkCondition ::
E'Operation ->
Condition
mkCondition :: E'Operation -> Condition
mkCondition E'Operation
conditionOperation =
Condition
{ conditionNumericValue :: Maybe Float
conditionNumericValue = Maybe Float
forall a. Maybe a
Nothing
, E'Operation
conditionOperation :: E'Operation
conditionOperation :: E'Operation
conditionOperation
, conditionStringValue :: Maybe Text
conditionStringValue = Maybe Text
forall a. Maybe a
Nothing
}
data Content = Content
{ Content -> Maybe [Part]
contentParts :: !(Maybe [Part])
, Content -> Maybe Text
contentRole :: !(Maybe Text)
}
deriving (Int -> Content -> ShowS
[Content] -> ShowS
Content -> [Char]
(Int -> Content -> ShowS)
-> (Content -> [Char]) -> ([Content] -> ShowS) -> Show Content
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Content -> ShowS
showsPrec :: Int -> Content -> ShowS
$cshow :: Content -> [Char]
show :: Content -> [Char]
$cshowList :: [Content] -> ShowS
showList :: [Content] -> ShowS
P.Show, Content -> Content -> Bool
(Content -> Content -> Bool)
-> (Content -> Content -> Bool) -> Eq Content
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Content -> Content -> Bool
== :: Content -> Content -> Bool
$c/= :: Content -> Content -> Bool
/= :: Content -> Content -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Content where
parseJSON :: Value -> Parser Content
parseJSON = [Char] -> (Object -> Parser Content) -> Value -> Parser Content
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Content" ((Object -> Parser Content) -> Value -> Parser Content)
-> (Object -> Parser Content) -> Value -> Parser Content
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Part] -> Maybe Text -> Content
Content
(Maybe [Part] -> Maybe Text -> Content)
-> Parser (Maybe [Part]) -> Parser (Maybe Text -> Content)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Part])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"parts")
Parser (Maybe Text -> Content)
-> Parser (Maybe Text) -> Parser Content
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"role")
instance A.ToJSON Content where
toJSON :: Content -> Value
toJSON Content {Maybe [Part]
Maybe Text
contentParts :: Content -> Maybe [Part]
contentRole :: Content -> Maybe Text
contentParts :: Maybe [Part]
contentRole :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"parts" Key -> Maybe [Part] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Part]
contentParts
, Key
"role" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
contentRole
]
mkContent ::
Content
mkContent :: Content
mkContent =
Content
{ contentParts :: Maybe [Part]
contentParts = Maybe [Part]
forall a. Maybe a
Nothing
, contentRole :: Maybe Text
contentRole = Maybe Text
forall a. Maybe a
Nothing
}
data ContentEmbedding = ContentEmbedding
{ ContentEmbedding -> Maybe [Float]
contentEmbeddingValues :: !(Maybe [Float])
}
deriving (Int -> ContentEmbedding -> ShowS
[ContentEmbedding] -> ShowS
ContentEmbedding -> [Char]
(Int -> ContentEmbedding -> ShowS)
-> (ContentEmbedding -> [Char])
-> ([ContentEmbedding] -> ShowS)
-> Show ContentEmbedding
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ContentEmbedding -> ShowS
showsPrec :: Int -> ContentEmbedding -> ShowS
$cshow :: ContentEmbedding -> [Char]
show :: ContentEmbedding -> [Char]
$cshowList :: [ContentEmbedding] -> ShowS
showList :: [ContentEmbedding] -> ShowS
P.Show, ContentEmbedding -> ContentEmbedding -> Bool
(ContentEmbedding -> ContentEmbedding -> Bool)
-> (ContentEmbedding -> ContentEmbedding -> Bool)
-> Eq ContentEmbedding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContentEmbedding -> ContentEmbedding -> Bool
== :: ContentEmbedding -> ContentEmbedding -> Bool
$c/= :: ContentEmbedding -> ContentEmbedding -> Bool
/= :: ContentEmbedding -> ContentEmbedding -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ContentEmbedding where
parseJSON :: Value -> Parser ContentEmbedding
parseJSON = [Char]
-> (Object -> Parser ContentEmbedding)
-> Value
-> Parser ContentEmbedding
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ContentEmbedding" ((Object -> Parser ContentEmbedding)
-> Value -> Parser ContentEmbedding)
-> (Object -> Parser ContentEmbedding)
-> Value
-> Parser ContentEmbedding
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Float] -> ContentEmbedding
ContentEmbedding
(Maybe [Float] -> ContentEmbedding)
-> Parser (Maybe [Float]) -> Parser ContentEmbedding
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Float])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"values")
instance A.ToJSON ContentEmbedding where
toJSON :: ContentEmbedding -> Value
toJSON ContentEmbedding {Maybe [Float]
contentEmbeddingValues :: ContentEmbedding -> Maybe [Float]
contentEmbeddingValues :: Maybe [Float]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"values" Key -> Maybe [Float] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Float]
contentEmbeddingValues
]
mkContentEmbedding ::
ContentEmbedding
mkContentEmbedding :: ContentEmbedding
mkContentEmbedding =
ContentEmbedding
{ contentEmbeddingValues :: Maybe [Float]
contentEmbeddingValues = Maybe [Float]
forall a. Maybe a
Nothing
}
data ContentFilter = ContentFilter
{ ContentFilter -> Maybe E'Reason
contentFilterReason :: !(Maybe E'Reason)
, ContentFilter -> Maybe Text
contentFilterMessage :: !(Maybe Text)
}
deriving (Int -> ContentFilter -> ShowS
[ContentFilter] -> ShowS
ContentFilter -> [Char]
(Int -> ContentFilter -> ShowS)
-> (ContentFilter -> [Char])
-> ([ContentFilter] -> ShowS)
-> Show ContentFilter
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ContentFilter -> ShowS
showsPrec :: Int -> ContentFilter -> ShowS
$cshow :: ContentFilter -> [Char]
show :: ContentFilter -> [Char]
$cshowList :: [ContentFilter] -> ShowS
showList :: [ContentFilter] -> ShowS
P.Show, ContentFilter -> ContentFilter -> Bool
(ContentFilter -> ContentFilter -> Bool)
-> (ContentFilter -> ContentFilter -> Bool) -> Eq ContentFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContentFilter -> ContentFilter -> Bool
== :: ContentFilter -> ContentFilter -> Bool
$c/= :: ContentFilter -> ContentFilter -> Bool
/= :: ContentFilter -> ContentFilter -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ContentFilter where
parseJSON :: Value -> Parser ContentFilter
parseJSON = [Char]
-> (Object -> Parser ContentFilter)
-> Value
-> Parser ContentFilter
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ContentFilter" ((Object -> Parser ContentFilter) -> Value -> Parser ContentFilter)
-> (Object -> Parser ContentFilter)
-> Value
-> Parser ContentFilter
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe E'Reason -> Maybe Text -> ContentFilter
ContentFilter
(Maybe E'Reason -> Maybe Text -> ContentFilter)
-> Parser (Maybe E'Reason) -> Parser (Maybe Text -> ContentFilter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe E'Reason)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"reason")
Parser (Maybe Text -> ContentFilter)
-> Parser (Maybe Text) -> Parser ContentFilter
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"message")
instance A.ToJSON ContentFilter where
toJSON :: ContentFilter -> Value
toJSON ContentFilter {Maybe Text
Maybe E'Reason
contentFilterReason :: ContentFilter -> Maybe E'Reason
contentFilterMessage :: ContentFilter -> Maybe Text
contentFilterReason :: Maybe E'Reason
contentFilterMessage :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"reason" Key -> Maybe E'Reason -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'Reason
contentFilterReason
, Key
"message" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
contentFilterMessage
]
mkContentFilter ::
ContentFilter
mkContentFilter :: ContentFilter
mkContentFilter =
ContentFilter
{ contentFilterReason :: Maybe E'Reason
contentFilterReason = Maybe E'Reason
forall a. Maybe a
Nothing
, contentFilterMessage :: Maybe Text
contentFilterMessage = Maybe Text
forall a. Maybe a
Nothing
}
data Corpus = Corpus
{ Corpus -> Maybe DateTime
corpusUpdateTime :: !(Maybe DateTime)
, Corpus -> Maybe DateTime
corpusCreateTime :: !(Maybe DateTime)
, Corpus -> Maybe Text
corpusDisplayName :: !(Maybe Text)
, Corpus -> Maybe Text
corpusName :: !(Maybe Text)
}
deriving (Int -> Corpus -> ShowS
[Corpus] -> ShowS
Corpus -> [Char]
(Int -> Corpus -> ShowS)
-> (Corpus -> [Char]) -> ([Corpus] -> ShowS) -> Show Corpus
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Corpus -> ShowS
showsPrec :: Int -> Corpus -> ShowS
$cshow :: Corpus -> [Char]
show :: Corpus -> [Char]
$cshowList :: [Corpus] -> ShowS
showList :: [Corpus] -> ShowS
P.Show, Corpus -> Corpus -> Bool
(Corpus -> Corpus -> Bool)
-> (Corpus -> Corpus -> Bool) -> Eq Corpus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Corpus -> Corpus -> Bool
== :: Corpus -> Corpus -> Bool
$c/= :: Corpus -> Corpus -> Bool
/= :: Corpus -> Corpus -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Corpus where
parseJSON :: Value -> Parser Corpus
parseJSON = [Char] -> (Object -> Parser Corpus) -> Value -> Parser Corpus
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Corpus" ((Object -> Parser Corpus) -> Value -> Parser Corpus)
-> (Object -> Parser Corpus) -> Value -> Parser Corpus
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe DateTime
-> Maybe DateTime -> Maybe Text -> Maybe Text -> Corpus
Corpus
(Maybe DateTime
-> Maybe DateTime -> Maybe Text -> Maybe Text -> Corpus)
-> Parser (Maybe DateTime)
-> Parser (Maybe DateTime -> Maybe Text -> Maybe Text -> Corpus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"updateTime")
Parser (Maybe DateTime -> Maybe Text -> Maybe Text -> Corpus)
-> Parser (Maybe DateTime)
-> Parser (Maybe Text -> Maybe Text -> Corpus)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"createTime")
Parser (Maybe Text -> Maybe Text -> Corpus)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Corpus)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"displayName")
Parser (Maybe Text -> Corpus)
-> Parser (Maybe Text) -> Parser Corpus
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
instance A.ToJSON Corpus where
toJSON :: Corpus -> Value
toJSON Corpus {Maybe Text
Maybe DateTime
corpusUpdateTime :: Corpus -> Maybe DateTime
corpusCreateTime :: Corpus -> Maybe DateTime
corpusDisplayName :: Corpus -> Maybe Text
corpusName :: Corpus -> Maybe Text
corpusUpdateTime :: Maybe DateTime
corpusCreateTime :: Maybe DateTime
corpusDisplayName :: Maybe Text
corpusName :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"updateTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
corpusUpdateTime
, Key
"createTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
corpusCreateTime
, Key
"displayName" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
corpusDisplayName
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
corpusName
]
mkCorpus ::
Corpus
mkCorpus :: Corpus
mkCorpus =
Corpus
{ corpusUpdateTime :: Maybe DateTime
corpusUpdateTime = Maybe DateTime
forall a. Maybe a
Nothing
, corpusCreateTime :: Maybe DateTime
corpusCreateTime = Maybe DateTime
forall a. Maybe a
Nothing
, corpusDisplayName :: Maybe Text
corpusDisplayName = Maybe Text
forall a. Maybe a
Nothing
, corpusName :: Maybe Text
corpusName = Maybe Text
forall a. Maybe a
Nothing
}
data CountMessageTokensRequest = CountMessageTokensRequest
{ CountMessageTokensRequest -> MessagePrompt
countMessageTokensRequestPrompt :: !(MessagePrompt)
}
deriving (Int -> CountMessageTokensRequest -> ShowS
[CountMessageTokensRequest] -> ShowS
CountMessageTokensRequest -> [Char]
(Int -> CountMessageTokensRequest -> ShowS)
-> (CountMessageTokensRequest -> [Char])
-> ([CountMessageTokensRequest] -> ShowS)
-> Show CountMessageTokensRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CountMessageTokensRequest -> ShowS
showsPrec :: Int -> CountMessageTokensRequest -> ShowS
$cshow :: CountMessageTokensRequest -> [Char]
show :: CountMessageTokensRequest -> [Char]
$cshowList :: [CountMessageTokensRequest] -> ShowS
showList :: [CountMessageTokensRequest] -> ShowS
P.Show, CountMessageTokensRequest -> CountMessageTokensRequest -> Bool
(CountMessageTokensRequest -> CountMessageTokensRequest -> Bool)
-> (CountMessageTokensRequest -> CountMessageTokensRequest -> Bool)
-> Eq CountMessageTokensRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CountMessageTokensRequest -> CountMessageTokensRequest -> Bool
== :: CountMessageTokensRequest -> CountMessageTokensRequest -> Bool
$c/= :: CountMessageTokensRequest -> CountMessageTokensRequest -> Bool
/= :: CountMessageTokensRequest -> CountMessageTokensRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CountMessageTokensRequest where
parseJSON :: Value -> Parser CountMessageTokensRequest
parseJSON = [Char]
-> (Object -> Parser CountMessageTokensRequest)
-> Value
-> Parser CountMessageTokensRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CountMessageTokensRequest" ((Object -> Parser CountMessageTokensRequest)
-> Value -> Parser CountMessageTokensRequest)
-> (Object -> Parser CountMessageTokensRequest)
-> Value
-> Parser CountMessageTokensRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
MessagePrompt -> CountMessageTokensRequest
CountMessageTokensRequest
(MessagePrompt -> CountMessageTokensRequest)
-> Parser MessagePrompt -> Parser CountMessageTokensRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser MessagePrompt
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"prompt")
instance A.ToJSON CountMessageTokensRequest where
toJSON :: CountMessageTokensRequest -> Value
toJSON CountMessageTokensRequest {MessagePrompt
countMessageTokensRequestPrompt :: CountMessageTokensRequest -> MessagePrompt
countMessageTokensRequestPrompt :: MessagePrompt
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"prompt" Key -> MessagePrompt -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= MessagePrompt
countMessageTokensRequestPrompt
]
mkCountMessageTokensRequest ::
MessagePrompt ->
CountMessageTokensRequest
mkCountMessageTokensRequest :: MessagePrompt -> CountMessageTokensRequest
mkCountMessageTokensRequest MessagePrompt
countMessageTokensRequestPrompt =
CountMessageTokensRequest
{ MessagePrompt
countMessageTokensRequestPrompt :: MessagePrompt
countMessageTokensRequestPrompt :: MessagePrompt
countMessageTokensRequestPrompt
}
data CountMessageTokensResponse = CountMessageTokensResponse
{ CountMessageTokensResponse -> Maybe Int
countMessageTokensResponseTokenCount :: !(Maybe Int)
}
deriving (Int -> CountMessageTokensResponse -> ShowS
[CountMessageTokensResponse] -> ShowS
CountMessageTokensResponse -> [Char]
(Int -> CountMessageTokensResponse -> ShowS)
-> (CountMessageTokensResponse -> [Char])
-> ([CountMessageTokensResponse] -> ShowS)
-> Show CountMessageTokensResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CountMessageTokensResponse -> ShowS
showsPrec :: Int -> CountMessageTokensResponse -> ShowS
$cshow :: CountMessageTokensResponse -> [Char]
show :: CountMessageTokensResponse -> [Char]
$cshowList :: [CountMessageTokensResponse] -> ShowS
showList :: [CountMessageTokensResponse] -> ShowS
P.Show, CountMessageTokensResponse -> CountMessageTokensResponse -> Bool
(CountMessageTokensResponse -> CountMessageTokensResponse -> Bool)
-> (CountMessageTokensResponse
-> CountMessageTokensResponse -> Bool)
-> Eq CountMessageTokensResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CountMessageTokensResponse -> CountMessageTokensResponse -> Bool
== :: CountMessageTokensResponse -> CountMessageTokensResponse -> Bool
$c/= :: CountMessageTokensResponse -> CountMessageTokensResponse -> Bool
/= :: CountMessageTokensResponse -> CountMessageTokensResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CountMessageTokensResponse where
parseJSON :: Value -> Parser CountMessageTokensResponse
parseJSON = [Char]
-> (Object -> Parser CountMessageTokensResponse)
-> Value
-> Parser CountMessageTokensResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CountMessageTokensResponse" ((Object -> Parser CountMessageTokensResponse)
-> Value -> Parser CountMessageTokensResponse)
-> (Object -> Parser CountMessageTokensResponse)
-> Value
-> Parser CountMessageTokensResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int -> CountMessageTokensResponse
CountMessageTokensResponse
(Maybe Int -> CountMessageTokensResponse)
-> Parser (Maybe Int) -> Parser CountMessageTokensResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tokenCount")
instance A.ToJSON CountMessageTokensResponse where
toJSON :: CountMessageTokensResponse -> Value
toJSON CountMessageTokensResponse {Maybe Int
countMessageTokensResponseTokenCount :: CountMessageTokensResponse -> Maybe Int
countMessageTokensResponseTokenCount :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"tokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
countMessageTokensResponseTokenCount
]
mkCountMessageTokensResponse ::
CountMessageTokensResponse
mkCountMessageTokensResponse :: CountMessageTokensResponse
mkCountMessageTokensResponse =
CountMessageTokensResponse
{ countMessageTokensResponseTokenCount :: Maybe Int
countMessageTokensResponseTokenCount = Maybe Int
forall a. Maybe a
Nothing
}
data CountTextTokensRequest = CountTextTokensRequest
{ CountTextTokensRequest -> TextPrompt
countTextTokensRequestPrompt :: !(TextPrompt)
}
deriving (Int -> CountTextTokensRequest -> ShowS
[CountTextTokensRequest] -> ShowS
CountTextTokensRequest -> [Char]
(Int -> CountTextTokensRequest -> ShowS)
-> (CountTextTokensRequest -> [Char])
-> ([CountTextTokensRequest] -> ShowS)
-> Show CountTextTokensRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CountTextTokensRequest -> ShowS
showsPrec :: Int -> CountTextTokensRequest -> ShowS
$cshow :: CountTextTokensRequest -> [Char]
show :: CountTextTokensRequest -> [Char]
$cshowList :: [CountTextTokensRequest] -> ShowS
showList :: [CountTextTokensRequest] -> ShowS
P.Show, CountTextTokensRequest -> CountTextTokensRequest -> Bool
(CountTextTokensRequest -> CountTextTokensRequest -> Bool)
-> (CountTextTokensRequest -> CountTextTokensRequest -> Bool)
-> Eq CountTextTokensRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CountTextTokensRequest -> CountTextTokensRequest -> Bool
== :: CountTextTokensRequest -> CountTextTokensRequest -> Bool
$c/= :: CountTextTokensRequest -> CountTextTokensRequest -> Bool
/= :: CountTextTokensRequest -> CountTextTokensRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CountTextTokensRequest where
parseJSON :: Value -> Parser CountTextTokensRequest
parseJSON = [Char]
-> (Object -> Parser CountTextTokensRequest)
-> Value
-> Parser CountTextTokensRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CountTextTokensRequest" ((Object -> Parser CountTextTokensRequest)
-> Value -> Parser CountTextTokensRequest)
-> (Object -> Parser CountTextTokensRequest)
-> Value
-> Parser CountTextTokensRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
TextPrompt -> CountTextTokensRequest
CountTextTokensRequest
(TextPrompt -> CountTextTokensRequest)
-> Parser TextPrompt -> Parser CountTextTokensRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser TextPrompt
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"prompt")
instance A.ToJSON CountTextTokensRequest where
toJSON :: CountTextTokensRequest -> Value
toJSON CountTextTokensRequest {TextPrompt
countTextTokensRequestPrompt :: CountTextTokensRequest -> TextPrompt
countTextTokensRequestPrompt :: TextPrompt
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"prompt" Key -> TextPrompt -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TextPrompt
countTextTokensRequestPrompt
]
mkCountTextTokensRequest ::
TextPrompt ->
CountTextTokensRequest
mkCountTextTokensRequest :: TextPrompt -> CountTextTokensRequest
mkCountTextTokensRequest TextPrompt
countTextTokensRequestPrompt =
CountTextTokensRequest
{ TextPrompt
countTextTokensRequestPrompt :: TextPrompt
countTextTokensRequestPrompt :: TextPrompt
countTextTokensRequestPrompt
}
data CountTextTokensResponse = CountTextTokensResponse
{ CountTextTokensResponse -> Maybe Int
countTextTokensResponseTokenCount :: !(Maybe Int)
}
deriving (Int -> CountTextTokensResponse -> ShowS
[CountTextTokensResponse] -> ShowS
CountTextTokensResponse -> [Char]
(Int -> CountTextTokensResponse -> ShowS)
-> (CountTextTokensResponse -> [Char])
-> ([CountTextTokensResponse] -> ShowS)
-> Show CountTextTokensResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CountTextTokensResponse -> ShowS
showsPrec :: Int -> CountTextTokensResponse -> ShowS
$cshow :: CountTextTokensResponse -> [Char]
show :: CountTextTokensResponse -> [Char]
$cshowList :: [CountTextTokensResponse] -> ShowS
showList :: [CountTextTokensResponse] -> ShowS
P.Show, CountTextTokensResponse -> CountTextTokensResponse -> Bool
(CountTextTokensResponse -> CountTextTokensResponse -> Bool)
-> (CountTextTokensResponse -> CountTextTokensResponse -> Bool)
-> Eq CountTextTokensResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CountTextTokensResponse -> CountTextTokensResponse -> Bool
== :: CountTextTokensResponse -> CountTextTokensResponse -> Bool
$c/= :: CountTextTokensResponse -> CountTextTokensResponse -> Bool
/= :: CountTextTokensResponse -> CountTextTokensResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CountTextTokensResponse where
parseJSON :: Value -> Parser CountTextTokensResponse
parseJSON = [Char]
-> (Object -> Parser CountTextTokensResponse)
-> Value
-> Parser CountTextTokensResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CountTextTokensResponse" ((Object -> Parser CountTextTokensResponse)
-> Value -> Parser CountTextTokensResponse)
-> (Object -> Parser CountTextTokensResponse)
-> Value
-> Parser CountTextTokensResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int -> CountTextTokensResponse
CountTextTokensResponse
(Maybe Int -> CountTextTokensResponse)
-> Parser (Maybe Int) -> Parser CountTextTokensResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tokenCount")
instance A.ToJSON CountTextTokensResponse where
toJSON :: CountTextTokensResponse -> Value
toJSON CountTextTokensResponse {Maybe Int
countTextTokensResponseTokenCount :: CountTextTokensResponse -> Maybe Int
countTextTokensResponseTokenCount :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"tokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
countTextTokensResponseTokenCount
]
mkCountTextTokensResponse ::
CountTextTokensResponse
mkCountTextTokensResponse :: CountTextTokensResponse
mkCountTextTokensResponse =
CountTextTokensResponse
{ countTextTokensResponseTokenCount :: Maybe Int
countTextTokensResponseTokenCount = Maybe Int
forall a. Maybe a
Nothing
}
data CountTokensRequest = CountTokensRequest
{ CountTokensRequest -> Maybe [Content]
countTokensRequestContents :: !(Maybe [Content])
, CountTokensRequest -> Maybe GenerateContentRequest
countTokensRequestGenerateContentRequest :: !(Maybe GenerateContentRequest)
}
deriving (Int -> CountTokensRequest -> ShowS
[CountTokensRequest] -> ShowS
CountTokensRequest -> [Char]
(Int -> CountTokensRequest -> ShowS)
-> (CountTokensRequest -> [Char])
-> ([CountTokensRequest] -> ShowS)
-> Show CountTokensRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CountTokensRequest -> ShowS
showsPrec :: Int -> CountTokensRequest -> ShowS
$cshow :: CountTokensRequest -> [Char]
show :: CountTokensRequest -> [Char]
$cshowList :: [CountTokensRequest] -> ShowS
showList :: [CountTokensRequest] -> ShowS
P.Show, CountTokensRequest -> CountTokensRequest -> Bool
(CountTokensRequest -> CountTokensRequest -> Bool)
-> (CountTokensRequest -> CountTokensRequest -> Bool)
-> Eq CountTokensRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CountTokensRequest -> CountTokensRequest -> Bool
== :: CountTokensRequest -> CountTokensRequest -> Bool
$c/= :: CountTokensRequest -> CountTokensRequest -> Bool
/= :: CountTokensRequest -> CountTokensRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CountTokensRequest where
parseJSON :: Value -> Parser CountTokensRequest
parseJSON = [Char]
-> (Object -> Parser CountTokensRequest)
-> Value
-> Parser CountTokensRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CountTokensRequest" ((Object -> Parser CountTokensRequest)
-> Value -> Parser CountTokensRequest)
-> (Object -> Parser CountTokensRequest)
-> Value
-> Parser CountTokensRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Content]
-> Maybe GenerateContentRequest -> CountTokensRequest
CountTokensRequest
(Maybe [Content]
-> Maybe GenerateContentRequest -> CountTokensRequest)
-> Parser (Maybe [Content])
-> Parser (Maybe GenerateContentRequest -> CountTokensRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Content])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"contents")
Parser (Maybe GenerateContentRequest -> CountTokensRequest)
-> Parser (Maybe GenerateContentRequest)
-> Parser CountTokensRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe GenerateContentRequest)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"generateContentRequest")
instance A.ToJSON CountTokensRequest where
toJSON :: CountTokensRequest -> Value
toJSON CountTokensRequest {Maybe [Content]
Maybe GenerateContentRequest
countTokensRequestContents :: CountTokensRequest -> Maybe [Content]
countTokensRequestGenerateContentRequest :: CountTokensRequest -> Maybe GenerateContentRequest
countTokensRequestContents :: Maybe [Content]
countTokensRequestGenerateContentRequest :: Maybe GenerateContentRequest
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"contents" Key -> Maybe [Content] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Content]
countTokensRequestContents
, Key
"generateContentRequest" Key -> Maybe GenerateContentRequest -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GenerateContentRequest
countTokensRequestGenerateContentRequest
]
mkCountTokensRequest ::
CountTokensRequest
mkCountTokensRequest :: CountTokensRequest
mkCountTokensRequest =
CountTokensRequest
{ countTokensRequestContents :: Maybe [Content]
countTokensRequestContents = Maybe [Content]
forall a. Maybe a
Nothing
, countTokensRequestGenerateContentRequest :: Maybe GenerateContentRequest
countTokensRequestGenerateContentRequest = Maybe GenerateContentRequest
forall a. Maybe a
Nothing
}
data CountTokensResponse = CountTokensResponse
{ CountTokensResponse -> Maybe [ModalityTokenCount]
countTokensResponseCacheTokensDetails :: !(Maybe [ModalityTokenCount])
, CountTokensResponse -> Maybe [ModalityTokenCount]
countTokensResponsePromptTokensDetails :: !(Maybe [ModalityTokenCount])
, CountTokensResponse -> Maybe Int
countTokensResponseTotalTokens :: !(Maybe Int)
, CountTokensResponse -> Maybe Int
countTokensResponseCachedContentTokenCount :: !(Maybe Int)
}
deriving (Int -> CountTokensResponse -> ShowS
[CountTokensResponse] -> ShowS
CountTokensResponse -> [Char]
(Int -> CountTokensResponse -> ShowS)
-> (CountTokensResponse -> [Char])
-> ([CountTokensResponse] -> ShowS)
-> Show CountTokensResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CountTokensResponse -> ShowS
showsPrec :: Int -> CountTokensResponse -> ShowS
$cshow :: CountTokensResponse -> [Char]
show :: CountTokensResponse -> [Char]
$cshowList :: [CountTokensResponse] -> ShowS
showList :: [CountTokensResponse] -> ShowS
P.Show, CountTokensResponse -> CountTokensResponse -> Bool
(CountTokensResponse -> CountTokensResponse -> Bool)
-> (CountTokensResponse -> CountTokensResponse -> Bool)
-> Eq CountTokensResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CountTokensResponse -> CountTokensResponse -> Bool
== :: CountTokensResponse -> CountTokensResponse -> Bool
$c/= :: CountTokensResponse -> CountTokensResponse -> Bool
/= :: CountTokensResponse -> CountTokensResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CountTokensResponse where
parseJSON :: Value -> Parser CountTokensResponse
parseJSON = [Char]
-> (Object -> Parser CountTokensResponse)
-> Value
-> Parser CountTokensResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CountTokensResponse" ((Object -> Parser CountTokensResponse)
-> Value -> Parser CountTokensResponse)
-> (Object -> Parser CountTokensResponse)
-> Value
-> Parser CountTokensResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe Int
-> CountTokensResponse
CountTokensResponse
(Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe Int
-> CountTokensResponse)
-> Parser (Maybe [ModalityTokenCount])
-> Parser
(Maybe [ModalityTokenCount]
-> Maybe Int -> Maybe Int -> CountTokensResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [ModalityTokenCount])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"cacheTokensDetails")
Parser
(Maybe [ModalityTokenCount]
-> Maybe Int -> Maybe Int -> CountTokensResponse)
-> Parser (Maybe [ModalityTokenCount])
-> Parser (Maybe Int -> Maybe Int -> CountTokensResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [ModalityTokenCount])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"promptTokensDetails")
Parser (Maybe Int -> Maybe Int -> CountTokensResponse)
-> Parser (Maybe Int) -> Parser (Maybe Int -> CountTokensResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"totalTokens")
Parser (Maybe Int -> CountTokensResponse)
-> Parser (Maybe Int) -> Parser CountTokensResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"cachedContentTokenCount")
instance A.ToJSON CountTokensResponse where
toJSON :: CountTokensResponse -> Value
toJSON CountTokensResponse {Maybe Int
Maybe [ModalityTokenCount]
countTokensResponseCacheTokensDetails :: CountTokensResponse -> Maybe [ModalityTokenCount]
countTokensResponsePromptTokensDetails :: CountTokensResponse -> Maybe [ModalityTokenCount]
countTokensResponseTotalTokens :: CountTokensResponse -> Maybe Int
countTokensResponseCachedContentTokenCount :: CountTokensResponse -> Maybe Int
countTokensResponseCacheTokensDetails :: Maybe [ModalityTokenCount]
countTokensResponsePromptTokensDetails :: Maybe [ModalityTokenCount]
countTokensResponseTotalTokens :: Maybe Int
countTokensResponseCachedContentTokenCount :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"cacheTokensDetails" Key -> Maybe [ModalityTokenCount] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ModalityTokenCount]
countTokensResponseCacheTokensDetails
, Key
"promptTokensDetails" Key -> Maybe [ModalityTokenCount] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ModalityTokenCount]
countTokensResponsePromptTokensDetails
, Key
"totalTokens" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
countTokensResponseTotalTokens
, Key
"cachedContentTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
countTokensResponseCachedContentTokenCount
]
mkCountTokensResponse ::
CountTokensResponse
mkCountTokensResponse :: CountTokensResponse
mkCountTokensResponse =
CountTokensResponse
{ countTokensResponseCacheTokensDetails :: Maybe [ModalityTokenCount]
countTokensResponseCacheTokensDetails = Maybe [ModalityTokenCount]
forall a. Maybe a
Nothing
, countTokensResponsePromptTokensDetails :: Maybe [ModalityTokenCount]
countTokensResponsePromptTokensDetails = Maybe [ModalityTokenCount]
forall a. Maybe a
Nothing
, countTokensResponseTotalTokens :: Maybe Int
countTokensResponseTotalTokens = Maybe Int
forall a. Maybe a
Nothing
, countTokensResponseCachedContentTokenCount :: Maybe Int
countTokensResponseCachedContentTokenCount = Maybe Int
forall a. Maybe a
Nothing
}
data CreateChunkRequest = CreateChunkRequest
{ CreateChunkRequest -> Text
createChunkRequestParent :: !(Text)
, CreateChunkRequest -> Chunk
createChunkRequestChunk :: !(Chunk)
}
deriving (Int -> CreateChunkRequest -> ShowS
[CreateChunkRequest] -> ShowS
CreateChunkRequest -> [Char]
(Int -> CreateChunkRequest -> ShowS)
-> (CreateChunkRequest -> [Char])
-> ([CreateChunkRequest] -> ShowS)
-> Show CreateChunkRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateChunkRequest -> ShowS
showsPrec :: Int -> CreateChunkRequest -> ShowS
$cshow :: CreateChunkRequest -> [Char]
show :: CreateChunkRequest -> [Char]
$cshowList :: [CreateChunkRequest] -> ShowS
showList :: [CreateChunkRequest] -> ShowS
P.Show, CreateChunkRequest -> CreateChunkRequest -> Bool
(CreateChunkRequest -> CreateChunkRequest -> Bool)
-> (CreateChunkRequest -> CreateChunkRequest -> Bool)
-> Eq CreateChunkRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateChunkRequest -> CreateChunkRequest -> Bool
== :: CreateChunkRequest -> CreateChunkRequest -> Bool
$c/= :: CreateChunkRequest -> CreateChunkRequest -> Bool
/= :: CreateChunkRequest -> CreateChunkRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CreateChunkRequest where
parseJSON :: Value -> Parser CreateChunkRequest
parseJSON = [Char]
-> (Object -> Parser CreateChunkRequest)
-> Value
-> Parser CreateChunkRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CreateChunkRequest" ((Object -> Parser CreateChunkRequest)
-> Value -> Parser CreateChunkRequest)
-> (Object -> Parser CreateChunkRequest)
-> Value
-> Parser CreateChunkRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Text -> Chunk -> CreateChunkRequest
CreateChunkRequest
(Text -> Chunk -> CreateChunkRequest)
-> Parser Text -> Parser (Chunk -> CreateChunkRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"parent")
Parser (Chunk -> CreateChunkRequest)
-> Parser Chunk -> Parser CreateChunkRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Chunk
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chunk")
instance A.ToJSON CreateChunkRequest where
toJSON :: CreateChunkRequest -> Value
toJSON CreateChunkRequest {Text
Chunk
createChunkRequestParent :: CreateChunkRequest -> Text
createChunkRequestChunk :: CreateChunkRequest -> Chunk
createChunkRequestParent :: Text
createChunkRequestChunk :: Chunk
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"parent" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
createChunkRequestParent
, Key
"chunk" Key -> Chunk -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Chunk
createChunkRequestChunk
]
mkCreateChunkRequest ::
Text ->
Chunk ->
CreateChunkRequest
mkCreateChunkRequest :: Text -> Chunk -> CreateChunkRequest
mkCreateChunkRequest Text
createChunkRequestParent Chunk
createChunkRequestChunk =
CreateChunkRequest
{ Text
createChunkRequestParent :: Text
createChunkRequestParent :: Text
createChunkRequestParent
, Chunk
createChunkRequestChunk :: Chunk
createChunkRequestChunk :: Chunk
createChunkRequestChunk
}
data CreateFileRequest = CreateFileRequest
{ CreateFileRequest -> Maybe File
createFileRequestFile :: !(Maybe File)
}
deriving (Int -> CreateFileRequest -> ShowS
[CreateFileRequest] -> ShowS
CreateFileRequest -> [Char]
(Int -> CreateFileRequest -> ShowS)
-> (CreateFileRequest -> [Char])
-> ([CreateFileRequest] -> ShowS)
-> Show CreateFileRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateFileRequest -> ShowS
showsPrec :: Int -> CreateFileRequest -> ShowS
$cshow :: CreateFileRequest -> [Char]
show :: CreateFileRequest -> [Char]
$cshowList :: [CreateFileRequest] -> ShowS
showList :: [CreateFileRequest] -> ShowS
P.Show, CreateFileRequest -> CreateFileRequest -> Bool
(CreateFileRequest -> CreateFileRequest -> Bool)
-> (CreateFileRequest -> CreateFileRequest -> Bool)
-> Eq CreateFileRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateFileRequest -> CreateFileRequest -> Bool
== :: CreateFileRequest -> CreateFileRequest -> Bool
$c/= :: CreateFileRequest -> CreateFileRequest -> Bool
/= :: CreateFileRequest -> CreateFileRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CreateFileRequest where
parseJSON :: Value -> Parser CreateFileRequest
parseJSON = [Char]
-> (Object -> Parser CreateFileRequest)
-> Value
-> Parser CreateFileRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CreateFileRequest" ((Object -> Parser CreateFileRequest)
-> Value -> Parser CreateFileRequest)
-> (Object -> Parser CreateFileRequest)
-> Value
-> Parser CreateFileRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe File -> CreateFileRequest
CreateFileRequest
(Maybe File -> CreateFileRequest)
-> Parser (Maybe File) -> Parser CreateFileRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe File)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"file")
instance A.ToJSON CreateFileRequest where
toJSON :: CreateFileRequest -> Value
toJSON CreateFileRequest {Maybe File
createFileRequestFile :: CreateFileRequest -> Maybe File
createFileRequestFile :: Maybe File
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"file" Key -> Maybe File -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe File
createFileRequestFile
]
mkCreateFileRequest ::
CreateFileRequest
mkCreateFileRequest :: CreateFileRequest
mkCreateFileRequest =
CreateFileRequest
{ createFileRequestFile :: Maybe File
createFileRequestFile = Maybe File
forall a. Maybe a
Nothing
}
data CreateFileResponse = CreateFileResponse
{ CreateFileResponse -> Maybe File
createFileResponseFile :: !(Maybe File)
}
deriving (Int -> CreateFileResponse -> ShowS
[CreateFileResponse] -> ShowS
CreateFileResponse -> [Char]
(Int -> CreateFileResponse -> ShowS)
-> (CreateFileResponse -> [Char])
-> ([CreateFileResponse] -> ShowS)
-> Show CreateFileResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateFileResponse -> ShowS
showsPrec :: Int -> CreateFileResponse -> ShowS
$cshow :: CreateFileResponse -> [Char]
show :: CreateFileResponse -> [Char]
$cshowList :: [CreateFileResponse] -> ShowS
showList :: [CreateFileResponse] -> ShowS
P.Show, CreateFileResponse -> CreateFileResponse -> Bool
(CreateFileResponse -> CreateFileResponse -> Bool)
-> (CreateFileResponse -> CreateFileResponse -> Bool)
-> Eq CreateFileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateFileResponse -> CreateFileResponse -> Bool
== :: CreateFileResponse -> CreateFileResponse -> Bool
$c/= :: CreateFileResponse -> CreateFileResponse -> Bool
/= :: CreateFileResponse -> CreateFileResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CreateFileResponse where
parseJSON :: Value -> Parser CreateFileResponse
parseJSON = [Char]
-> (Object -> Parser CreateFileResponse)
-> Value
-> Parser CreateFileResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CreateFileResponse" ((Object -> Parser CreateFileResponse)
-> Value -> Parser CreateFileResponse)
-> (Object -> Parser CreateFileResponse)
-> Value
-> Parser CreateFileResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe File -> CreateFileResponse
CreateFileResponse
(Maybe File -> CreateFileResponse)
-> Parser (Maybe File) -> Parser CreateFileResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe File)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"file")
instance A.ToJSON CreateFileResponse where
toJSON :: CreateFileResponse -> Value
toJSON CreateFileResponse {Maybe File
createFileResponseFile :: CreateFileResponse -> Maybe File
createFileResponseFile :: Maybe File
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"file" Key -> Maybe File -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe File
createFileResponseFile
]
mkCreateFileResponse ::
CreateFileResponse
mkCreateFileResponse :: CreateFileResponse
mkCreateFileResponse =
CreateFileResponse
{ createFileResponseFile :: Maybe File
createFileResponseFile = Maybe File
forall a. Maybe a
Nothing
}
data CreateTunedModelMetadata = CreateTunedModelMetadata
{ CreateTunedModelMetadata -> Maybe Float
createTunedModelMetadataCompletedPercent :: !(Maybe Float)
, CreateTunedModelMetadata -> Maybe Int
createTunedModelMetadataCompletedSteps :: !(Maybe Int)
, CreateTunedModelMetadata -> Maybe Int
createTunedModelMetadataTotalSteps :: !(Maybe Int)
, CreateTunedModelMetadata -> Maybe [TuningSnapshot]
createTunedModelMetadataSnapshots :: !(Maybe [TuningSnapshot])
, CreateTunedModelMetadata -> Maybe Text
createTunedModelMetadataTunedModel :: !(Maybe Text)
}
deriving (Int -> CreateTunedModelMetadata -> ShowS
[CreateTunedModelMetadata] -> ShowS
CreateTunedModelMetadata -> [Char]
(Int -> CreateTunedModelMetadata -> ShowS)
-> (CreateTunedModelMetadata -> [Char])
-> ([CreateTunedModelMetadata] -> ShowS)
-> Show CreateTunedModelMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateTunedModelMetadata -> ShowS
showsPrec :: Int -> CreateTunedModelMetadata -> ShowS
$cshow :: CreateTunedModelMetadata -> [Char]
show :: CreateTunedModelMetadata -> [Char]
$cshowList :: [CreateTunedModelMetadata] -> ShowS
showList :: [CreateTunedModelMetadata] -> ShowS
P.Show, CreateTunedModelMetadata -> CreateTunedModelMetadata -> Bool
(CreateTunedModelMetadata -> CreateTunedModelMetadata -> Bool)
-> (CreateTunedModelMetadata -> CreateTunedModelMetadata -> Bool)
-> Eq CreateTunedModelMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateTunedModelMetadata -> CreateTunedModelMetadata -> Bool
== :: CreateTunedModelMetadata -> CreateTunedModelMetadata -> Bool
$c/= :: CreateTunedModelMetadata -> CreateTunedModelMetadata -> Bool
/= :: CreateTunedModelMetadata -> CreateTunedModelMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CreateTunedModelMetadata where
parseJSON :: Value -> Parser CreateTunedModelMetadata
parseJSON = [Char]
-> (Object -> Parser CreateTunedModelMetadata)
-> Value
-> Parser CreateTunedModelMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CreateTunedModelMetadata" ((Object -> Parser CreateTunedModelMetadata)
-> Value -> Parser CreateTunedModelMetadata)
-> (Object -> Parser CreateTunedModelMetadata)
-> Value
-> Parser CreateTunedModelMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe [TuningSnapshot]
-> Maybe Text
-> CreateTunedModelMetadata
CreateTunedModelMetadata
(Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe [TuningSnapshot]
-> Maybe Text
-> CreateTunedModelMetadata)
-> Parser (Maybe Float)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe [TuningSnapshot]
-> Maybe Text
-> CreateTunedModelMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"completedPercent")
Parser
(Maybe Int
-> Maybe Int
-> Maybe [TuningSnapshot]
-> Maybe Text
-> CreateTunedModelMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe [TuningSnapshot]
-> Maybe Text
-> CreateTunedModelMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"completedSteps")
Parser
(Maybe Int
-> Maybe [TuningSnapshot]
-> Maybe Text
-> CreateTunedModelMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe [TuningSnapshot] -> Maybe Text -> CreateTunedModelMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"totalSteps")
Parser
(Maybe [TuningSnapshot] -> Maybe Text -> CreateTunedModelMetadata)
-> Parser (Maybe [TuningSnapshot])
-> Parser (Maybe Text -> CreateTunedModelMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [TuningSnapshot])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"snapshots")
Parser (Maybe Text -> CreateTunedModelMetadata)
-> Parser (Maybe Text) -> Parser CreateTunedModelMetadata
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tunedModel")
instance A.ToJSON CreateTunedModelMetadata where
toJSON :: CreateTunedModelMetadata -> Value
toJSON CreateTunedModelMetadata {Maybe Float
Maybe Int
Maybe [TuningSnapshot]
Maybe Text
createTunedModelMetadataCompletedPercent :: CreateTunedModelMetadata -> Maybe Float
createTunedModelMetadataCompletedSteps :: CreateTunedModelMetadata -> Maybe Int
createTunedModelMetadataTotalSteps :: CreateTunedModelMetadata -> Maybe Int
createTunedModelMetadataSnapshots :: CreateTunedModelMetadata -> Maybe [TuningSnapshot]
createTunedModelMetadataTunedModel :: CreateTunedModelMetadata -> Maybe Text
createTunedModelMetadataCompletedPercent :: Maybe Float
createTunedModelMetadataCompletedSteps :: Maybe Int
createTunedModelMetadataTotalSteps :: Maybe Int
createTunedModelMetadataSnapshots :: Maybe [TuningSnapshot]
createTunedModelMetadataTunedModel :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"completedPercent" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
createTunedModelMetadataCompletedPercent
, Key
"completedSteps" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
createTunedModelMetadataCompletedSteps
, Key
"totalSteps" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
createTunedModelMetadataTotalSteps
, Key
"snapshots" Key -> Maybe [TuningSnapshot] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [TuningSnapshot]
createTunedModelMetadataSnapshots
, Key
"tunedModel" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
createTunedModelMetadataTunedModel
]
mkCreateTunedModelMetadata ::
CreateTunedModelMetadata
mkCreateTunedModelMetadata :: CreateTunedModelMetadata
mkCreateTunedModelMetadata =
CreateTunedModelMetadata
{ createTunedModelMetadataCompletedPercent :: Maybe Float
createTunedModelMetadataCompletedPercent = Maybe Float
forall a. Maybe a
Nothing
, createTunedModelMetadataCompletedSteps :: Maybe Int
createTunedModelMetadataCompletedSteps = Maybe Int
forall a. Maybe a
Nothing
, createTunedModelMetadataTotalSteps :: Maybe Int
createTunedModelMetadataTotalSteps = Maybe Int
forall a. Maybe a
Nothing
, createTunedModelMetadataSnapshots :: Maybe [TuningSnapshot]
createTunedModelMetadataSnapshots = Maybe [TuningSnapshot]
forall a. Maybe a
Nothing
, createTunedModelMetadataTunedModel :: Maybe Text
createTunedModelMetadataTunedModel = Maybe Text
forall a. Maybe a
Nothing
}
data CreateTunedModelOperation = CreateTunedModelOperation
{ CreateTunedModelOperation -> Maybe Bool
createTunedModelOperationDone :: !(Maybe Bool)
, CreateTunedModelOperation -> Maybe Text
createTunedModelOperationName :: !(Maybe Text)
, CreateTunedModelOperation -> Maybe Status
createTunedModelOperationError :: !(Maybe Status)
, CreateTunedModelOperation -> Maybe CreateTunedModelMetadata
createTunedModelOperationMetadata :: !(Maybe CreateTunedModelMetadata)
, CreateTunedModelOperation -> Maybe TunedModel
createTunedModelOperationResponse :: !(Maybe TunedModel)
}
deriving (Int -> CreateTunedModelOperation -> ShowS
[CreateTunedModelOperation] -> ShowS
CreateTunedModelOperation -> [Char]
(Int -> CreateTunedModelOperation -> ShowS)
-> (CreateTunedModelOperation -> [Char])
-> ([CreateTunedModelOperation] -> ShowS)
-> Show CreateTunedModelOperation
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateTunedModelOperation -> ShowS
showsPrec :: Int -> CreateTunedModelOperation -> ShowS
$cshow :: CreateTunedModelOperation -> [Char]
show :: CreateTunedModelOperation -> [Char]
$cshowList :: [CreateTunedModelOperation] -> ShowS
showList :: [CreateTunedModelOperation] -> ShowS
P.Show, CreateTunedModelOperation -> CreateTunedModelOperation -> Bool
(CreateTunedModelOperation -> CreateTunedModelOperation -> Bool)
-> (CreateTunedModelOperation -> CreateTunedModelOperation -> Bool)
-> Eq CreateTunedModelOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateTunedModelOperation -> CreateTunedModelOperation -> Bool
== :: CreateTunedModelOperation -> CreateTunedModelOperation -> Bool
$c/= :: CreateTunedModelOperation -> CreateTunedModelOperation -> Bool
/= :: CreateTunedModelOperation -> CreateTunedModelOperation -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CreateTunedModelOperation where
parseJSON :: Value -> Parser CreateTunedModelOperation
parseJSON = [Char]
-> (Object -> Parser CreateTunedModelOperation)
-> Value
-> Parser CreateTunedModelOperation
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CreateTunedModelOperation" ((Object -> Parser CreateTunedModelOperation)
-> Value -> Parser CreateTunedModelOperation)
-> (Object -> Parser CreateTunedModelOperation)
-> Value
-> Parser CreateTunedModelOperation
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Bool
-> Maybe Text
-> Maybe Status
-> Maybe CreateTunedModelMetadata
-> Maybe TunedModel
-> CreateTunedModelOperation
CreateTunedModelOperation
(Maybe Bool
-> Maybe Text
-> Maybe Status
-> Maybe CreateTunedModelMetadata
-> Maybe TunedModel
-> CreateTunedModelOperation)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Status
-> Maybe CreateTunedModelMetadata
-> Maybe TunedModel
-> CreateTunedModelOperation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"done")
Parser
(Maybe Text
-> Maybe Status
-> Maybe CreateTunedModelMetadata
-> Maybe TunedModel
-> CreateTunedModelOperation)
-> Parser (Maybe Text)
-> Parser
(Maybe Status
-> Maybe CreateTunedModelMetadata
-> Maybe TunedModel
-> CreateTunedModelOperation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser
(Maybe Status
-> Maybe CreateTunedModelMetadata
-> Maybe TunedModel
-> CreateTunedModelOperation)
-> Parser (Maybe Status)
-> Parser
(Maybe CreateTunedModelMetadata
-> Maybe TunedModel -> CreateTunedModelOperation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"error")
Parser
(Maybe CreateTunedModelMetadata
-> Maybe TunedModel -> CreateTunedModelOperation)
-> Parser (Maybe CreateTunedModelMetadata)
-> Parser (Maybe TunedModel -> CreateTunedModelOperation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe CreateTunedModelMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"metadata")
Parser (Maybe TunedModel -> CreateTunedModelOperation)
-> Parser (Maybe TunedModel) -> Parser CreateTunedModelOperation
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe TunedModel)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"response")
instance A.ToJSON CreateTunedModelOperation where
toJSON :: CreateTunedModelOperation -> Value
toJSON CreateTunedModelOperation {Maybe Bool
Maybe Text
Maybe CreateTunedModelMetadata
Maybe Status
Maybe TunedModel
createTunedModelOperationDone :: CreateTunedModelOperation -> Maybe Bool
createTunedModelOperationName :: CreateTunedModelOperation -> Maybe Text
createTunedModelOperationError :: CreateTunedModelOperation -> Maybe Status
createTunedModelOperationMetadata :: CreateTunedModelOperation -> Maybe CreateTunedModelMetadata
createTunedModelOperationResponse :: CreateTunedModelOperation -> Maybe TunedModel
createTunedModelOperationDone :: Maybe Bool
createTunedModelOperationName :: Maybe Text
createTunedModelOperationError :: Maybe Status
createTunedModelOperationMetadata :: Maybe CreateTunedModelMetadata
createTunedModelOperationResponse :: Maybe TunedModel
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"done" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
createTunedModelOperationDone
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
createTunedModelOperationName
, Key
"error" Key -> Maybe Status -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Status
createTunedModelOperationError
, Key
"metadata" Key -> Maybe CreateTunedModelMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe CreateTunedModelMetadata
createTunedModelOperationMetadata
, Key
"response" Key -> Maybe TunedModel -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe TunedModel
createTunedModelOperationResponse
]
mkCreateTunedModelOperation ::
CreateTunedModelOperation
mkCreateTunedModelOperation :: CreateTunedModelOperation
mkCreateTunedModelOperation =
CreateTunedModelOperation
{ createTunedModelOperationDone :: Maybe Bool
createTunedModelOperationDone = Maybe Bool
forall a. Maybe a
Nothing
, createTunedModelOperationName :: Maybe Text
createTunedModelOperationName = Maybe Text
forall a. Maybe a
Nothing
, createTunedModelOperationError :: Maybe Status
createTunedModelOperationError = Maybe Status
forall a. Maybe a
Nothing
, createTunedModelOperationMetadata :: Maybe CreateTunedModelMetadata
createTunedModelOperationMetadata = Maybe CreateTunedModelMetadata
forall a. Maybe a
Nothing
, createTunedModelOperationResponse :: Maybe TunedModel
createTunedModelOperationResponse = Maybe TunedModel
forall a. Maybe a
Nothing
}
data CustomMetadata = CustomMetadata
{ CustomMetadata -> Maybe StringList
customMetadataStringListValue :: !(Maybe StringList)
, CustomMetadata -> Maybe Text
customMetadataStringValue :: !(Maybe Text)
, CustomMetadata -> Text
customMetadataKey :: !(Text)
, CustomMetadata -> Maybe Float
customMetadataNumericValue :: !(Maybe Float)
}
deriving (Int -> CustomMetadata -> ShowS
[CustomMetadata] -> ShowS
CustomMetadata -> [Char]
(Int -> CustomMetadata -> ShowS)
-> (CustomMetadata -> [Char])
-> ([CustomMetadata] -> ShowS)
-> Show CustomMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CustomMetadata -> ShowS
showsPrec :: Int -> CustomMetadata -> ShowS
$cshow :: CustomMetadata -> [Char]
show :: CustomMetadata -> [Char]
$cshowList :: [CustomMetadata] -> ShowS
showList :: [CustomMetadata] -> ShowS
P.Show, CustomMetadata -> CustomMetadata -> Bool
(CustomMetadata -> CustomMetadata -> Bool)
-> (CustomMetadata -> CustomMetadata -> Bool) -> Eq CustomMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CustomMetadata -> CustomMetadata -> Bool
== :: CustomMetadata -> CustomMetadata -> Bool
$c/= :: CustomMetadata -> CustomMetadata -> Bool
/= :: CustomMetadata -> CustomMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON CustomMetadata where
parseJSON :: Value -> Parser CustomMetadata
parseJSON = [Char]
-> (Object -> Parser CustomMetadata)
-> Value
-> Parser CustomMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"CustomMetadata" ((Object -> Parser CustomMetadata)
-> Value -> Parser CustomMetadata)
-> (Object -> Parser CustomMetadata)
-> Value
-> Parser CustomMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe StringList
-> Maybe Text -> Text -> Maybe Float -> CustomMetadata
CustomMetadata
(Maybe StringList
-> Maybe Text -> Text -> Maybe Float -> CustomMetadata)
-> Parser (Maybe StringList)
-> Parser (Maybe Text -> Text -> Maybe Float -> CustomMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe StringList)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"stringListValue")
Parser (Maybe Text -> Text -> Maybe Float -> CustomMetadata)
-> Parser (Maybe Text)
-> Parser (Text -> Maybe Float -> CustomMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"stringValue")
Parser (Text -> Maybe Float -> CustomMetadata)
-> Parser Text -> Parser (Maybe Float -> CustomMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"key")
Parser (Maybe Float -> CustomMetadata)
-> Parser (Maybe Float) -> Parser CustomMetadata
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"numericValue")
instance A.ToJSON CustomMetadata where
toJSON :: CustomMetadata -> Value
toJSON CustomMetadata {Maybe Float
Maybe Text
Maybe StringList
Text
customMetadataStringListValue :: CustomMetadata -> Maybe StringList
customMetadataStringValue :: CustomMetadata -> Maybe Text
customMetadataKey :: CustomMetadata -> Text
customMetadataNumericValue :: CustomMetadata -> Maybe Float
customMetadataStringListValue :: Maybe StringList
customMetadataStringValue :: Maybe Text
customMetadataKey :: Text
customMetadataNumericValue :: Maybe Float
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"stringListValue" Key -> Maybe StringList -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe StringList
customMetadataStringListValue
, Key
"stringValue" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
customMetadataStringValue
, Key
"key" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
customMetadataKey
, Key
"numericValue" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
customMetadataNumericValue
]
mkCustomMetadata ::
Text ->
CustomMetadata
mkCustomMetadata :: Text -> CustomMetadata
mkCustomMetadata Text
customMetadataKey =
CustomMetadata
{ customMetadataStringListValue :: Maybe StringList
customMetadataStringListValue = Maybe StringList
forall a. Maybe a
Nothing
, customMetadataStringValue :: Maybe Text
customMetadataStringValue = Maybe Text
forall a. Maybe a
Nothing
, Text
customMetadataKey :: Text
customMetadataKey :: Text
customMetadataKey
, customMetadataNumericValue :: Maybe Float
customMetadataNumericValue = Maybe Float
forall a. Maybe a
Nothing
}
data Dataset = Dataset
{ Dataset -> Maybe TuningExamples
datasetExamples :: !(Maybe TuningExamples)
}
deriving (Int -> Dataset -> ShowS
[Dataset] -> ShowS
Dataset -> [Char]
(Int -> Dataset -> ShowS)
-> (Dataset -> [Char]) -> ([Dataset] -> ShowS) -> Show Dataset
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Dataset -> ShowS
showsPrec :: Int -> Dataset -> ShowS
$cshow :: Dataset -> [Char]
show :: Dataset -> [Char]
$cshowList :: [Dataset] -> ShowS
showList :: [Dataset] -> ShowS
P.Show, Dataset -> Dataset -> Bool
(Dataset -> Dataset -> Bool)
-> (Dataset -> Dataset -> Bool) -> Eq Dataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Dataset -> Dataset -> Bool
== :: Dataset -> Dataset -> Bool
$c/= :: Dataset -> Dataset -> Bool
/= :: Dataset -> Dataset -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Dataset where
parseJSON :: Value -> Parser Dataset
parseJSON = [Char] -> (Object -> Parser Dataset) -> Value -> Parser Dataset
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Dataset" ((Object -> Parser Dataset) -> Value -> Parser Dataset)
-> (Object -> Parser Dataset) -> Value -> Parser Dataset
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe TuningExamples -> Dataset
Dataset
(Maybe TuningExamples -> Dataset)
-> Parser (Maybe TuningExamples) -> Parser Dataset
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe TuningExamples)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"examples")
instance A.ToJSON Dataset where
toJSON :: Dataset -> Value
toJSON Dataset {Maybe TuningExamples
datasetExamples :: Dataset -> Maybe TuningExamples
datasetExamples :: Maybe TuningExamples
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"examples" Key -> Maybe TuningExamples -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe TuningExamples
datasetExamples
]
mkDataset ::
Dataset
mkDataset :: Dataset
mkDataset =
Dataset
{ datasetExamples :: Maybe TuningExamples
datasetExamples = Maybe TuningExamples
forall a. Maybe a
Nothing
}
data DeleteChunkRequest = DeleteChunkRequest
{ DeleteChunkRequest -> Text
deleteChunkRequestName :: !(Text)
}
deriving (Int -> DeleteChunkRequest -> ShowS
[DeleteChunkRequest] -> ShowS
DeleteChunkRequest -> [Char]
(Int -> DeleteChunkRequest -> ShowS)
-> (DeleteChunkRequest -> [Char])
-> ([DeleteChunkRequest] -> ShowS)
-> Show DeleteChunkRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteChunkRequest -> ShowS
showsPrec :: Int -> DeleteChunkRequest -> ShowS
$cshow :: DeleteChunkRequest -> [Char]
show :: DeleteChunkRequest -> [Char]
$cshowList :: [DeleteChunkRequest] -> ShowS
showList :: [DeleteChunkRequest] -> ShowS
P.Show, DeleteChunkRequest -> DeleteChunkRequest -> Bool
(DeleteChunkRequest -> DeleteChunkRequest -> Bool)
-> (DeleteChunkRequest -> DeleteChunkRequest -> Bool)
-> Eq DeleteChunkRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteChunkRequest -> DeleteChunkRequest -> Bool
== :: DeleteChunkRequest -> DeleteChunkRequest -> Bool
$c/= :: DeleteChunkRequest -> DeleteChunkRequest -> Bool
/= :: DeleteChunkRequest -> DeleteChunkRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON DeleteChunkRequest where
parseJSON :: Value -> Parser DeleteChunkRequest
parseJSON = [Char]
-> (Object -> Parser DeleteChunkRequest)
-> Value
-> Parser DeleteChunkRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"DeleteChunkRequest" ((Object -> Parser DeleteChunkRequest)
-> Value -> Parser DeleteChunkRequest)
-> (Object -> Parser DeleteChunkRequest)
-> Value
-> Parser DeleteChunkRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Text -> DeleteChunkRequest
DeleteChunkRequest
(Text -> DeleteChunkRequest)
-> Parser Text -> Parser DeleteChunkRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"name")
instance A.ToJSON DeleteChunkRequest where
toJSON :: DeleteChunkRequest -> Value
toJSON DeleteChunkRequest {Text
deleteChunkRequestName :: DeleteChunkRequest -> Text
deleteChunkRequestName :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"name" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
deleteChunkRequestName
]
mkDeleteChunkRequest ::
Text ->
DeleteChunkRequest
mkDeleteChunkRequest :: Text -> DeleteChunkRequest
mkDeleteChunkRequest Text
deleteChunkRequestName =
DeleteChunkRequest
{ Text
deleteChunkRequestName :: Text
deleteChunkRequestName :: Text
deleteChunkRequestName
}
data Document = Document
{ Document -> Maybe DateTime
documentUpdateTime :: !(Maybe DateTime)
, Document -> Maybe Text
documentName :: !(Maybe Text)
, Document -> Maybe [CustomMetadata]
documentCustomMetadata :: !(Maybe [CustomMetadata])
, Document -> Maybe DateTime
documentCreateTime :: !(Maybe DateTime)
, Document -> Maybe Text
documentDisplayName :: !(Maybe Text)
}
deriving (Int -> Document -> ShowS
[Document] -> ShowS
Document -> [Char]
(Int -> Document -> ShowS)
-> (Document -> [Char]) -> ([Document] -> ShowS) -> Show Document
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Document -> ShowS
showsPrec :: Int -> Document -> ShowS
$cshow :: Document -> [Char]
show :: Document -> [Char]
$cshowList :: [Document] -> ShowS
showList :: [Document] -> ShowS
P.Show, Document -> Document -> Bool
(Document -> Document -> Bool)
-> (Document -> Document -> Bool) -> Eq Document
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Document -> Document -> Bool
== :: Document -> Document -> Bool
$c/= :: Document -> Document -> Bool
/= :: Document -> Document -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Document where
parseJSON :: Value -> Parser Document
parseJSON = [Char] -> (Object -> Parser Document) -> Value -> Parser Document
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Document" ((Object -> Parser Document) -> Value -> Parser Document)
-> (Object -> Parser Document) -> Value -> Parser Document
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe DateTime
-> Maybe Text
-> Maybe [CustomMetadata]
-> Maybe DateTime
-> Maybe Text
-> Document
Document
(Maybe DateTime
-> Maybe Text
-> Maybe [CustomMetadata]
-> Maybe DateTime
-> Maybe Text
-> Document)
-> Parser (Maybe DateTime)
-> Parser
(Maybe Text
-> Maybe [CustomMetadata]
-> Maybe DateTime
-> Maybe Text
-> Document)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"updateTime")
Parser
(Maybe Text
-> Maybe [CustomMetadata]
-> Maybe DateTime
-> Maybe Text
-> Document)
-> Parser (Maybe Text)
-> Parser
(Maybe [CustomMetadata]
-> Maybe DateTime -> Maybe Text -> Document)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser
(Maybe [CustomMetadata]
-> Maybe DateTime -> Maybe Text -> Document)
-> Parser (Maybe [CustomMetadata])
-> Parser (Maybe DateTime -> Maybe Text -> Document)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [CustomMetadata])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"customMetadata")
Parser (Maybe DateTime -> Maybe Text -> Document)
-> Parser (Maybe DateTime) -> Parser (Maybe Text -> Document)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"createTime")
Parser (Maybe Text -> Document)
-> Parser (Maybe Text) -> Parser Document
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"displayName")
instance A.ToJSON Document where
toJSON :: Document -> Value
toJSON Document {Maybe [CustomMetadata]
Maybe Text
Maybe DateTime
documentUpdateTime :: Document -> Maybe DateTime
documentName :: Document -> Maybe Text
documentCustomMetadata :: Document -> Maybe [CustomMetadata]
documentCreateTime :: Document -> Maybe DateTime
documentDisplayName :: Document -> Maybe Text
documentUpdateTime :: Maybe DateTime
documentName :: Maybe Text
documentCustomMetadata :: Maybe [CustomMetadata]
documentCreateTime :: Maybe DateTime
documentDisplayName :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"updateTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
documentUpdateTime
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
documentName
, Key
"customMetadata" Key -> Maybe [CustomMetadata] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [CustomMetadata]
documentCustomMetadata
, Key
"createTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
documentCreateTime
, Key
"displayName" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
documentDisplayName
]
mkDocument ::
Document
mkDocument :: Document
mkDocument =
Document
{ documentUpdateTime :: Maybe DateTime
documentUpdateTime = Maybe DateTime
forall a. Maybe a
Nothing
, documentName :: Maybe Text
documentName = Maybe Text
forall a. Maybe a
Nothing
, documentCustomMetadata :: Maybe [CustomMetadata]
documentCustomMetadata = Maybe [CustomMetadata]
forall a. Maybe a
Nothing
, documentCreateTime :: Maybe DateTime
documentCreateTime = Maybe DateTime
forall a. Maybe a
Nothing
, documentDisplayName :: Maybe Text
documentDisplayName = Maybe Text
forall a. Maybe a
Nothing
}
data DynamicRetrievalConfig = DynamicRetrievalConfig
{ DynamicRetrievalConfig -> Maybe Float
dynamicRetrievalConfigDynamicThreshold :: !(Maybe Float)
, DynamicRetrievalConfig -> Maybe E'Mode
dynamicRetrievalConfigMode :: !(Maybe E'Mode)
}
deriving (Int -> DynamicRetrievalConfig -> ShowS
[DynamicRetrievalConfig] -> ShowS
DynamicRetrievalConfig -> [Char]
(Int -> DynamicRetrievalConfig -> ShowS)
-> (DynamicRetrievalConfig -> [Char])
-> ([DynamicRetrievalConfig] -> ShowS)
-> Show DynamicRetrievalConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DynamicRetrievalConfig -> ShowS
showsPrec :: Int -> DynamicRetrievalConfig -> ShowS
$cshow :: DynamicRetrievalConfig -> [Char]
show :: DynamicRetrievalConfig -> [Char]
$cshowList :: [DynamicRetrievalConfig] -> ShowS
showList :: [DynamicRetrievalConfig] -> ShowS
P.Show, DynamicRetrievalConfig -> DynamicRetrievalConfig -> Bool
(DynamicRetrievalConfig -> DynamicRetrievalConfig -> Bool)
-> (DynamicRetrievalConfig -> DynamicRetrievalConfig -> Bool)
-> Eq DynamicRetrievalConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DynamicRetrievalConfig -> DynamicRetrievalConfig -> Bool
== :: DynamicRetrievalConfig -> DynamicRetrievalConfig -> Bool
$c/= :: DynamicRetrievalConfig -> DynamicRetrievalConfig -> Bool
/= :: DynamicRetrievalConfig -> DynamicRetrievalConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON DynamicRetrievalConfig where
parseJSON :: Value -> Parser DynamicRetrievalConfig
parseJSON = [Char]
-> (Object -> Parser DynamicRetrievalConfig)
-> Value
-> Parser DynamicRetrievalConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"DynamicRetrievalConfig" ((Object -> Parser DynamicRetrievalConfig)
-> Value -> Parser DynamicRetrievalConfig)
-> (Object -> Parser DynamicRetrievalConfig)
-> Value
-> Parser DynamicRetrievalConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Float -> Maybe E'Mode -> DynamicRetrievalConfig
DynamicRetrievalConfig
(Maybe Float -> Maybe E'Mode -> DynamicRetrievalConfig)
-> Parser (Maybe Float)
-> Parser (Maybe E'Mode -> DynamicRetrievalConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"dynamicThreshold")
Parser (Maybe E'Mode -> DynamicRetrievalConfig)
-> Parser (Maybe E'Mode) -> Parser DynamicRetrievalConfig
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'Mode)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"mode")
instance A.ToJSON DynamicRetrievalConfig where
toJSON :: DynamicRetrievalConfig -> Value
toJSON DynamicRetrievalConfig {Maybe Float
Maybe E'Mode
dynamicRetrievalConfigDynamicThreshold :: DynamicRetrievalConfig -> Maybe Float
dynamicRetrievalConfigMode :: DynamicRetrievalConfig -> Maybe E'Mode
dynamicRetrievalConfigDynamicThreshold :: Maybe Float
dynamicRetrievalConfigMode :: Maybe E'Mode
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"dynamicThreshold" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
dynamicRetrievalConfigDynamicThreshold
, Key
"mode" Key -> Maybe E'Mode -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'Mode
dynamicRetrievalConfigMode
]
mkDynamicRetrievalConfig ::
DynamicRetrievalConfig
mkDynamicRetrievalConfig :: DynamicRetrievalConfig
mkDynamicRetrievalConfig =
DynamicRetrievalConfig
{ dynamicRetrievalConfigDynamicThreshold :: Maybe Float
dynamicRetrievalConfigDynamicThreshold = Maybe Float
forall a. Maybe a
Nothing
, dynamicRetrievalConfigMode :: Maybe E'Mode
dynamicRetrievalConfigMode = Maybe E'Mode
forall a. Maybe a
Nothing
}
data EmbedContentRequest = EmbedContentRequest
{ EmbedContentRequest -> Maybe TaskType
embedContentRequestTaskType :: !(Maybe TaskType)
, EmbedContentRequest -> Content
embedContentRequestContent :: !(Content)
, EmbedContentRequest -> Maybe Int
embedContentRequestOutputDimensionality :: !(Maybe Int)
, EmbedContentRequest -> Text
embedContentRequestModel :: !(Text)
, EmbedContentRequest -> Maybe Text
embedContentRequestTitle :: !(Maybe Text)
}
deriving (Int -> EmbedContentRequest -> ShowS
[EmbedContentRequest] -> ShowS
EmbedContentRequest -> [Char]
(Int -> EmbedContentRequest -> ShowS)
-> (EmbedContentRequest -> [Char])
-> ([EmbedContentRequest] -> ShowS)
-> Show EmbedContentRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EmbedContentRequest -> ShowS
showsPrec :: Int -> EmbedContentRequest -> ShowS
$cshow :: EmbedContentRequest -> [Char]
show :: EmbedContentRequest -> [Char]
$cshowList :: [EmbedContentRequest] -> ShowS
showList :: [EmbedContentRequest] -> ShowS
P.Show, EmbedContentRequest -> EmbedContentRequest -> Bool
(EmbedContentRequest -> EmbedContentRequest -> Bool)
-> (EmbedContentRequest -> EmbedContentRequest -> Bool)
-> Eq EmbedContentRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EmbedContentRequest -> EmbedContentRequest -> Bool
== :: EmbedContentRequest -> EmbedContentRequest -> Bool
$c/= :: EmbedContentRequest -> EmbedContentRequest -> Bool
/= :: EmbedContentRequest -> EmbedContentRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON EmbedContentRequest where
parseJSON :: Value -> Parser EmbedContentRequest
parseJSON = [Char]
-> (Object -> Parser EmbedContentRequest)
-> Value
-> Parser EmbedContentRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"EmbedContentRequest" ((Object -> Parser EmbedContentRequest)
-> Value -> Parser EmbedContentRequest)
-> (Object -> Parser EmbedContentRequest)
-> Value
-> Parser EmbedContentRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe TaskType
-> Content
-> Maybe Int
-> Text
-> Maybe Text
-> EmbedContentRequest
EmbedContentRequest
(Maybe TaskType
-> Content
-> Maybe Int
-> Text
-> Maybe Text
-> EmbedContentRequest)
-> Parser (Maybe TaskType)
-> Parser
(Content -> Maybe Int -> Text -> Maybe Text -> EmbedContentRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe TaskType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"taskType")
Parser
(Content -> Maybe Int -> Text -> Maybe Text -> EmbedContentRequest)
-> Parser Content
-> Parser (Maybe Int -> Text -> Maybe Text -> EmbedContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Content
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"content")
Parser (Maybe Int -> Text -> Maybe Text -> EmbedContentRequest)
-> Parser (Maybe Int)
-> Parser (Text -> Maybe Text -> EmbedContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"outputDimensionality")
Parser (Text -> Maybe Text -> EmbedContentRequest)
-> Parser Text -> Parser (Maybe Text -> EmbedContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"model")
Parser (Maybe Text -> EmbedContentRequest)
-> Parser (Maybe Text) -> Parser EmbedContentRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"title")
instance A.ToJSON EmbedContentRequest where
toJSON :: EmbedContentRequest -> Value
toJSON EmbedContentRequest {Maybe Int
Maybe Text
Maybe TaskType
Text
Content
embedContentRequestTaskType :: EmbedContentRequest -> Maybe TaskType
embedContentRequestContent :: EmbedContentRequest -> Content
embedContentRequestOutputDimensionality :: EmbedContentRequest -> Maybe Int
embedContentRequestModel :: EmbedContentRequest -> Text
embedContentRequestTitle :: EmbedContentRequest -> Maybe Text
embedContentRequestTaskType :: Maybe TaskType
embedContentRequestContent :: Content
embedContentRequestOutputDimensionality :: Maybe Int
embedContentRequestModel :: Text
embedContentRequestTitle :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"taskType" Key -> Maybe TaskType -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe TaskType
embedContentRequestTaskType
, Key
"content" Key -> Content -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Content
embedContentRequestContent
, Key
"outputDimensionality" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
embedContentRequestOutputDimensionality
, Key
"model" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
embedContentRequestModel
, Key
"title" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
embedContentRequestTitle
]
mkEmbedContentRequest ::
Content ->
Text ->
EmbedContentRequest
mkEmbedContentRequest :: Content -> Text -> EmbedContentRequest
mkEmbedContentRequest Content
embedContentRequestContent Text
embedContentRequestModel =
EmbedContentRequest
{ embedContentRequestTaskType :: Maybe TaskType
embedContentRequestTaskType = Maybe TaskType
forall a. Maybe a
Nothing
, Content
embedContentRequestContent :: Content
embedContentRequestContent :: Content
embedContentRequestContent
, embedContentRequestOutputDimensionality :: Maybe Int
embedContentRequestOutputDimensionality = Maybe Int
forall a. Maybe a
Nothing
, Text
embedContentRequestModel :: Text
embedContentRequestModel :: Text
embedContentRequestModel
, embedContentRequestTitle :: Maybe Text
embedContentRequestTitle = Maybe Text
forall a. Maybe a
Nothing
}
data EmbedContentResponse = EmbedContentResponse
{ EmbedContentResponse -> Maybe ContentEmbedding
embedContentResponseEmbedding :: !(Maybe ContentEmbedding)
}
deriving (Int -> EmbedContentResponse -> ShowS
[EmbedContentResponse] -> ShowS
EmbedContentResponse -> [Char]
(Int -> EmbedContentResponse -> ShowS)
-> (EmbedContentResponse -> [Char])
-> ([EmbedContentResponse] -> ShowS)
-> Show EmbedContentResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EmbedContentResponse -> ShowS
showsPrec :: Int -> EmbedContentResponse -> ShowS
$cshow :: EmbedContentResponse -> [Char]
show :: EmbedContentResponse -> [Char]
$cshowList :: [EmbedContentResponse] -> ShowS
showList :: [EmbedContentResponse] -> ShowS
P.Show, EmbedContentResponse -> EmbedContentResponse -> Bool
(EmbedContentResponse -> EmbedContentResponse -> Bool)
-> (EmbedContentResponse -> EmbedContentResponse -> Bool)
-> Eq EmbedContentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EmbedContentResponse -> EmbedContentResponse -> Bool
== :: EmbedContentResponse -> EmbedContentResponse -> Bool
$c/= :: EmbedContentResponse -> EmbedContentResponse -> Bool
/= :: EmbedContentResponse -> EmbedContentResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON EmbedContentResponse where
parseJSON :: Value -> Parser EmbedContentResponse
parseJSON = [Char]
-> (Object -> Parser EmbedContentResponse)
-> Value
-> Parser EmbedContentResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"EmbedContentResponse" ((Object -> Parser EmbedContentResponse)
-> Value -> Parser EmbedContentResponse)
-> (Object -> Parser EmbedContentResponse)
-> Value
-> Parser EmbedContentResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe ContentEmbedding -> EmbedContentResponse
EmbedContentResponse
(Maybe ContentEmbedding -> EmbedContentResponse)
-> Parser (Maybe ContentEmbedding) -> Parser EmbedContentResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe ContentEmbedding)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"embedding")
instance A.ToJSON EmbedContentResponse where
toJSON :: EmbedContentResponse -> Value
toJSON EmbedContentResponse {Maybe ContentEmbedding
embedContentResponseEmbedding :: EmbedContentResponse -> Maybe ContentEmbedding
embedContentResponseEmbedding :: Maybe ContentEmbedding
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"embedding" Key -> Maybe ContentEmbedding -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ContentEmbedding
embedContentResponseEmbedding
]
mkEmbedContentResponse ::
EmbedContentResponse
mkEmbedContentResponse :: EmbedContentResponse
mkEmbedContentResponse =
EmbedContentResponse
{ embedContentResponseEmbedding :: Maybe ContentEmbedding
embedContentResponseEmbedding = Maybe ContentEmbedding
forall a. Maybe a
Nothing
}
data EmbedTextRequest = EmbedTextRequest
{ EmbedTextRequest -> Maybe Text
embedTextRequestText :: !(Maybe Text)
, EmbedTextRequest -> Text
embedTextRequestModel :: !(Text)
}
deriving (Int -> EmbedTextRequest -> ShowS
[EmbedTextRequest] -> ShowS
EmbedTextRequest -> [Char]
(Int -> EmbedTextRequest -> ShowS)
-> (EmbedTextRequest -> [Char])
-> ([EmbedTextRequest] -> ShowS)
-> Show EmbedTextRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EmbedTextRequest -> ShowS
showsPrec :: Int -> EmbedTextRequest -> ShowS
$cshow :: EmbedTextRequest -> [Char]
show :: EmbedTextRequest -> [Char]
$cshowList :: [EmbedTextRequest] -> ShowS
showList :: [EmbedTextRequest] -> ShowS
P.Show, EmbedTextRequest -> EmbedTextRequest -> Bool
(EmbedTextRequest -> EmbedTextRequest -> Bool)
-> (EmbedTextRequest -> EmbedTextRequest -> Bool)
-> Eq EmbedTextRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EmbedTextRequest -> EmbedTextRequest -> Bool
== :: EmbedTextRequest -> EmbedTextRequest -> Bool
$c/= :: EmbedTextRequest -> EmbedTextRequest -> Bool
/= :: EmbedTextRequest -> EmbedTextRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON EmbedTextRequest where
parseJSON :: Value -> Parser EmbedTextRequest
parseJSON = [Char]
-> (Object -> Parser EmbedTextRequest)
-> Value
-> Parser EmbedTextRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"EmbedTextRequest" ((Object -> Parser EmbedTextRequest)
-> Value -> Parser EmbedTextRequest)
-> (Object -> Parser EmbedTextRequest)
-> Value
-> Parser EmbedTextRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Text -> EmbedTextRequest
EmbedTextRequest
(Maybe Text -> Text -> EmbedTextRequest)
-> Parser (Maybe Text) -> Parser (Text -> EmbedTextRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"text")
Parser (Text -> EmbedTextRequest)
-> Parser Text -> Parser EmbedTextRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"model")
instance A.ToJSON EmbedTextRequest where
toJSON :: EmbedTextRequest -> Value
toJSON EmbedTextRequest {Maybe Text
Text
embedTextRequestText :: EmbedTextRequest -> Maybe Text
embedTextRequestModel :: EmbedTextRequest -> Text
embedTextRequestText :: Maybe Text
embedTextRequestModel :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"text" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
embedTextRequestText
, Key
"model" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
embedTextRequestModel
]
mkEmbedTextRequest ::
Text ->
EmbedTextRequest
mkEmbedTextRequest :: Text -> EmbedTextRequest
mkEmbedTextRequest Text
embedTextRequestModel =
EmbedTextRequest
{ embedTextRequestText :: Maybe Text
embedTextRequestText = Maybe Text
forall a. Maybe a
Nothing
, Text
embedTextRequestModel :: Text
embedTextRequestModel :: Text
embedTextRequestModel
}
data EmbedTextResponse = EmbedTextResponse
{ EmbedTextResponse -> Maybe Embedding
embedTextResponseEmbedding :: !(Maybe Embedding)
}
deriving (Int -> EmbedTextResponse -> ShowS
[EmbedTextResponse] -> ShowS
EmbedTextResponse -> [Char]
(Int -> EmbedTextResponse -> ShowS)
-> (EmbedTextResponse -> [Char])
-> ([EmbedTextResponse] -> ShowS)
-> Show EmbedTextResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EmbedTextResponse -> ShowS
showsPrec :: Int -> EmbedTextResponse -> ShowS
$cshow :: EmbedTextResponse -> [Char]
show :: EmbedTextResponse -> [Char]
$cshowList :: [EmbedTextResponse] -> ShowS
showList :: [EmbedTextResponse] -> ShowS
P.Show, EmbedTextResponse -> EmbedTextResponse -> Bool
(EmbedTextResponse -> EmbedTextResponse -> Bool)
-> (EmbedTextResponse -> EmbedTextResponse -> Bool)
-> Eq EmbedTextResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EmbedTextResponse -> EmbedTextResponse -> Bool
== :: EmbedTextResponse -> EmbedTextResponse -> Bool
$c/= :: EmbedTextResponse -> EmbedTextResponse -> Bool
/= :: EmbedTextResponse -> EmbedTextResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON EmbedTextResponse where
parseJSON :: Value -> Parser EmbedTextResponse
parseJSON = [Char]
-> (Object -> Parser EmbedTextResponse)
-> Value
-> Parser EmbedTextResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"EmbedTextResponse" ((Object -> Parser EmbedTextResponse)
-> Value -> Parser EmbedTextResponse)
-> (Object -> Parser EmbedTextResponse)
-> Value
-> Parser EmbedTextResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Embedding -> EmbedTextResponse
EmbedTextResponse
(Maybe Embedding -> EmbedTextResponse)
-> Parser (Maybe Embedding) -> Parser EmbedTextResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Embedding)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"embedding")
instance A.ToJSON EmbedTextResponse where
toJSON :: EmbedTextResponse -> Value
toJSON EmbedTextResponse {Maybe Embedding
embedTextResponseEmbedding :: EmbedTextResponse -> Maybe Embedding
embedTextResponseEmbedding :: Maybe Embedding
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"embedding" Key -> Maybe Embedding -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Embedding
embedTextResponseEmbedding
]
mkEmbedTextResponse ::
EmbedTextResponse
mkEmbedTextResponse :: EmbedTextResponse
mkEmbedTextResponse =
EmbedTextResponse
{ embedTextResponseEmbedding :: Maybe Embedding
embedTextResponseEmbedding = Maybe Embedding
forall a. Maybe a
Nothing
}
data Embedding = Embedding
{ Embedding -> Maybe [Float]
embeddingValue :: !(Maybe [Float])
}
deriving (Int -> Embedding -> ShowS
[Embedding] -> ShowS
Embedding -> [Char]
(Int -> Embedding -> ShowS)
-> (Embedding -> [Char])
-> ([Embedding] -> ShowS)
-> Show Embedding
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Embedding -> ShowS
showsPrec :: Int -> Embedding -> ShowS
$cshow :: Embedding -> [Char]
show :: Embedding -> [Char]
$cshowList :: [Embedding] -> ShowS
showList :: [Embedding] -> ShowS
P.Show, Embedding -> Embedding -> Bool
(Embedding -> Embedding -> Bool)
-> (Embedding -> Embedding -> Bool) -> Eq Embedding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Embedding -> Embedding -> Bool
== :: Embedding -> Embedding -> Bool
$c/= :: Embedding -> Embedding -> Bool
/= :: Embedding -> Embedding -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Embedding where
parseJSON :: Value -> Parser Embedding
parseJSON = [Char] -> (Object -> Parser Embedding) -> Value -> Parser Embedding
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Embedding" ((Object -> Parser Embedding) -> Value -> Parser Embedding)
-> (Object -> Parser Embedding) -> Value -> Parser Embedding
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Float] -> Embedding
Embedding
(Maybe [Float] -> Embedding)
-> Parser (Maybe [Float]) -> Parser Embedding
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Float])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"value")
instance A.ToJSON Embedding where
toJSON :: Embedding -> Value
toJSON Embedding {Maybe [Float]
embeddingValue :: Embedding -> Maybe [Float]
embeddingValue :: Maybe [Float]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"value" Key -> Maybe [Float] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Float]
embeddingValue
]
mkEmbedding ::
Embedding
mkEmbedding :: Embedding
mkEmbedding =
Embedding
{ embeddingValue :: Maybe [Float]
embeddingValue = Maybe [Float]
forall a. Maybe a
Nothing
}
data Example = Example
{ Example -> Message
exampleOutput :: !(Message)
, Example -> Message
exampleInput :: !(Message)
}
deriving (Int -> Example -> ShowS
[Example] -> ShowS
Example -> [Char]
(Int -> Example -> ShowS)
-> (Example -> [Char]) -> ([Example] -> ShowS) -> Show Example
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Example -> ShowS
showsPrec :: Int -> Example -> ShowS
$cshow :: Example -> [Char]
show :: Example -> [Char]
$cshowList :: [Example] -> ShowS
showList :: [Example] -> ShowS
P.Show, Example -> Example -> Bool
(Example -> Example -> Bool)
-> (Example -> Example -> Bool) -> Eq Example
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Example -> Example -> Bool
== :: Example -> Example -> Bool
$c/= :: Example -> Example -> Bool
/= :: Example -> Example -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Example where
parseJSON :: Value -> Parser Example
parseJSON = [Char] -> (Object -> Parser Example) -> Value -> Parser Example
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Example" ((Object -> Parser Example) -> Value -> Parser Example)
-> (Object -> Parser Example) -> Value -> Parser Example
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Message -> Message -> Example
Example
(Message -> Message -> Example)
-> Parser Message -> Parser (Message -> Example)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Message
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"output")
Parser (Message -> Example) -> Parser Message -> Parser Example
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Message
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"input")
instance A.ToJSON Example where
toJSON :: Example -> Value
toJSON Example {Message
exampleOutput :: Example -> Message
exampleInput :: Example -> Message
exampleOutput :: Message
exampleInput :: Message
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"output" Key -> Message -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Message
exampleOutput
, Key
"input" Key -> Message -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Message
exampleInput
]
mkExample ::
Message ->
Message ->
Example
mkExample :: Message -> Message -> Example
mkExample Message
exampleOutput Message
exampleInput =
Example
{ Message
exampleOutput :: Message
exampleOutput :: Message
exampleOutput
, Message
exampleInput :: Message
exampleInput :: Message
exampleInput
}
data ExecutableCode = ExecutableCode
{ ExecutableCode -> E'Language
executableCodeLanguage :: !(E'Language)
, ExecutableCode -> Text
executableCodeCode :: !(Text)
}
deriving (Int -> ExecutableCode -> ShowS
[ExecutableCode] -> ShowS
ExecutableCode -> [Char]
(Int -> ExecutableCode -> ShowS)
-> (ExecutableCode -> [Char])
-> ([ExecutableCode] -> ShowS)
-> Show ExecutableCode
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ExecutableCode -> ShowS
showsPrec :: Int -> ExecutableCode -> ShowS
$cshow :: ExecutableCode -> [Char]
show :: ExecutableCode -> [Char]
$cshowList :: [ExecutableCode] -> ShowS
showList :: [ExecutableCode] -> ShowS
P.Show, ExecutableCode -> ExecutableCode -> Bool
(ExecutableCode -> ExecutableCode -> Bool)
-> (ExecutableCode -> ExecutableCode -> Bool) -> Eq ExecutableCode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ExecutableCode -> ExecutableCode -> Bool
== :: ExecutableCode -> ExecutableCode -> Bool
$c/= :: ExecutableCode -> ExecutableCode -> Bool
/= :: ExecutableCode -> ExecutableCode -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ExecutableCode where
parseJSON :: Value -> Parser ExecutableCode
parseJSON = [Char]
-> (Object -> Parser ExecutableCode)
-> Value
-> Parser ExecutableCode
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ExecutableCode" ((Object -> Parser ExecutableCode)
-> Value -> Parser ExecutableCode)
-> (Object -> Parser ExecutableCode)
-> Value
-> Parser ExecutableCode
forall a b. (a -> b) -> a -> b
$ \Object
o ->
E'Language -> Text -> ExecutableCode
ExecutableCode
(E'Language -> Text -> ExecutableCode)
-> Parser E'Language -> Parser (Text -> ExecutableCode)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser E'Language
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"language")
Parser (Text -> ExecutableCode)
-> Parser Text -> Parser ExecutableCode
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"code")
instance A.ToJSON ExecutableCode where
toJSON :: ExecutableCode -> Value
toJSON ExecutableCode {Text
E'Language
executableCodeLanguage :: ExecutableCode -> E'Language
executableCodeCode :: ExecutableCode -> Text
executableCodeLanguage :: E'Language
executableCodeCode :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"language" Key -> E'Language -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= E'Language
executableCodeLanguage
, Key
"code" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
executableCodeCode
]
mkExecutableCode ::
E'Language ->
Text ->
ExecutableCode
mkExecutableCode :: E'Language -> Text -> ExecutableCode
mkExecutableCode E'Language
executableCodeLanguage Text
executableCodeCode =
ExecutableCode
{ E'Language
executableCodeLanguage :: E'Language
executableCodeLanguage :: E'Language
executableCodeLanguage
, Text
executableCodeCode :: Text
executableCodeCode :: Text
executableCodeCode
}
data File = File
{ File -> Maybe Text
fileUri :: !(Maybe Text)
, File -> Maybe Text
fileName :: !(Maybe Text)
, File -> Maybe DateTime
fileExpirationTime :: !(Maybe DateTime)
, File -> Maybe Text
fileDisplayName :: !(Maybe Text)
, File -> Maybe VideoFileMetadata
fileVideoMetadata :: !(Maybe VideoFileMetadata)
, File -> Maybe E'State
fileState :: !(Maybe E'State)
, File -> Maybe E'Source
fileSource :: !(Maybe E'Source)
, File -> Maybe Text
fileMimeType :: !(Maybe Text)
, File -> Maybe DateTime
fileCreateTime :: !(Maybe DateTime)
, File -> Maybe Status
fileError :: !(Maybe Status)
, File -> Maybe Text
fileDownloadUri :: !(Maybe Text)
, File -> Maybe Text
fileSizeBytes :: !(Maybe Text)
, File -> Maybe ByteArray
fileSha256Hash :: !(Maybe ByteArray)
, File -> Maybe DateTime
fileUpdateTime :: !(Maybe DateTime)
}
deriving (Int -> File -> ShowS
[File] -> ShowS
File -> [Char]
(Int -> File -> ShowS)
-> (File -> [Char]) -> ([File] -> ShowS) -> Show File
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> File -> ShowS
showsPrec :: Int -> File -> ShowS
$cshow :: File -> [Char]
show :: File -> [Char]
$cshowList :: [File] -> ShowS
showList :: [File] -> ShowS
P.Show, File -> File -> Bool
(File -> File -> Bool) -> (File -> File -> Bool) -> Eq File
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: File -> File -> Bool
== :: File -> File -> Bool
$c/= :: File -> File -> Bool
/= :: File -> File -> Bool
P.Eq, P.Typeable)
instance A.FromJSON File where
parseJSON :: Value -> Parser File
parseJSON = [Char] -> (Object -> Parser File) -> Value -> Parser File
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"File" ((Object -> Parser File) -> Value -> Parser File)
-> (Object -> Parser File) -> Value -> Parser File
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text
-> Maybe Text
-> Maybe DateTime
-> Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File
File
(Maybe Text
-> Maybe Text
-> Maybe DateTime
-> Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe DateTime
-> Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"uri")
Parser
(Maybe Text
-> Maybe DateTime
-> Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe Text)
-> Parser
(Maybe DateTime
-> Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser
(Maybe DateTime
-> Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe DateTime)
-> Parser
(Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"expirationTime")
Parser
(Maybe Text
-> Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe Text)
-> Parser
(Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"displayName")
Parser
(Maybe VideoFileMetadata
-> Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe VideoFileMetadata)
-> Parser
(Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe VideoFileMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"videoMetadata")
Parser
(Maybe E'State
-> Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe E'State)
-> Parser
(Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'State)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"state")
Parser
(Maybe E'Source
-> Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe E'Source)
-> Parser
(Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'Source)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"source")
Parser
(Maybe Text
-> Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe Text)
-> Parser
(Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"mimeType")
Parser
(Maybe DateTime
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe DateTime)
-> Parser
(Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"createTime")
Parser
(Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe ByteArray
-> Maybe DateTime
-> File)
-> Parser (Maybe Status)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe ByteArray -> Maybe DateTime -> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"error")
Parser
(Maybe Text
-> Maybe Text -> Maybe ByteArray -> Maybe DateTime -> File)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe ByteArray -> Maybe DateTime -> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"downloadUri")
Parser (Maybe Text -> Maybe ByteArray -> Maybe DateTime -> File)
-> Parser (Maybe Text)
-> Parser (Maybe ByteArray -> Maybe DateTime -> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"sizeBytes")
Parser (Maybe ByteArray -> Maybe DateTime -> File)
-> Parser (Maybe ByteArray) -> Parser (Maybe DateTime -> File)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe ByteArray)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"sha256Hash")
Parser (Maybe DateTime -> File)
-> Parser (Maybe DateTime) -> Parser File
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"updateTime")
instance A.ToJSON File where
toJSON :: File -> Value
toJSON File {Maybe Text
Maybe ByteArray
Maybe DateTime
Maybe E'Source
Maybe E'State
Maybe Status
Maybe VideoFileMetadata
fileUri :: File -> Maybe Text
fileName :: File -> Maybe Text
fileExpirationTime :: File -> Maybe DateTime
fileDisplayName :: File -> Maybe Text
fileVideoMetadata :: File -> Maybe VideoFileMetadata
fileState :: File -> Maybe E'State
fileSource :: File -> Maybe E'Source
fileMimeType :: File -> Maybe Text
fileCreateTime :: File -> Maybe DateTime
fileError :: File -> Maybe Status
fileDownloadUri :: File -> Maybe Text
fileSizeBytes :: File -> Maybe Text
fileSha256Hash :: File -> Maybe ByteArray
fileUpdateTime :: File -> Maybe DateTime
fileUri :: Maybe Text
fileName :: Maybe Text
fileExpirationTime :: Maybe DateTime
fileDisplayName :: Maybe Text
fileVideoMetadata :: Maybe VideoFileMetadata
fileState :: Maybe E'State
fileSource :: Maybe E'Source
fileMimeType :: Maybe Text
fileCreateTime :: Maybe DateTime
fileError :: Maybe Status
fileDownloadUri :: Maybe Text
fileSizeBytes :: Maybe Text
fileSha256Hash :: Maybe ByteArray
fileUpdateTime :: Maybe DateTime
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"uri" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
fileUri
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
fileName
, Key
"expirationTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
fileExpirationTime
, Key
"displayName" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
fileDisplayName
, Key
"videoMetadata" Key -> Maybe VideoFileMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe VideoFileMetadata
fileVideoMetadata
, Key
"state" Key -> Maybe E'State -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'State
fileState
, Key
"source" Key -> Maybe E'Source -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'Source
fileSource
, Key
"mimeType" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
fileMimeType
, Key
"createTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
fileCreateTime
, Key
"error" Key -> Maybe Status -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Status
fileError
, Key
"downloadUri" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
fileDownloadUri
, Key
"sizeBytes" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
fileSizeBytes
, Key
"sha256Hash" Key -> Maybe ByteArray -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ByteArray
fileSha256Hash
, Key
"updateTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
fileUpdateTime
]
mkFile ::
File
mkFile :: File
mkFile =
File
{ fileUri :: Maybe Text
fileUri = Maybe Text
forall a. Maybe a
Nothing
, fileName :: Maybe Text
fileName = Maybe Text
forall a. Maybe a
Nothing
, fileExpirationTime :: Maybe DateTime
fileExpirationTime = Maybe DateTime
forall a. Maybe a
Nothing
, fileDisplayName :: Maybe Text
fileDisplayName = Maybe Text
forall a. Maybe a
Nothing
, fileVideoMetadata :: Maybe VideoFileMetadata
fileVideoMetadata = Maybe VideoFileMetadata
forall a. Maybe a
Nothing
, fileState :: Maybe E'State
fileState = Maybe E'State
forall a. Maybe a
Nothing
, fileSource :: Maybe E'Source
fileSource = Maybe E'Source
forall a. Maybe a
Nothing
, fileMimeType :: Maybe Text
fileMimeType = Maybe Text
forall a. Maybe a
Nothing
, fileCreateTime :: Maybe DateTime
fileCreateTime = Maybe DateTime
forall a. Maybe a
Nothing
, fileError :: Maybe Status
fileError = Maybe Status
forall a. Maybe a
Nothing
, fileDownloadUri :: Maybe Text
fileDownloadUri = Maybe Text
forall a. Maybe a
Nothing
, fileSizeBytes :: Maybe Text
fileSizeBytes = Maybe Text
forall a. Maybe a
Nothing
, fileSha256Hash :: Maybe ByteArray
fileSha256Hash = Maybe ByteArray
forall a. Maybe a
Nothing
, fileUpdateTime :: Maybe DateTime
fileUpdateTime = Maybe DateTime
forall a. Maybe a
Nothing
}
data FileData = FileData
{ FileData -> Maybe Text
fileDataMimeType :: !(Maybe Text)
, FileData -> Text
fileDataFileUri :: !(Text)
}
deriving (Int -> FileData -> ShowS
[FileData] -> ShowS
FileData -> [Char]
(Int -> FileData -> ShowS)
-> (FileData -> [Char]) -> ([FileData] -> ShowS) -> Show FileData
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FileData -> ShowS
showsPrec :: Int -> FileData -> ShowS
$cshow :: FileData -> [Char]
show :: FileData -> [Char]
$cshowList :: [FileData] -> ShowS
showList :: [FileData] -> ShowS
P.Show, FileData -> FileData -> Bool
(FileData -> FileData -> Bool)
-> (FileData -> FileData -> Bool) -> Eq FileData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FileData -> FileData -> Bool
== :: FileData -> FileData -> Bool
$c/= :: FileData -> FileData -> Bool
/= :: FileData -> FileData -> Bool
P.Eq, P.Typeable)
instance A.FromJSON FileData where
parseJSON :: Value -> Parser FileData
parseJSON = [Char] -> (Object -> Parser FileData) -> Value -> Parser FileData
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"FileData" ((Object -> Parser FileData) -> Value -> Parser FileData)
-> (Object -> Parser FileData) -> Value -> Parser FileData
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Text -> FileData
FileData
(Maybe Text -> Text -> FileData)
-> Parser (Maybe Text) -> Parser (Text -> FileData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"mimeType")
Parser (Text -> FileData) -> Parser Text -> Parser FileData
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"fileUri")
instance A.ToJSON FileData where
toJSON :: FileData -> Value
toJSON FileData {Maybe Text
Text
fileDataMimeType :: FileData -> Maybe Text
fileDataFileUri :: FileData -> Text
fileDataMimeType :: Maybe Text
fileDataFileUri :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"mimeType" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
fileDataMimeType
, Key
"fileUri" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
fileDataFileUri
]
mkFileData ::
Text ->
FileData
mkFileData :: Text -> FileData
mkFileData Text
fileDataFileUri =
FileData
{ fileDataMimeType :: Maybe Text
fileDataMimeType = Maybe Text
forall a. Maybe a
Nothing
, Text
fileDataFileUri :: Text
fileDataFileUri :: Text
fileDataFileUri
}
data FunctionCall = FunctionCall
{ FunctionCall -> Maybe (Map [Char] [Char])
functionCallArgs :: !(Maybe (Map.Map String String))
, FunctionCall -> Maybe Text
functionCallId :: !(Maybe Text)
, FunctionCall -> Text
functionCallName :: !(Text)
}
deriving (Int -> FunctionCall -> ShowS
[FunctionCall] -> ShowS
FunctionCall -> [Char]
(Int -> FunctionCall -> ShowS)
-> (FunctionCall -> [Char])
-> ([FunctionCall] -> ShowS)
-> Show FunctionCall
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FunctionCall -> ShowS
showsPrec :: Int -> FunctionCall -> ShowS
$cshow :: FunctionCall -> [Char]
show :: FunctionCall -> [Char]
$cshowList :: [FunctionCall] -> ShowS
showList :: [FunctionCall] -> ShowS
P.Show, FunctionCall -> FunctionCall -> Bool
(FunctionCall -> FunctionCall -> Bool)
-> (FunctionCall -> FunctionCall -> Bool) -> Eq FunctionCall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunctionCall -> FunctionCall -> Bool
== :: FunctionCall -> FunctionCall -> Bool
$c/= :: FunctionCall -> FunctionCall -> Bool
/= :: FunctionCall -> FunctionCall -> Bool
P.Eq, P.Typeable)
instance A.FromJSON FunctionCall where
parseJSON :: Value -> Parser FunctionCall
parseJSON = [Char]
-> (Object -> Parser FunctionCall) -> Value -> Parser FunctionCall
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"FunctionCall" ((Object -> Parser FunctionCall) -> Value -> Parser FunctionCall)
-> (Object -> Parser FunctionCall) -> Value -> Parser FunctionCall
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe (Map [Char] [Char]) -> Maybe Text -> Text -> FunctionCall
FunctionCall
(Maybe (Map [Char] [Char]) -> Maybe Text -> Text -> FunctionCall)
-> Parser (Maybe (Map [Char] [Char]))
-> Parser (Maybe Text -> Text -> FunctionCall)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe (Map [Char] [Char]))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"args")
Parser (Maybe Text -> Text -> FunctionCall)
-> Parser (Maybe Text) -> Parser (Text -> FunctionCall)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"id")
Parser (Text -> FunctionCall) -> Parser Text -> Parser FunctionCall
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"name")
instance A.ToJSON FunctionCall where
toJSON :: FunctionCall -> Value
toJSON FunctionCall {Maybe Text
Maybe (Map [Char] [Char])
Text
functionCallArgs :: FunctionCall -> Maybe (Map [Char] [Char])
functionCallId :: FunctionCall -> Maybe Text
functionCallName :: FunctionCall -> Text
functionCallArgs :: Maybe (Map [Char] [Char])
functionCallId :: Maybe Text
functionCallName :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"args" Key -> Maybe (Map [Char] [Char]) -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe (Map [Char] [Char])
functionCallArgs
, Key
"id" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
functionCallId
, Key
"name" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
functionCallName
]
mkFunctionCall ::
Text ->
FunctionCall
mkFunctionCall :: Text -> FunctionCall
mkFunctionCall Text
functionCallName =
FunctionCall
{ functionCallArgs :: Maybe (Map [Char] [Char])
functionCallArgs = Maybe (Map [Char] [Char])
forall a. Maybe a
Nothing
, functionCallId :: Maybe Text
functionCallId = Maybe Text
forall a. Maybe a
Nothing
, Text
functionCallName :: Text
functionCallName :: Text
functionCallName
}
data FunctionCallingConfig = FunctionCallingConfig
{ FunctionCallingConfig -> Maybe E'Mode2
functionCallingConfigMode :: !(Maybe E'Mode2)
, FunctionCallingConfig -> Maybe [Text]
functionCallingConfigAllowedFunctionNames :: !(Maybe [Text])
}
deriving (Int -> FunctionCallingConfig -> ShowS
[FunctionCallingConfig] -> ShowS
FunctionCallingConfig -> [Char]
(Int -> FunctionCallingConfig -> ShowS)
-> (FunctionCallingConfig -> [Char])
-> ([FunctionCallingConfig] -> ShowS)
-> Show FunctionCallingConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FunctionCallingConfig -> ShowS
showsPrec :: Int -> FunctionCallingConfig -> ShowS
$cshow :: FunctionCallingConfig -> [Char]
show :: FunctionCallingConfig -> [Char]
$cshowList :: [FunctionCallingConfig] -> ShowS
showList :: [FunctionCallingConfig] -> ShowS
P.Show, FunctionCallingConfig -> FunctionCallingConfig -> Bool
(FunctionCallingConfig -> FunctionCallingConfig -> Bool)
-> (FunctionCallingConfig -> FunctionCallingConfig -> Bool)
-> Eq FunctionCallingConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunctionCallingConfig -> FunctionCallingConfig -> Bool
== :: FunctionCallingConfig -> FunctionCallingConfig -> Bool
$c/= :: FunctionCallingConfig -> FunctionCallingConfig -> Bool
/= :: FunctionCallingConfig -> FunctionCallingConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON FunctionCallingConfig where
parseJSON :: Value -> Parser FunctionCallingConfig
parseJSON = [Char]
-> (Object -> Parser FunctionCallingConfig)
-> Value
-> Parser FunctionCallingConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"FunctionCallingConfig" ((Object -> Parser FunctionCallingConfig)
-> Value -> Parser FunctionCallingConfig)
-> (Object -> Parser FunctionCallingConfig)
-> Value
-> Parser FunctionCallingConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe E'Mode2 -> Maybe [Text] -> FunctionCallingConfig
FunctionCallingConfig
(Maybe E'Mode2 -> Maybe [Text] -> FunctionCallingConfig)
-> Parser (Maybe E'Mode2)
-> Parser (Maybe [Text] -> FunctionCallingConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe E'Mode2)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"mode")
Parser (Maybe [Text] -> FunctionCallingConfig)
-> Parser (Maybe [Text]) -> Parser FunctionCallingConfig
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"allowedFunctionNames")
instance A.ToJSON FunctionCallingConfig where
toJSON :: FunctionCallingConfig -> Value
toJSON FunctionCallingConfig {Maybe [Text]
Maybe E'Mode2
functionCallingConfigMode :: FunctionCallingConfig -> Maybe E'Mode2
functionCallingConfigAllowedFunctionNames :: FunctionCallingConfig -> Maybe [Text]
functionCallingConfigMode :: Maybe E'Mode2
functionCallingConfigAllowedFunctionNames :: Maybe [Text]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"mode" Key -> Maybe E'Mode2 -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'Mode2
functionCallingConfigMode
, Key
"allowedFunctionNames" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
functionCallingConfigAllowedFunctionNames
]
mkFunctionCallingConfig ::
FunctionCallingConfig
mkFunctionCallingConfig :: FunctionCallingConfig
mkFunctionCallingConfig =
FunctionCallingConfig
{ functionCallingConfigMode :: Maybe E'Mode2
functionCallingConfigMode = Maybe E'Mode2
forall a. Maybe a
Nothing
, functionCallingConfigAllowedFunctionNames :: Maybe [Text]
functionCallingConfigAllowedFunctionNames = Maybe [Text]
forall a. Maybe a
Nothing
}
data FunctionDeclaration = FunctionDeclaration
{ FunctionDeclaration -> Maybe Schema
functionDeclarationParameters :: !(Maybe Schema)
, FunctionDeclaration -> Text
functionDeclarationName :: !(Text)
, FunctionDeclaration -> Maybe E'Behavior
functionDeclarationBehavior :: !(Maybe E'Behavior)
, FunctionDeclaration -> Text
functionDeclarationDescription :: !(Text)
, FunctionDeclaration -> Maybe Schema
functionDeclarationResponse :: !(Maybe Schema)
, FunctionDeclaration -> Maybe [Char]
functionDeclarationResponseJsonSchema :: !(Maybe String)
, FunctionDeclaration -> Maybe [Char]
functionDeclarationParametersJsonSchema :: !(Maybe String)
}
deriving (Int -> FunctionDeclaration -> ShowS
[FunctionDeclaration] -> ShowS
FunctionDeclaration -> [Char]
(Int -> FunctionDeclaration -> ShowS)
-> (FunctionDeclaration -> [Char])
-> ([FunctionDeclaration] -> ShowS)
-> Show FunctionDeclaration
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FunctionDeclaration -> ShowS
showsPrec :: Int -> FunctionDeclaration -> ShowS
$cshow :: FunctionDeclaration -> [Char]
show :: FunctionDeclaration -> [Char]
$cshowList :: [FunctionDeclaration] -> ShowS
showList :: [FunctionDeclaration] -> ShowS
P.Show, FunctionDeclaration -> FunctionDeclaration -> Bool
(FunctionDeclaration -> FunctionDeclaration -> Bool)
-> (FunctionDeclaration -> FunctionDeclaration -> Bool)
-> Eq FunctionDeclaration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunctionDeclaration -> FunctionDeclaration -> Bool
== :: FunctionDeclaration -> FunctionDeclaration -> Bool
$c/= :: FunctionDeclaration -> FunctionDeclaration -> Bool
/= :: FunctionDeclaration -> FunctionDeclaration -> Bool
P.Eq, P.Typeable)
instance A.FromJSON FunctionDeclaration where
parseJSON :: Value -> Parser FunctionDeclaration
parseJSON = [Char]
-> (Object -> Parser FunctionDeclaration)
-> Value
-> Parser FunctionDeclaration
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"FunctionDeclaration" ((Object -> Parser FunctionDeclaration)
-> Value -> Parser FunctionDeclaration)
-> (Object -> Parser FunctionDeclaration)
-> Value
-> Parser FunctionDeclaration
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Schema
-> Text
-> Maybe E'Behavior
-> Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration
FunctionDeclaration
(Maybe Schema
-> Text
-> Maybe E'Behavior
-> Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration)
-> Parser (Maybe Schema)
-> Parser
(Text
-> Maybe E'Behavior
-> Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Schema)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"parameters")
Parser
(Text
-> Maybe E'Behavior
-> Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration)
-> Parser Text
-> Parser
(Maybe E'Behavior
-> Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"name")
Parser
(Maybe E'Behavior
-> Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration)
-> Parser (Maybe E'Behavior)
-> Parser
(Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'Behavior)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"behavior")
Parser
(Text
-> Maybe Schema
-> Maybe [Char]
-> Maybe [Char]
-> FunctionDeclaration)
-> Parser Text
-> Parser
(Maybe Schema
-> Maybe [Char] -> Maybe [Char] -> FunctionDeclaration)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"description")
Parser
(Maybe Schema
-> Maybe [Char] -> Maybe [Char] -> FunctionDeclaration)
-> Parser (Maybe Schema)
-> Parser (Maybe [Char] -> Maybe [Char] -> FunctionDeclaration)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Schema)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"response")
Parser (Maybe [Char] -> Maybe [Char] -> FunctionDeclaration)
-> Parser (Maybe [Char])
-> Parser (Maybe [Char] -> FunctionDeclaration)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Char])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"responseJsonSchema")
Parser (Maybe [Char] -> FunctionDeclaration)
-> Parser (Maybe [Char]) -> Parser FunctionDeclaration
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Char])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"parametersJsonSchema")
instance A.ToJSON FunctionDeclaration where
toJSON :: FunctionDeclaration -> Value
toJSON FunctionDeclaration {Maybe [Char]
Maybe E'Behavior
Maybe Schema
Text
functionDeclarationParameters :: FunctionDeclaration -> Maybe Schema
functionDeclarationName :: FunctionDeclaration -> Text
functionDeclarationBehavior :: FunctionDeclaration -> Maybe E'Behavior
functionDeclarationDescription :: FunctionDeclaration -> Text
functionDeclarationResponse :: FunctionDeclaration -> Maybe Schema
functionDeclarationResponseJsonSchema :: FunctionDeclaration -> Maybe [Char]
functionDeclarationParametersJsonSchema :: FunctionDeclaration -> Maybe [Char]
functionDeclarationParameters :: Maybe Schema
functionDeclarationName :: Text
functionDeclarationBehavior :: Maybe E'Behavior
functionDeclarationDescription :: Text
functionDeclarationResponse :: Maybe Schema
functionDeclarationResponseJsonSchema :: Maybe [Char]
functionDeclarationParametersJsonSchema :: Maybe [Char]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"parameters" Key -> Maybe Schema -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Schema
functionDeclarationParameters
, Key
"name" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
functionDeclarationName
, Key
"behavior" Key -> Maybe E'Behavior -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'Behavior
functionDeclarationBehavior
, Key
"description" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
functionDeclarationDescription
, Key
"response" Key -> Maybe Schema -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Schema
functionDeclarationResponse
, Key
"responseJsonSchema" Key -> Maybe [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Char]
functionDeclarationResponseJsonSchema
, Key
"parametersJsonSchema" Key -> Maybe [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Char]
functionDeclarationParametersJsonSchema
]
mkFunctionDeclaration ::
Text ->
Text ->
FunctionDeclaration
mkFunctionDeclaration :: Text -> Text -> FunctionDeclaration
mkFunctionDeclaration Text
functionDeclarationName Text
functionDeclarationDescription =
FunctionDeclaration
{ functionDeclarationParameters :: Maybe Schema
functionDeclarationParameters = Maybe Schema
forall a. Maybe a
Nothing
, Text
functionDeclarationName :: Text
functionDeclarationName :: Text
functionDeclarationName
, functionDeclarationBehavior :: Maybe E'Behavior
functionDeclarationBehavior = Maybe E'Behavior
forall a. Maybe a
Nothing
, Text
functionDeclarationDescription :: Text
functionDeclarationDescription :: Text
functionDeclarationDescription
, functionDeclarationResponse :: Maybe Schema
functionDeclarationResponse = Maybe Schema
forall a. Maybe a
Nothing
, functionDeclarationResponseJsonSchema :: Maybe [Char]
functionDeclarationResponseJsonSchema = Maybe [Char]
forall a. Maybe a
Nothing
, functionDeclarationParametersJsonSchema :: Maybe [Char]
functionDeclarationParametersJsonSchema = Maybe [Char]
forall a. Maybe a
Nothing
}
data FunctionResponse = FunctionResponse
{ FunctionResponse -> Maybe E'Scheduling
functionResponseScheduling :: !(Maybe E'Scheduling)
, FunctionResponse -> Maybe Text
functionResponseId :: !(Maybe Text)
, FunctionResponse -> Maybe Bool
functionResponseWillContinue :: !(Maybe Bool)
, FunctionResponse -> Text
functionResponseName :: !(Text)
, FunctionResponse -> Map [Char] [Char]
functionResponseResponse :: !((Map.Map String String))
}
deriving (Int -> FunctionResponse -> ShowS
[FunctionResponse] -> ShowS
FunctionResponse -> [Char]
(Int -> FunctionResponse -> ShowS)
-> (FunctionResponse -> [Char])
-> ([FunctionResponse] -> ShowS)
-> Show FunctionResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FunctionResponse -> ShowS
showsPrec :: Int -> FunctionResponse -> ShowS
$cshow :: FunctionResponse -> [Char]
show :: FunctionResponse -> [Char]
$cshowList :: [FunctionResponse] -> ShowS
showList :: [FunctionResponse] -> ShowS
P.Show, FunctionResponse -> FunctionResponse -> Bool
(FunctionResponse -> FunctionResponse -> Bool)
-> (FunctionResponse -> FunctionResponse -> Bool)
-> Eq FunctionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunctionResponse -> FunctionResponse -> Bool
== :: FunctionResponse -> FunctionResponse -> Bool
$c/= :: FunctionResponse -> FunctionResponse -> Bool
/= :: FunctionResponse -> FunctionResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON FunctionResponse where
parseJSON :: Value -> Parser FunctionResponse
parseJSON = [Char]
-> (Object -> Parser FunctionResponse)
-> Value
-> Parser FunctionResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"FunctionResponse" ((Object -> Parser FunctionResponse)
-> Value -> Parser FunctionResponse)
-> (Object -> Parser FunctionResponse)
-> Value
-> Parser FunctionResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe E'Scheduling
-> Maybe Text
-> Maybe Bool
-> Text
-> Map [Char] [Char]
-> FunctionResponse
FunctionResponse
(Maybe E'Scheduling
-> Maybe Text
-> Maybe Bool
-> Text
-> Map [Char] [Char]
-> FunctionResponse)
-> Parser (Maybe E'Scheduling)
-> Parser
(Maybe Text
-> Maybe Bool -> Text -> Map [Char] [Char] -> FunctionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe E'Scheduling)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"scheduling")
Parser
(Maybe Text
-> Maybe Bool -> Text -> Map [Char] [Char] -> FunctionResponse)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool -> Text -> Map [Char] [Char] -> FunctionResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"id")
Parser
(Maybe Bool -> Text -> Map [Char] [Char] -> FunctionResponse)
-> Parser (Maybe Bool)
-> Parser (Text -> Map [Char] [Char] -> FunctionResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"willContinue")
Parser (Text -> Map [Char] [Char] -> FunctionResponse)
-> Parser Text -> Parser (Map [Char] [Char] -> FunctionResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"name")
Parser (Map [Char] [Char] -> FunctionResponse)
-> Parser (Map [Char] [Char]) -> Parser FunctionResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Map [Char] [Char])
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"response")
instance A.ToJSON FunctionResponse where
toJSON :: FunctionResponse -> Value
toJSON FunctionResponse {Maybe Bool
Maybe Text
Maybe E'Scheduling
Text
Map [Char] [Char]
functionResponseScheduling :: FunctionResponse -> Maybe E'Scheduling
functionResponseId :: FunctionResponse -> Maybe Text
functionResponseWillContinue :: FunctionResponse -> Maybe Bool
functionResponseName :: FunctionResponse -> Text
functionResponseResponse :: FunctionResponse -> Map [Char] [Char]
functionResponseScheduling :: Maybe E'Scheduling
functionResponseId :: Maybe Text
functionResponseWillContinue :: Maybe Bool
functionResponseName :: Text
functionResponseResponse :: Map [Char] [Char]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"scheduling" Key -> Maybe E'Scheduling -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'Scheduling
functionResponseScheduling
, Key
"id" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
functionResponseId
, Key
"willContinue" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
functionResponseWillContinue
, Key
"name" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
functionResponseName
, Key
"response" Key -> Map [Char] [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map [Char] [Char]
functionResponseResponse
]
mkFunctionResponse ::
Text ->
(Map.Map String String) ->
FunctionResponse
mkFunctionResponse :: Text -> Map [Char] [Char] -> FunctionResponse
mkFunctionResponse Text
functionResponseName Map [Char] [Char]
functionResponseResponse =
FunctionResponse
{ functionResponseScheduling :: Maybe E'Scheduling
functionResponseScheduling = Maybe E'Scheduling
forall a. Maybe a
Nothing
, functionResponseId :: Maybe Text
functionResponseId = Maybe Text
forall a. Maybe a
Nothing
, functionResponseWillContinue :: Maybe Bool
functionResponseWillContinue = Maybe Bool
forall a. Maybe a
Nothing
, Text
functionResponseName :: Text
functionResponseName :: Text
functionResponseName
, Map [Char] [Char]
functionResponseResponse :: Map [Char] [Char]
functionResponseResponse :: Map [Char] [Char]
functionResponseResponse
}
data GenerateAnswerRequest = GenerateAnswerRequest
{ GenerateAnswerRequest -> Maybe SemanticRetrieverConfig
generateAnswerRequestSemanticRetriever :: !(Maybe SemanticRetrieverConfig)
, GenerateAnswerRequest -> Maybe Float
generateAnswerRequestTemperature :: !(Maybe Float)
, GenerateAnswerRequest -> E'AnswerStyle
generateAnswerRequestAnswerStyle :: !(E'AnswerStyle)
, GenerateAnswerRequest -> [Content]
generateAnswerRequestContents :: !([Content])
, GenerateAnswerRequest -> Maybe [SafetySetting]
generateAnswerRequestSafetySettings :: !(Maybe [SafetySetting])
, GenerateAnswerRequest -> Maybe GroundingPassages
generateAnswerRequestInlinePassages :: !(Maybe GroundingPassages)
}
deriving (Int -> GenerateAnswerRequest -> ShowS
[GenerateAnswerRequest] -> ShowS
GenerateAnswerRequest -> [Char]
(Int -> GenerateAnswerRequest -> ShowS)
-> (GenerateAnswerRequest -> [Char])
-> ([GenerateAnswerRequest] -> ShowS)
-> Show GenerateAnswerRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateAnswerRequest -> ShowS
showsPrec :: Int -> GenerateAnswerRequest -> ShowS
$cshow :: GenerateAnswerRequest -> [Char]
show :: GenerateAnswerRequest -> [Char]
$cshowList :: [GenerateAnswerRequest] -> ShowS
showList :: [GenerateAnswerRequest] -> ShowS
P.Show, GenerateAnswerRequest -> GenerateAnswerRequest -> Bool
(GenerateAnswerRequest -> GenerateAnswerRequest -> Bool)
-> (GenerateAnswerRequest -> GenerateAnswerRequest -> Bool)
-> Eq GenerateAnswerRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateAnswerRequest -> GenerateAnswerRequest -> Bool
== :: GenerateAnswerRequest -> GenerateAnswerRequest -> Bool
$c/= :: GenerateAnswerRequest -> GenerateAnswerRequest -> Bool
/= :: GenerateAnswerRequest -> GenerateAnswerRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateAnswerRequest where
parseJSON :: Value -> Parser GenerateAnswerRequest
parseJSON = [Char]
-> (Object -> Parser GenerateAnswerRequest)
-> Value
-> Parser GenerateAnswerRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateAnswerRequest" ((Object -> Parser GenerateAnswerRequest)
-> Value -> Parser GenerateAnswerRequest)
-> (Object -> Parser GenerateAnswerRequest)
-> Value
-> Parser GenerateAnswerRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe SemanticRetrieverConfig
-> Maybe Float
-> E'AnswerStyle
-> [Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest
GenerateAnswerRequest
(Maybe SemanticRetrieverConfig
-> Maybe Float
-> E'AnswerStyle
-> [Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest)
-> Parser (Maybe SemanticRetrieverConfig)
-> Parser
(Maybe Float
-> E'AnswerStyle
-> [Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe SemanticRetrieverConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"semanticRetriever")
Parser
(Maybe Float
-> E'AnswerStyle
-> [Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest)
-> Parser (Maybe Float)
-> Parser
(E'AnswerStyle
-> [Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"temperature")
Parser
(E'AnswerStyle
-> [Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest)
-> Parser E'AnswerStyle
-> Parser
([Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser E'AnswerStyle
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"answerStyle")
Parser
([Content]
-> Maybe [SafetySetting]
-> Maybe GroundingPassages
-> GenerateAnswerRequest)
-> Parser [Content]
-> Parser
(Maybe [SafetySetting]
-> Maybe GroundingPassages -> GenerateAnswerRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser [Content]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"contents")
Parser
(Maybe [SafetySetting]
-> Maybe GroundingPassages -> GenerateAnswerRequest)
-> Parser (Maybe [SafetySetting])
-> Parser (Maybe GroundingPassages -> GenerateAnswerRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [SafetySetting])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetySettings")
Parser (Maybe GroundingPassages -> GenerateAnswerRequest)
-> Parser (Maybe GroundingPassages) -> Parser GenerateAnswerRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe GroundingPassages)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"inlinePassages")
instance A.ToJSON GenerateAnswerRequest where
toJSON :: GenerateAnswerRequest -> Value
toJSON GenerateAnswerRequest {[Content]
Maybe Float
Maybe [SafetySetting]
Maybe GroundingPassages
Maybe SemanticRetrieverConfig
E'AnswerStyle
generateAnswerRequestSemanticRetriever :: GenerateAnswerRequest -> Maybe SemanticRetrieverConfig
generateAnswerRequestTemperature :: GenerateAnswerRequest -> Maybe Float
generateAnswerRequestAnswerStyle :: GenerateAnswerRequest -> E'AnswerStyle
generateAnswerRequestContents :: GenerateAnswerRequest -> [Content]
generateAnswerRequestSafetySettings :: GenerateAnswerRequest -> Maybe [SafetySetting]
generateAnswerRequestInlinePassages :: GenerateAnswerRequest -> Maybe GroundingPassages
generateAnswerRequestSemanticRetriever :: Maybe SemanticRetrieverConfig
generateAnswerRequestTemperature :: Maybe Float
generateAnswerRequestAnswerStyle :: E'AnswerStyle
generateAnswerRequestContents :: [Content]
generateAnswerRequestSafetySettings :: Maybe [SafetySetting]
generateAnswerRequestInlinePassages :: Maybe GroundingPassages
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"semanticRetriever" Key -> Maybe SemanticRetrieverConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe SemanticRetrieverConfig
generateAnswerRequestSemanticRetriever
, Key
"temperature" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generateAnswerRequestTemperature
, Key
"answerStyle" Key -> E'AnswerStyle -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= E'AnswerStyle
generateAnswerRequestAnswerStyle
, Key
"contents" Key -> [Content] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Content]
generateAnswerRequestContents
, Key
"safetySettings" Key -> Maybe [SafetySetting] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetySetting]
generateAnswerRequestSafetySettings
, Key
"inlinePassages" Key -> Maybe GroundingPassages -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GroundingPassages
generateAnswerRequestInlinePassages
]
mkGenerateAnswerRequest ::
E'AnswerStyle ->
[Content] ->
GenerateAnswerRequest
mkGenerateAnswerRequest :: E'AnswerStyle -> [Content] -> GenerateAnswerRequest
mkGenerateAnswerRequest E'AnswerStyle
generateAnswerRequestAnswerStyle [Content]
generateAnswerRequestContents =
GenerateAnswerRequest
{ generateAnswerRequestSemanticRetriever :: Maybe SemanticRetrieverConfig
generateAnswerRequestSemanticRetriever = Maybe SemanticRetrieverConfig
forall a. Maybe a
Nothing
, generateAnswerRequestTemperature :: Maybe Float
generateAnswerRequestTemperature = Maybe Float
forall a. Maybe a
Nothing
, E'AnswerStyle
generateAnswerRequestAnswerStyle :: E'AnswerStyle
generateAnswerRequestAnswerStyle :: E'AnswerStyle
generateAnswerRequestAnswerStyle
, [Content]
generateAnswerRequestContents :: [Content]
generateAnswerRequestContents :: [Content]
generateAnswerRequestContents
, generateAnswerRequestSafetySettings :: Maybe [SafetySetting]
generateAnswerRequestSafetySettings = Maybe [SafetySetting]
forall a. Maybe a
Nothing
, generateAnswerRequestInlinePassages :: Maybe GroundingPassages
generateAnswerRequestInlinePassages = Maybe GroundingPassages
forall a. Maybe a
Nothing
}
data GenerateAnswerResponse = GenerateAnswerResponse
{ GenerateAnswerResponse -> Maybe Candidate
generateAnswerResponseAnswer :: !(Maybe Candidate)
, GenerateAnswerResponse -> Maybe InputFeedback
generateAnswerResponseInputFeedback :: !(Maybe InputFeedback)
, GenerateAnswerResponse -> Maybe Float
generateAnswerResponseAnswerableProbability :: !(Maybe Float)
}
deriving (Int -> GenerateAnswerResponse -> ShowS
[GenerateAnswerResponse] -> ShowS
GenerateAnswerResponse -> [Char]
(Int -> GenerateAnswerResponse -> ShowS)
-> (GenerateAnswerResponse -> [Char])
-> ([GenerateAnswerResponse] -> ShowS)
-> Show GenerateAnswerResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateAnswerResponse -> ShowS
showsPrec :: Int -> GenerateAnswerResponse -> ShowS
$cshow :: GenerateAnswerResponse -> [Char]
show :: GenerateAnswerResponse -> [Char]
$cshowList :: [GenerateAnswerResponse] -> ShowS
showList :: [GenerateAnswerResponse] -> ShowS
P.Show, GenerateAnswerResponse -> GenerateAnswerResponse -> Bool
(GenerateAnswerResponse -> GenerateAnswerResponse -> Bool)
-> (GenerateAnswerResponse -> GenerateAnswerResponse -> Bool)
-> Eq GenerateAnswerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateAnswerResponse -> GenerateAnswerResponse -> Bool
== :: GenerateAnswerResponse -> GenerateAnswerResponse -> Bool
$c/= :: GenerateAnswerResponse -> GenerateAnswerResponse -> Bool
/= :: GenerateAnswerResponse -> GenerateAnswerResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateAnswerResponse where
parseJSON :: Value -> Parser GenerateAnswerResponse
parseJSON = [Char]
-> (Object -> Parser GenerateAnswerResponse)
-> Value
-> Parser GenerateAnswerResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateAnswerResponse" ((Object -> Parser GenerateAnswerResponse)
-> Value -> Parser GenerateAnswerResponse)
-> (Object -> Parser GenerateAnswerResponse)
-> Value
-> Parser GenerateAnswerResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Candidate
-> Maybe InputFeedback -> Maybe Float -> GenerateAnswerResponse
GenerateAnswerResponse
(Maybe Candidate
-> Maybe InputFeedback -> Maybe Float -> GenerateAnswerResponse)
-> Parser (Maybe Candidate)
-> Parser
(Maybe InputFeedback -> Maybe Float -> GenerateAnswerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Candidate)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"answer")
Parser
(Maybe InputFeedback -> Maybe Float -> GenerateAnswerResponse)
-> Parser (Maybe InputFeedback)
-> Parser (Maybe Float -> GenerateAnswerResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe InputFeedback)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"inputFeedback")
Parser (Maybe Float -> GenerateAnswerResponse)
-> Parser (Maybe Float) -> Parser GenerateAnswerResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"answerableProbability")
instance A.ToJSON GenerateAnswerResponse where
toJSON :: GenerateAnswerResponse -> Value
toJSON GenerateAnswerResponse {Maybe Float
Maybe Candidate
Maybe InputFeedback
generateAnswerResponseAnswer :: GenerateAnswerResponse -> Maybe Candidate
generateAnswerResponseInputFeedback :: GenerateAnswerResponse -> Maybe InputFeedback
generateAnswerResponseAnswerableProbability :: GenerateAnswerResponse -> Maybe Float
generateAnswerResponseAnswer :: Maybe Candidate
generateAnswerResponseInputFeedback :: Maybe InputFeedback
generateAnswerResponseAnswerableProbability :: Maybe Float
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"answer" Key -> Maybe Candidate -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Candidate
generateAnswerResponseAnswer
, Key
"inputFeedback" Key -> Maybe InputFeedback -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe InputFeedback
generateAnswerResponseInputFeedback
, Key
"answerableProbability" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generateAnswerResponseAnswerableProbability
]
mkGenerateAnswerResponse ::
GenerateAnswerResponse
mkGenerateAnswerResponse :: GenerateAnswerResponse
mkGenerateAnswerResponse =
GenerateAnswerResponse
{ generateAnswerResponseAnswer :: Maybe Candidate
generateAnswerResponseAnswer = Maybe Candidate
forall a. Maybe a
Nothing
, generateAnswerResponseInputFeedback :: Maybe InputFeedback
generateAnswerResponseInputFeedback = Maybe InputFeedback
forall a. Maybe a
Nothing
, generateAnswerResponseAnswerableProbability :: Maybe Float
generateAnswerResponseAnswerableProbability = Maybe Float
forall a. Maybe a
Nothing
}
data GenerateContentRequest = GenerateContentRequest
{ GenerateContentRequest -> Maybe ToolConfig
generateContentRequestToolConfig :: !(Maybe ToolConfig)
, GenerateContentRequest -> Maybe [Tool]
generateContentRequestTools :: !(Maybe [Tool])
, GenerateContentRequest -> [Content]
generateContentRequestContents :: !([Content])
, GenerateContentRequest -> Maybe Content
generateContentRequestSystemInstruction :: !(Maybe Content)
, GenerateContentRequest -> Maybe Text
generateContentRequestCachedContent :: !(Maybe Text)
, GenerateContentRequest -> Maybe [SafetySetting]
generateContentRequestSafetySettings :: !(Maybe [SafetySetting])
, GenerateContentRequest -> Text
generateContentRequestModel :: !(Text)
, GenerateContentRequest -> Maybe GenerationConfig
generateContentRequestGenerationConfig :: !(Maybe GenerationConfig)
}
deriving (Int -> GenerateContentRequest -> ShowS
[GenerateContentRequest] -> ShowS
GenerateContentRequest -> [Char]
(Int -> GenerateContentRequest -> ShowS)
-> (GenerateContentRequest -> [Char])
-> ([GenerateContentRequest] -> ShowS)
-> Show GenerateContentRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateContentRequest -> ShowS
showsPrec :: Int -> GenerateContentRequest -> ShowS
$cshow :: GenerateContentRequest -> [Char]
show :: GenerateContentRequest -> [Char]
$cshowList :: [GenerateContentRequest] -> ShowS
showList :: [GenerateContentRequest] -> ShowS
P.Show, GenerateContentRequest -> GenerateContentRequest -> Bool
(GenerateContentRequest -> GenerateContentRequest -> Bool)
-> (GenerateContentRequest -> GenerateContentRequest -> Bool)
-> Eq GenerateContentRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateContentRequest -> GenerateContentRequest -> Bool
== :: GenerateContentRequest -> GenerateContentRequest -> Bool
$c/= :: GenerateContentRequest -> GenerateContentRequest -> Bool
/= :: GenerateContentRequest -> GenerateContentRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateContentRequest where
parseJSON :: Value -> Parser GenerateContentRequest
parseJSON = [Char]
-> (Object -> Parser GenerateContentRequest)
-> Value
-> Parser GenerateContentRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateContentRequest" ((Object -> Parser GenerateContentRequest)
-> Value -> Parser GenerateContentRequest)
-> (Object -> Parser GenerateContentRequest)
-> Value
-> Parser GenerateContentRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe ToolConfig
-> Maybe [Tool]
-> [Content]
-> Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest
GenerateContentRequest
(Maybe ToolConfig
-> Maybe [Tool]
-> [Content]
-> Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
-> Parser (Maybe ToolConfig)
-> Parser
(Maybe [Tool]
-> [Content]
-> Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe ToolConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"toolConfig")
Parser
(Maybe [Tool]
-> [Content]
-> Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
-> Parser (Maybe [Tool])
-> Parser
([Content]
-> Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Tool])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tools")
Parser
([Content]
-> Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
-> Parser [Content]
-> Parser
(Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser [Content]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"contents")
Parser
(Maybe Content
-> Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
-> Parser (Maybe Content)
-> Parser
(Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Content)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"systemInstruction")
Parser
(Maybe Text
-> Maybe [SafetySetting]
-> Text
-> Maybe GenerationConfig
-> GenerateContentRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe [SafetySetting]
-> Text -> Maybe GenerationConfig -> GenerateContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"cachedContent")
Parser
(Maybe [SafetySetting]
-> Text -> Maybe GenerationConfig -> GenerateContentRequest)
-> Parser (Maybe [SafetySetting])
-> Parser
(Text -> Maybe GenerationConfig -> GenerateContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [SafetySetting])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetySettings")
Parser (Text -> Maybe GenerationConfig -> GenerateContentRequest)
-> Parser Text
-> Parser (Maybe GenerationConfig -> GenerateContentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"model")
Parser (Maybe GenerationConfig -> GenerateContentRequest)
-> Parser (Maybe GenerationConfig) -> Parser GenerateContentRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe GenerationConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"generationConfig")
instance A.ToJSON GenerateContentRequest where
toJSON :: GenerateContentRequest -> Value
toJSON GenerateContentRequest {[Content]
Maybe [SafetySetting]
Maybe [Tool]
Maybe Text
Maybe Content
Maybe GenerationConfig
Maybe ToolConfig
Text
generateContentRequestToolConfig :: GenerateContentRequest -> Maybe ToolConfig
generateContentRequestTools :: GenerateContentRequest -> Maybe [Tool]
generateContentRequestContents :: GenerateContentRequest -> [Content]
generateContentRequestSystemInstruction :: GenerateContentRequest -> Maybe Content
generateContentRequestCachedContent :: GenerateContentRequest -> Maybe Text
generateContentRequestSafetySettings :: GenerateContentRequest -> Maybe [SafetySetting]
generateContentRequestModel :: GenerateContentRequest -> Text
generateContentRequestGenerationConfig :: GenerateContentRequest -> Maybe GenerationConfig
generateContentRequestToolConfig :: Maybe ToolConfig
generateContentRequestTools :: Maybe [Tool]
generateContentRequestContents :: [Content]
generateContentRequestSystemInstruction :: Maybe Content
generateContentRequestCachedContent :: Maybe Text
generateContentRequestSafetySettings :: Maybe [SafetySetting]
generateContentRequestModel :: Text
generateContentRequestGenerationConfig :: Maybe GenerationConfig
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"toolConfig" Key -> Maybe ToolConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ToolConfig
generateContentRequestToolConfig
, Key
"tools" Key -> Maybe [Tool] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Tool]
generateContentRequestTools
, Key
"contents" Key -> [Content] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Content]
generateContentRequestContents
, Key
"systemInstruction" Key -> Maybe Content -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Content
generateContentRequestSystemInstruction
, Key
"cachedContent" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
generateContentRequestCachedContent
, Key
"safetySettings" Key -> Maybe [SafetySetting] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetySetting]
generateContentRequestSafetySettings
, Key
"model" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
generateContentRequestModel
, Key
"generationConfig" Key -> Maybe GenerationConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GenerationConfig
generateContentRequestGenerationConfig
]
mkGenerateContentRequest ::
[Content] ->
Text ->
GenerateContentRequest
mkGenerateContentRequest :: [Content] -> Text -> GenerateContentRequest
mkGenerateContentRequest [Content]
generateContentRequestContents Text
generateContentRequestModel =
GenerateContentRequest
{ generateContentRequestToolConfig :: Maybe ToolConfig
generateContentRequestToolConfig = Maybe ToolConfig
forall a. Maybe a
Nothing
, generateContentRequestTools :: Maybe [Tool]
generateContentRequestTools = Maybe [Tool]
forall a. Maybe a
Nothing
, [Content]
generateContentRequestContents :: [Content]
generateContentRequestContents :: [Content]
generateContentRequestContents
, generateContentRequestSystemInstruction :: Maybe Content
generateContentRequestSystemInstruction = Maybe Content
forall a. Maybe a
Nothing
, generateContentRequestCachedContent :: Maybe Text
generateContentRequestCachedContent = Maybe Text
forall a. Maybe a
Nothing
, generateContentRequestSafetySettings :: Maybe [SafetySetting]
generateContentRequestSafetySettings = Maybe [SafetySetting]
forall a. Maybe a
Nothing
, Text
generateContentRequestModel :: Text
generateContentRequestModel :: Text
generateContentRequestModel
, generateContentRequestGenerationConfig :: Maybe GenerationConfig
generateContentRequestGenerationConfig = Maybe GenerationConfig
forall a. Maybe a
Nothing
}
data GenerateContentResponse = GenerateContentResponse
{ GenerateContentResponse -> Maybe [Candidate]
generateContentResponseCandidates :: !(Maybe [Candidate])
, GenerateContentResponse -> Maybe UsageMetadata
generateContentResponseUsageMetadata :: !(Maybe UsageMetadata)
, GenerateContentResponse -> Maybe Text
generateContentResponseModelVersion :: !(Maybe Text)
, GenerateContentResponse -> Maybe PromptFeedback
generateContentResponsePromptFeedback :: !(Maybe PromptFeedback)
, GenerateContentResponse -> Maybe Text
generateContentResponseResponseId :: !(Maybe Text)
}
deriving (Int -> GenerateContentResponse -> ShowS
[GenerateContentResponse] -> ShowS
GenerateContentResponse -> [Char]
(Int -> GenerateContentResponse -> ShowS)
-> (GenerateContentResponse -> [Char])
-> ([GenerateContentResponse] -> ShowS)
-> Show GenerateContentResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateContentResponse -> ShowS
showsPrec :: Int -> GenerateContentResponse -> ShowS
$cshow :: GenerateContentResponse -> [Char]
show :: GenerateContentResponse -> [Char]
$cshowList :: [GenerateContentResponse] -> ShowS
showList :: [GenerateContentResponse] -> ShowS
P.Show, GenerateContentResponse -> GenerateContentResponse -> Bool
(GenerateContentResponse -> GenerateContentResponse -> Bool)
-> (GenerateContentResponse -> GenerateContentResponse -> Bool)
-> Eq GenerateContentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateContentResponse -> GenerateContentResponse -> Bool
== :: GenerateContentResponse -> GenerateContentResponse -> Bool
$c/= :: GenerateContentResponse -> GenerateContentResponse -> Bool
/= :: GenerateContentResponse -> GenerateContentResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateContentResponse where
parseJSON :: Value -> Parser GenerateContentResponse
parseJSON = [Char]
-> (Object -> Parser GenerateContentResponse)
-> Value
-> Parser GenerateContentResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateContentResponse" ((Object -> Parser GenerateContentResponse)
-> Value -> Parser GenerateContentResponse)
-> (Object -> Parser GenerateContentResponse)
-> Value
-> Parser GenerateContentResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Candidate]
-> Maybe UsageMetadata
-> Maybe Text
-> Maybe PromptFeedback
-> Maybe Text
-> GenerateContentResponse
GenerateContentResponse
(Maybe [Candidate]
-> Maybe UsageMetadata
-> Maybe Text
-> Maybe PromptFeedback
-> Maybe Text
-> GenerateContentResponse)
-> Parser (Maybe [Candidate])
-> Parser
(Maybe UsageMetadata
-> Maybe Text
-> Maybe PromptFeedback
-> Maybe Text
-> GenerateContentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Candidate])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidates")
Parser
(Maybe UsageMetadata
-> Maybe Text
-> Maybe PromptFeedback
-> Maybe Text
-> GenerateContentResponse)
-> Parser (Maybe UsageMetadata)
-> Parser
(Maybe Text
-> Maybe PromptFeedback -> Maybe Text -> GenerateContentResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe UsageMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"usageMetadata")
Parser
(Maybe Text
-> Maybe PromptFeedback -> Maybe Text -> GenerateContentResponse)
-> Parser (Maybe Text)
-> Parser
(Maybe PromptFeedback -> Maybe Text -> GenerateContentResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"modelVersion")
Parser
(Maybe PromptFeedback -> Maybe Text -> GenerateContentResponse)
-> Parser (Maybe PromptFeedback)
-> Parser (Maybe Text -> GenerateContentResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe PromptFeedback)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"promptFeedback")
Parser (Maybe Text -> GenerateContentResponse)
-> Parser (Maybe Text) -> Parser GenerateContentResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"responseId")
instance A.ToJSON GenerateContentResponse where
toJSON :: GenerateContentResponse -> Value
toJSON GenerateContentResponse {Maybe [Candidate]
Maybe Text
Maybe PromptFeedback
Maybe UsageMetadata
generateContentResponseCandidates :: GenerateContentResponse -> Maybe [Candidate]
generateContentResponseUsageMetadata :: GenerateContentResponse -> Maybe UsageMetadata
generateContentResponseModelVersion :: GenerateContentResponse -> Maybe Text
generateContentResponsePromptFeedback :: GenerateContentResponse -> Maybe PromptFeedback
generateContentResponseResponseId :: GenerateContentResponse -> Maybe Text
generateContentResponseCandidates :: Maybe [Candidate]
generateContentResponseUsageMetadata :: Maybe UsageMetadata
generateContentResponseModelVersion :: Maybe Text
generateContentResponsePromptFeedback :: Maybe PromptFeedback
generateContentResponseResponseId :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"candidates" Key -> Maybe [Candidate] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Candidate]
generateContentResponseCandidates
, Key
"usageMetadata" Key -> Maybe UsageMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe UsageMetadata
generateContentResponseUsageMetadata
, Key
"modelVersion" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
generateContentResponseModelVersion
, Key
"promptFeedback" Key -> Maybe PromptFeedback -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe PromptFeedback
generateContentResponsePromptFeedback
, Key
"responseId" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
generateContentResponseResponseId
]
mkGenerateContentResponse ::
GenerateContentResponse
mkGenerateContentResponse :: GenerateContentResponse
mkGenerateContentResponse =
GenerateContentResponse
{ generateContentResponseCandidates :: Maybe [Candidate]
generateContentResponseCandidates = Maybe [Candidate]
forall a. Maybe a
Nothing
, generateContentResponseUsageMetadata :: Maybe UsageMetadata
generateContentResponseUsageMetadata = Maybe UsageMetadata
forall a. Maybe a
Nothing
, generateContentResponseModelVersion :: Maybe Text
generateContentResponseModelVersion = Maybe Text
forall a. Maybe a
Nothing
, generateContentResponsePromptFeedback :: Maybe PromptFeedback
generateContentResponsePromptFeedback = Maybe PromptFeedback
forall a. Maybe a
Nothing
, generateContentResponseResponseId :: Maybe Text
generateContentResponseResponseId = Maybe Text
forall a. Maybe a
Nothing
}
data GenerateMessageRequest = GenerateMessageRequest
{ GenerateMessageRequest -> Maybe Float
generateMessageRequestTemperature :: !(Maybe Float)
, GenerateMessageRequest -> Maybe Float
generateMessageRequestTopP :: !(Maybe Float)
, GenerateMessageRequest -> Maybe Int
generateMessageRequestCandidateCount :: !(Maybe Int)
, GenerateMessageRequest -> Maybe Int
generateMessageRequestTopK :: !(Maybe Int)
, GenerateMessageRequest -> MessagePrompt
generateMessageRequestPrompt :: !(MessagePrompt)
}
deriving (Int -> GenerateMessageRequest -> ShowS
[GenerateMessageRequest] -> ShowS
GenerateMessageRequest -> [Char]
(Int -> GenerateMessageRequest -> ShowS)
-> (GenerateMessageRequest -> [Char])
-> ([GenerateMessageRequest] -> ShowS)
-> Show GenerateMessageRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateMessageRequest -> ShowS
showsPrec :: Int -> GenerateMessageRequest -> ShowS
$cshow :: GenerateMessageRequest -> [Char]
show :: GenerateMessageRequest -> [Char]
$cshowList :: [GenerateMessageRequest] -> ShowS
showList :: [GenerateMessageRequest] -> ShowS
P.Show, GenerateMessageRequest -> GenerateMessageRequest -> Bool
(GenerateMessageRequest -> GenerateMessageRequest -> Bool)
-> (GenerateMessageRequest -> GenerateMessageRequest -> Bool)
-> Eq GenerateMessageRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateMessageRequest -> GenerateMessageRequest -> Bool
== :: GenerateMessageRequest -> GenerateMessageRequest -> Bool
$c/= :: GenerateMessageRequest -> GenerateMessageRequest -> Bool
/= :: GenerateMessageRequest -> GenerateMessageRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateMessageRequest where
parseJSON :: Value -> Parser GenerateMessageRequest
parseJSON = [Char]
-> (Object -> Parser GenerateMessageRequest)
-> Value
-> Parser GenerateMessageRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateMessageRequest" ((Object -> Parser GenerateMessageRequest)
-> Value -> Parser GenerateMessageRequest)
-> (Object -> Parser GenerateMessageRequest)
-> Value
-> Parser GenerateMessageRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> MessagePrompt
-> GenerateMessageRequest
GenerateMessageRequest
(Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> MessagePrompt
-> GenerateMessageRequest)
-> Parser (Maybe Float)
-> Parser
(Maybe Float
-> Maybe Int
-> Maybe Int
-> MessagePrompt
-> GenerateMessageRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"temperature")
Parser
(Maybe Float
-> Maybe Int
-> Maybe Int
-> MessagePrompt
-> GenerateMessageRequest)
-> Parser (Maybe Float)
-> Parser
(Maybe Int -> Maybe Int -> MessagePrompt -> GenerateMessageRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topP")
Parser
(Maybe Int -> Maybe Int -> MessagePrompt -> GenerateMessageRequest)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> MessagePrompt -> GenerateMessageRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidateCount")
Parser (Maybe Int -> MessagePrompt -> GenerateMessageRequest)
-> Parser (Maybe Int)
-> Parser (MessagePrompt -> GenerateMessageRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topK")
Parser (MessagePrompt -> GenerateMessageRequest)
-> Parser MessagePrompt -> Parser GenerateMessageRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser MessagePrompt
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"prompt")
instance A.ToJSON GenerateMessageRequest where
toJSON :: GenerateMessageRequest -> Value
toJSON GenerateMessageRequest {Maybe Float
Maybe Int
MessagePrompt
generateMessageRequestTemperature :: GenerateMessageRequest -> Maybe Float
generateMessageRequestTopP :: GenerateMessageRequest -> Maybe Float
generateMessageRequestCandidateCount :: GenerateMessageRequest -> Maybe Int
generateMessageRequestTopK :: GenerateMessageRequest -> Maybe Int
generateMessageRequestPrompt :: GenerateMessageRequest -> MessagePrompt
generateMessageRequestTemperature :: Maybe Float
generateMessageRequestTopP :: Maybe Float
generateMessageRequestCandidateCount :: Maybe Int
generateMessageRequestTopK :: Maybe Int
generateMessageRequestPrompt :: MessagePrompt
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"temperature" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generateMessageRequestTemperature
, Key
"topP" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generateMessageRequestTopP
, Key
"candidateCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generateMessageRequestCandidateCount
, Key
"topK" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generateMessageRequestTopK
, Key
"prompt" Key -> MessagePrompt -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= MessagePrompt
generateMessageRequestPrompt
]
mkGenerateMessageRequest ::
MessagePrompt ->
GenerateMessageRequest
mkGenerateMessageRequest :: MessagePrompt -> GenerateMessageRequest
mkGenerateMessageRequest MessagePrompt
generateMessageRequestPrompt =
GenerateMessageRequest
{ generateMessageRequestTemperature :: Maybe Float
generateMessageRequestTemperature = Maybe Float
forall a. Maybe a
Nothing
, generateMessageRequestTopP :: Maybe Float
generateMessageRequestTopP = Maybe Float
forall a. Maybe a
Nothing
, generateMessageRequestCandidateCount :: Maybe Int
generateMessageRequestCandidateCount = Maybe Int
forall a. Maybe a
Nothing
, generateMessageRequestTopK :: Maybe Int
generateMessageRequestTopK = Maybe Int
forall a. Maybe a
Nothing
, MessagePrompt
generateMessageRequestPrompt :: MessagePrompt
generateMessageRequestPrompt :: MessagePrompt
generateMessageRequestPrompt
}
data GenerateMessageResponse = GenerateMessageResponse
{ GenerateMessageResponse -> Maybe [Message]
generateMessageResponseCandidates :: !(Maybe [Message])
, GenerateMessageResponse -> Maybe [Message]
generateMessageResponseMessages :: !(Maybe [Message])
, GenerateMessageResponse -> Maybe [ContentFilter]
generateMessageResponseFilters :: !(Maybe [ContentFilter])
}
deriving (Int -> GenerateMessageResponse -> ShowS
[GenerateMessageResponse] -> ShowS
GenerateMessageResponse -> [Char]
(Int -> GenerateMessageResponse -> ShowS)
-> (GenerateMessageResponse -> [Char])
-> ([GenerateMessageResponse] -> ShowS)
-> Show GenerateMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateMessageResponse -> ShowS
showsPrec :: Int -> GenerateMessageResponse -> ShowS
$cshow :: GenerateMessageResponse -> [Char]
show :: GenerateMessageResponse -> [Char]
$cshowList :: [GenerateMessageResponse] -> ShowS
showList :: [GenerateMessageResponse] -> ShowS
P.Show, GenerateMessageResponse -> GenerateMessageResponse -> Bool
(GenerateMessageResponse -> GenerateMessageResponse -> Bool)
-> (GenerateMessageResponse -> GenerateMessageResponse -> Bool)
-> Eq GenerateMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateMessageResponse -> GenerateMessageResponse -> Bool
== :: GenerateMessageResponse -> GenerateMessageResponse -> Bool
$c/= :: GenerateMessageResponse -> GenerateMessageResponse -> Bool
/= :: GenerateMessageResponse -> GenerateMessageResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateMessageResponse where
parseJSON :: Value -> Parser GenerateMessageResponse
parseJSON = [Char]
-> (Object -> Parser GenerateMessageResponse)
-> Value
-> Parser GenerateMessageResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateMessageResponse" ((Object -> Parser GenerateMessageResponse)
-> Value -> Parser GenerateMessageResponse)
-> (Object -> Parser GenerateMessageResponse)
-> Value
-> Parser GenerateMessageResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Message]
-> Maybe [Message]
-> Maybe [ContentFilter]
-> GenerateMessageResponse
GenerateMessageResponse
(Maybe [Message]
-> Maybe [Message]
-> Maybe [ContentFilter]
-> GenerateMessageResponse)
-> Parser (Maybe [Message])
-> Parser
(Maybe [Message]
-> Maybe [ContentFilter] -> GenerateMessageResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Message])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidates")
Parser
(Maybe [Message]
-> Maybe [ContentFilter] -> GenerateMessageResponse)
-> Parser (Maybe [Message])
-> Parser (Maybe [ContentFilter] -> GenerateMessageResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Message])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"messages")
Parser (Maybe [ContentFilter] -> GenerateMessageResponse)
-> Parser (Maybe [ContentFilter]) -> Parser GenerateMessageResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [ContentFilter])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"filters")
instance A.ToJSON GenerateMessageResponse where
toJSON :: GenerateMessageResponse -> Value
toJSON GenerateMessageResponse {Maybe [ContentFilter]
Maybe [Message]
generateMessageResponseCandidates :: GenerateMessageResponse -> Maybe [Message]
generateMessageResponseMessages :: GenerateMessageResponse -> Maybe [Message]
generateMessageResponseFilters :: GenerateMessageResponse -> Maybe [ContentFilter]
generateMessageResponseCandidates :: Maybe [Message]
generateMessageResponseMessages :: Maybe [Message]
generateMessageResponseFilters :: Maybe [ContentFilter]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"candidates" Key -> Maybe [Message] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Message]
generateMessageResponseCandidates
, Key
"messages" Key -> Maybe [Message] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Message]
generateMessageResponseMessages
, Key
"filters" Key -> Maybe [ContentFilter] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ContentFilter]
generateMessageResponseFilters
]
mkGenerateMessageResponse ::
GenerateMessageResponse
mkGenerateMessageResponse :: GenerateMessageResponse
mkGenerateMessageResponse =
GenerateMessageResponse
{ generateMessageResponseCandidates :: Maybe [Message]
generateMessageResponseCandidates = Maybe [Message]
forall a. Maybe a
Nothing
, generateMessageResponseMessages :: Maybe [Message]
generateMessageResponseMessages = Maybe [Message]
forall a. Maybe a
Nothing
, generateMessageResponseFilters :: Maybe [ContentFilter]
generateMessageResponseFilters = Maybe [ContentFilter]
forall a. Maybe a
Nothing
}
data GenerateTextRequest = GenerateTextRequest
{ GenerateTextRequest -> Maybe [Text]
generateTextRequestStopSequences :: !(Maybe [Text])
, GenerateTextRequest -> TextPrompt
generateTextRequestPrompt :: !(TextPrompt)
, GenerateTextRequest -> Maybe Int
generateTextRequestMaxOutputTokens :: !(Maybe Int)
, GenerateTextRequest -> Maybe [SafetySetting]
generateTextRequestSafetySettings :: !(Maybe [SafetySetting])
, GenerateTextRequest -> Maybe Float
generateTextRequestTemperature :: !(Maybe Float)
, GenerateTextRequest -> Maybe Int
generateTextRequestTopK :: !(Maybe Int)
, GenerateTextRequest -> Maybe Float
generateTextRequestTopP :: !(Maybe Float)
, GenerateTextRequest -> Maybe Int
generateTextRequestCandidateCount :: !(Maybe Int)
}
deriving (Int -> GenerateTextRequest -> ShowS
[GenerateTextRequest] -> ShowS
GenerateTextRequest -> [Char]
(Int -> GenerateTextRequest -> ShowS)
-> (GenerateTextRequest -> [Char])
-> ([GenerateTextRequest] -> ShowS)
-> Show GenerateTextRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateTextRequest -> ShowS
showsPrec :: Int -> GenerateTextRequest -> ShowS
$cshow :: GenerateTextRequest -> [Char]
show :: GenerateTextRequest -> [Char]
$cshowList :: [GenerateTextRequest] -> ShowS
showList :: [GenerateTextRequest] -> ShowS
P.Show, GenerateTextRequest -> GenerateTextRequest -> Bool
(GenerateTextRequest -> GenerateTextRequest -> Bool)
-> (GenerateTextRequest -> GenerateTextRequest -> Bool)
-> Eq GenerateTextRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateTextRequest -> GenerateTextRequest -> Bool
== :: GenerateTextRequest -> GenerateTextRequest -> Bool
$c/= :: GenerateTextRequest -> GenerateTextRequest -> Bool
/= :: GenerateTextRequest -> GenerateTextRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateTextRequest where
parseJSON :: Value -> Parser GenerateTextRequest
parseJSON = [Char]
-> (Object -> Parser GenerateTextRequest)
-> Value
-> Parser GenerateTextRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateTextRequest" ((Object -> Parser GenerateTextRequest)
-> Value -> Parser GenerateTextRequest)
-> (Object -> Parser GenerateTextRequest)
-> Value
-> Parser GenerateTextRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Text]
-> TextPrompt
-> Maybe Int
-> Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest
GenerateTextRequest
(Maybe [Text]
-> TextPrompt
-> Maybe Int
-> Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest)
-> Parser (Maybe [Text])
-> Parser
(TextPrompt
-> Maybe Int
-> Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"stopSequences")
Parser
(TextPrompt
-> Maybe Int
-> Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest)
-> Parser TextPrompt
-> Parser
(Maybe Int
-> Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser TextPrompt
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"prompt")
Parser
(Maybe Int
-> Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest)
-> Parser (Maybe Int)
-> Parser
(Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxOutputTokens")
Parser
(Maybe [SafetySetting]
-> Maybe Float
-> Maybe Int
-> Maybe Float
-> Maybe Int
-> GenerateTextRequest)
-> Parser (Maybe [SafetySetting])
-> Parser
(Maybe Float
-> Maybe Int -> Maybe Float -> Maybe Int -> GenerateTextRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [SafetySetting])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetySettings")
Parser
(Maybe Float
-> Maybe Int -> Maybe Float -> Maybe Int -> GenerateTextRequest)
-> Parser (Maybe Float)
-> Parser
(Maybe Int -> Maybe Float -> Maybe Int -> GenerateTextRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"temperature")
Parser
(Maybe Int -> Maybe Float -> Maybe Int -> GenerateTextRequest)
-> Parser (Maybe Int)
-> Parser (Maybe Float -> Maybe Int -> GenerateTextRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topK")
Parser (Maybe Float -> Maybe Int -> GenerateTextRequest)
-> Parser (Maybe Float)
-> Parser (Maybe Int -> GenerateTextRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topP")
Parser (Maybe Int -> GenerateTextRequest)
-> Parser (Maybe Int) -> Parser GenerateTextRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidateCount")
instance A.ToJSON GenerateTextRequest where
toJSON :: GenerateTextRequest -> Value
toJSON GenerateTextRequest {Maybe Float
Maybe Int
Maybe [Text]
Maybe [SafetySetting]
TextPrompt
generateTextRequestStopSequences :: GenerateTextRequest -> Maybe [Text]
generateTextRequestPrompt :: GenerateTextRequest -> TextPrompt
generateTextRequestMaxOutputTokens :: GenerateTextRequest -> Maybe Int
generateTextRequestSafetySettings :: GenerateTextRequest -> Maybe [SafetySetting]
generateTextRequestTemperature :: GenerateTextRequest -> Maybe Float
generateTextRequestTopK :: GenerateTextRequest -> Maybe Int
generateTextRequestTopP :: GenerateTextRequest -> Maybe Float
generateTextRequestCandidateCount :: GenerateTextRequest -> Maybe Int
generateTextRequestStopSequences :: Maybe [Text]
generateTextRequestPrompt :: TextPrompt
generateTextRequestMaxOutputTokens :: Maybe Int
generateTextRequestSafetySettings :: Maybe [SafetySetting]
generateTextRequestTemperature :: Maybe Float
generateTextRequestTopK :: Maybe Int
generateTextRequestTopP :: Maybe Float
generateTextRequestCandidateCount :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"stopSequences" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
generateTextRequestStopSequences
, Key
"prompt" Key -> TextPrompt -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TextPrompt
generateTextRequestPrompt
, Key
"maxOutputTokens" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generateTextRequestMaxOutputTokens
, Key
"safetySettings" Key -> Maybe [SafetySetting] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetySetting]
generateTextRequestSafetySettings
, Key
"temperature" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generateTextRequestTemperature
, Key
"topK" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generateTextRequestTopK
, Key
"topP" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generateTextRequestTopP
, Key
"candidateCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generateTextRequestCandidateCount
]
mkGenerateTextRequest ::
TextPrompt ->
GenerateTextRequest
mkGenerateTextRequest :: TextPrompt -> GenerateTextRequest
mkGenerateTextRequest TextPrompt
generateTextRequestPrompt =
GenerateTextRequest
{ generateTextRequestStopSequences :: Maybe [Text]
generateTextRequestStopSequences = Maybe [Text]
forall a. Maybe a
Nothing
, TextPrompt
generateTextRequestPrompt :: TextPrompt
generateTextRequestPrompt :: TextPrompt
generateTextRequestPrompt
, generateTextRequestMaxOutputTokens :: Maybe Int
generateTextRequestMaxOutputTokens = Maybe Int
forall a. Maybe a
Nothing
, generateTextRequestSafetySettings :: Maybe [SafetySetting]
generateTextRequestSafetySettings = Maybe [SafetySetting]
forall a. Maybe a
Nothing
, generateTextRequestTemperature :: Maybe Float
generateTextRequestTemperature = Maybe Float
forall a. Maybe a
Nothing
, generateTextRequestTopK :: Maybe Int
generateTextRequestTopK = Maybe Int
forall a. Maybe a
Nothing
, generateTextRequestTopP :: Maybe Float
generateTextRequestTopP = Maybe Float
forall a. Maybe a
Nothing
, generateTextRequestCandidateCount :: Maybe Int
generateTextRequestCandidateCount = Maybe Int
forall a. Maybe a
Nothing
}
data GenerateTextResponse = GenerateTextResponse
{ GenerateTextResponse -> Maybe [SafetyFeedback]
generateTextResponseSafetyFeedback :: !(Maybe [SafetyFeedback])
, GenerateTextResponse -> Maybe [TextCompletion]
generateTextResponseCandidates :: !(Maybe [TextCompletion])
, GenerateTextResponse -> Maybe [ContentFilter]
generateTextResponseFilters :: !(Maybe [ContentFilter])
}
deriving (Int -> GenerateTextResponse -> ShowS
[GenerateTextResponse] -> ShowS
GenerateTextResponse -> [Char]
(Int -> GenerateTextResponse -> ShowS)
-> (GenerateTextResponse -> [Char])
-> ([GenerateTextResponse] -> ShowS)
-> Show GenerateTextResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateTextResponse -> ShowS
showsPrec :: Int -> GenerateTextResponse -> ShowS
$cshow :: GenerateTextResponse -> [Char]
show :: GenerateTextResponse -> [Char]
$cshowList :: [GenerateTextResponse] -> ShowS
showList :: [GenerateTextResponse] -> ShowS
P.Show, GenerateTextResponse -> GenerateTextResponse -> Bool
(GenerateTextResponse -> GenerateTextResponse -> Bool)
-> (GenerateTextResponse -> GenerateTextResponse -> Bool)
-> Eq GenerateTextResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateTextResponse -> GenerateTextResponse -> Bool
== :: GenerateTextResponse -> GenerateTextResponse -> Bool
$c/= :: GenerateTextResponse -> GenerateTextResponse -> Bool
/= :: GenerateTextResponse -> GenerateTextResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateTextResponse where
parseJSON :: Value -> Parser GenerateTextResponse
parseJSON = [Char]
-> (Object -> Parser GenerateTextResponse)
-> Value
-> Parser GenerateTextResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateTextResponse" ((Object -> Parser GenerateTextResponse)
-> Value -> Parser GenerateTextResponse)
-> (Object -> Parser GenerateTextResponse)
-> Value
-> Parser GenerateTextResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [SafetyFeedback]
-> Maybe [TextCompletion]
-> Maybe [ContentFilter]
-> GenerateTextResponse
GenerateTextResponse
(Maybe [SafetyFeedback]
-> Maybe [TextCompletion]
-> Maybe [ContentFilter]
-> GenerateTextResponse)
-> Parser (Maybe [SafetyFeedback])
-> Parser
(Maybe [TextCompletion]
-> Maybe [ContentFilter] -> GenerateTextResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [SafetyFeedback])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetyFeedback")
Parser
(Maybe [TextCompletion]
-> Maybe [ContentFilter] -> GenerateTextResponse)
-> Parser (Maybe [TextCompletion])
-> Parser (Maybe [ContentFilter] -> GenerateTextResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [TextCompletion])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidates")
Parser (Maybe [ContentFilter] -> GenerateTextResponse)
-> Parser (Maybe [ContentFilter]) -> Parser GenerateTextResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [ContentFilter])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"filters")
instance A.ToJSON GenerateTextResponse where
toJSON :: GenerateTextResponse -> Value
toJSON GenerateTextResponse {Maybe [ContentFilter]
Maybe [SafetyFeedback]
Maybe [TextCompletion]
generateTextResponseSafetyFeedback :: GenerateTextResponse -> Maybe [SafetyFeedback]
generateTextResponseCandidates :: GenerateTextResponse -> Maybe [TextCompletion]
generateTextResponseFilters :: GenerateTextResponse -> Maybe [ContentFilter]
generateTextResponseSafetyFeedback :: Maybe [SafetyFeedback]
generateTextResponseCandidates :: Maybe [TextCompletion]
generateTextResponseFilters :: Maybe [ContentFilter]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"safetyFeedback" Key -> Maybe [SafetyFeedback] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetyFeedback]
generateTextResponseSafetyFeedback
, Key
"candidates" Key -> Maybe [TextCompletion] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [TextCompletion]
generateTextResponseCandidates
, Key
"filters" Key -> Maybe [ContentFilter] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ContentFilter]
generateTextResponseFilters
]
mkGenerateTextResponse ::
GenerateTextResponse
mkGenerateTextResponse :: GenerateTextResponse
mkGenerateTextResponse =
GenerateTextResponse
{ generateTextResponseSafetyFeedback :: Maybe [SafetyFeedback]
generateTextResponseSafetyFeedback = Maybe [SafetyFeedback]
forall a. Maybe a
Nothing
, generateTextResponseCandidates :: Maybe [TextCompletion]
generateTextResponseCandidates = Maybe [TextCompletion]
forall a. Maybe a
Nothing
, generateTextResponseFilters :: Maybe [ContentFilter]
generateTextResponseFilters = Maybe [ContentFilter]
forall a. Maybe a
Nothing
}
data GenerateVideoResponse = GenerateVideoResponse
{ GenerateVideoResponse -> Maybe [Media]
generateVideoResponseGeneratedSamples :: !(Maybe [Media])
, GenerateVideoResponse -> Maybe Int
generateVideoResponseRaiMediaFilteredCount :: !(Maybe Int)
, GenerateVideoResponse -> Maybe [Text]
generateVideoResponseRaiMediaFilteredReasons :: !(Maybe [Text])
}
deriving (Int -> GenerateVideoResponse -> ShowS
[GenerateVideoResponse] -> ShowS
GenerateVideoResponse -> [Char]
(Int -> GenerateVideoResponse -> ShowS)
-> (GenerateVideoResponse -> [Char])
-> ([GenerateVideoResponse] -> ShowS)
-> Show GenerateVideoResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerateVideoResponse -> ShowS
showsPrec :: Int -> GenerateVideoResponse -> ShowS
$cshow :: GenerateVideoResponse -> [Char]
show :: GenerateVideoResponse -> [Char]
$cshowList :: [GenerateVideoResponse] -> ShowS
showList :: [GenerateVideoResponse] -> ShowS
P.Show, GenerateVideoResponse -> GenerateVideoResponse -> Bool
(GenerateVideoResponse -> GenerateVideoResponse -> Bool)
-> (GenerateVideoResponse -> GenerateVideoResponse -> Bool)
-> Eq GenerateVideoResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerateVideoResponse -> GenerateVideoResponse -> Bool
== :: GenerateVideoResponse -> GenerateVideoResponse -> Bool
$c/= :: GenerateVideoResponse -> GenerateVideoResponse -> Bool
/= :: GenerateVideoResponse -> GenerateVideoResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerateVideoResponse where
parseJSON :: Value -> Parser GenerateVideoResponse
parseJSON = [Char]
-> (Object -> Parser GenerateVideoResponse)
-> Value
-> Parser GenerateVideoResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerateVideoResponse" ((Object -> Parser GenerateVideoResponse)
-> Value -> Parser GenerateVideoResponse)
-> (Object -> Parser GenerateVideoResponse)
-> Value
-> Parser GenerateVideoResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Media] -> Maybe Int -> Maybe [Text] -> GenerateVideoResponse
GenerateVideoResponse
(Maybe [Media]
-> Maybe Int -> Maybe [Text] -> GenerateVideoResponse)
-> Parser (Maybe [Media])
-> Parser (Maybe Int -> Maybe [Text] -> GenerateVideoResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Media])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"generatedSamples")
Parser (Maybe Int -> Maybe [Text] -> GenerateVideoResponse)
-> Parser (Maybe Int)
-> Parser (Maybe [Text] -> GenerateVideoResponse)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"raiMediaFilteredCount")
Parser (Maybe [Text] -> GenerateVideoResponse)
-> Parser (Maybe [Text]) -> Parser GenerateVideoResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"raiMediaFilteredReasons")
instance A.ToJSON GenerateVideoResponse where
toJSON :: GenerateVideoResponse -> Value
toJSON GenerateVideoResponse {Maybe Int
Maybe [Text]
Maybe [Media]
generateVideoResponseGeneratedSamples :: GenerateVideoResponse -> Maybe [Media]
generateVideoResponseRaiMediaFilteredCount :: GenerateVideoResponse -> Maybe Int
generateVideoResponseRaiMediaFilteredReasons :: GenerateVideoResponse -> Maybe [Text]
generateVideoResponseGeneratedSamples :: Maybe [Media]
generateVideoResponseRaiMediaFilteredCount :: Maybe Int
generateVideoResponseRaiMediaFilteredReasons :: Maybe [Text]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"generatedSamples" Key -> Maybe [Media] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Media]
generateVideoResponseGeneratedSamples
, Key
"raiMediaFilteredCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generateVideoResponseRaiMediaFilteredCount
, Key
"raiMediaFilteredReasons" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
generateVideoResponseRaiMediaFilteredReasons
]
mkGenerateVideoResponse ::
GenerateVideoResponse
mkGenerateVideoResponse :: GenerateVideoResponse
mkGenerateVideoResponse =
GenerateVideoResponse
{ generateVideoResponseGeneratedSamples :: Maybe [Media]
generateVideoResponseGeneratedSamples = Maybe [Media]
forall a. Maybe a
Nothing
, generateVideoResponseRaiMediaFilteredCount :: Maybe Int
generateVideoResponseRaiMediaFilteredCount = Maybe Int
forall a. Maybe a
Nothing
, generateVideoResponseRaiMediaFilteredReasons :: Maybe [Text]
generateVideoResponseRaiMediaFilteredReasons = Maybe [Text]
forall a. Maybe a
Nothing
}
data GeneratedFile = GeneratedFile
{ GeneratedFile -> Maybe Status
generatedFileError :: !(Maybe Status)
, GeneratedFile -> Maybe Text
generatedFileName :: !(Maybe Text)
, GeneratedFile -> Maybe E'State2
generatedFileState :: !(Maybe E'State2)
, GeneratedFile -> Maybe Text
generatedFileMimeType :: !(Maybe Text)
}
deriving (Int -> GeneratedFile -> ShowS
[GeneratedFile] -> ShowS
GeneratedFile -> [Char]
(Int -> GeneratedFile -> ShowS)
-> (GeneratedFile -> [Char])
-> ([GeneratedFile] -> ShowS)
-> Show GeneratedFile
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GeneratedFile -> ShowS
showsPrec :: Int -> GeneratedFile -> ShowS
$cshow :: GeneratedFile -> [Char]
show :: GeneratedFile -> [Char]
$cshowList :: [GeneratedFile] -> ShowS
showList :: [GeneratedFile] -> ShowS
P.Show, GeneratedFile -> GeneratedFile -> Bool
(GeneratedFile -> GeneratedFile -> Bool)
-> (GeneratedFile -> GeneratedFile -> Bool) -> Eq GeneratedFile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GeneratedFile -> GeneratedFile -> Bool
== :: GeneratedFile -> GeneratedFile -> Bool
$c/= :: GeneratedFile -> GeneratedFile -> Bool
/= :: GeneratedFile -> GeneratedFile -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GeneratedFile where
parseJSON :: Value -> Parser GeneratedFile
parseJSON = [Char]
-> (Object -> Parser GeneratedFile)
-> Value
-> Parser GeneratedFile
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GeneratedFile" ((Object -> Parser GeneratedFile) -> Value -> Parser GeneratedFile)
-> (Object -> Parser GeneratedFile)
-> Value
-> Parser GeneratedFile
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Status
-> Maybe Text -> Maybe E'State2 -> Maybe Text -> GeneratedFile
GeneratedFile
(Maybe Status
-> Maybe Text -> Maybe E'State2 -> Maybe Text -> GeneratedFile)
-> Parser (Maybe Status)
-> Parser
(Maybe Text -> Maybe E'State2 -> Maybe Text -> GeneratedFile)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"error")
Parser
(Maybe Text -> Maybe E'State2 -> Maybe Text -> GeneratedFile)
-> Parser (Maybe Text)
-> Parser (Maybe E'State2 -> Maybe Text -> GeneratedFile)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser (Maybe E'State2 -> Maybe Text -> GeneratedFile)
-> Parser (Maybe E'State2) -> Parser (Maybe Text -> GeneratedFile)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'State2)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"state")
Parser (Maybe Text -> GeneratedFile)
-> Parser (Maybe Text) -> Parser GeneratedFile
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"mimeType")
instance A.ToJSON GeneratedFile where
toJSON :: GeneratedFile -> Value
toJSON GeneratedFile {Maybe Text
Maybe E'State2
Maybe Status
generatedFileError :: GeneratedFile -> Maybe Status
generatedFileName :: GeneratedFile -> Maybe Text
generatedFileState :: GeneratedFile -> Maybe E'State2
generatedFileMimeType :: GeneratedFile -> Maybe Text
generatedFileError :: Maybe Status
generatedFileName :: Maybe Text
generatedFileState :: Maybe E'State2
generatedFileMimeType :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"error" Key -> Maybe Status -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Status
generatedFileError
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
generatedFileName
, Key
"state" Key -> Maybe E'State2 -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'State2
generatedFileState
, Key
"mimeType" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
generatedFileMimeType
]
mkGeneratedFile ::
GeneratedFile
mkGeneratedFile :: GeneratedFile
mkGeneratedFile =
GeneratedFile
{ generatedFileError :: Maybe Status
generatedFileError = Maybe Status
forall a. Maybe a
Nothing
, generatedFileName :: Maybe Text
generatedFileName = Maybe Text
forall a. Maybe a
Nothing
, generatedFileState :: Maybe E'State2
generatedFileState = Maybe E'State2
forall a. Maybe a
Nothing
, generatedFileMimeType :: Maybe Text
generatedFileMimeType = Maybe Text
forall a. Maybe a
Nothing
}
data GenerationConfig = GenerationConfig
{ GenerationConfig -> Maybe Schema
generationConfigResponseSchema :: !(Maybe Schema)
, GenerationConfig -> Maybe ThinkingConfig
generationConfigThinkingConfig :: !(Maybe ThinkingConfig)
, GenerationConfig -> Maybe Int
generationConfigLogprobs :: !(Maybe Int)
, GenerationConfig -> Maybe E'MediaResolution
generationConfigMediaResolution :: !(Maybe E'MediaResolution)
, GenerationConfig -> Maybe [Text]
generationConfigStopSequences :: !(Maybe [Text])
, GenerationConfig -> Maybe SpeechConfig
generationConfigSpeechConfig :: !(Maybe SpeechConfig)
, GenerationConfig -> Maybe [Char]
generationConfigResponseJsonSchema :: !(Maybe String)
, GenerationConfig -> Maybe Float
generationConfigPresencePenalty :: !(Maybe Float)
, GenerationConfig -> Maybe Float
generationConfigTopP :: !(Maybe Float)
, GenerationConfig -> Maybe Float
generationConfigTemperature :: !(Maybe Float)
, GenerationConfig -> Maybe Int
generationConfigTopK :: !(Maybe Int)
, GenerationConfig -> Maybe Int
generationConfigCandidateCount :: !(Maybe Int)
, GenerationConfig -> Maybe Bool
generationConfigEnableEnhancedCivicAnswers :: !(Maybe Bool)
, GenerationConfig -> Maybe Bool
generationConfigResponseLogprobs :: !(Maybe Bool)
, GenerationConfig -> Maybe [E'ResponseModalities]
generationConfigResponseModalities :: !(Maybe [E'ResponseModalities])
, GenerationConfig -> Maybe Float
generationConfigFrequencyPenalty :: !(Maybe Float)
, GenerationConfig -> Maybe Int
generationConfigSeed :: !(Maybe Int)
, GenerationConfig -> Maybe Int
generationConfigMaxOutputTokens :: !(Maybe Int)
, GenerationConfig -> Maybe Text
generationConfigResponseMimeType :: !(Maybe Text)
}
deriving (Int -> GenerationConfig -> ShowS
[GenerationConfig] -> ShowS
GenerationConfig -> [Char]
(Int -> GenerationConfig -> ShowS)
-> (GenerationConfig -> [Char])
-> ([GenerationConfig] -> ShowS)
-> Show GenerationConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GenerationConfig -> ShowS
showsPrec :: Int -> GenerationConfig -> ShowS
$cshow :: GenerationConfig -> [Char]
show :: GenerationConfig -> [Char]
$cshowList :: [GenerationConfig] -> ShowS
showList :: [GenerationConfig] -> ShowS
P.Show, GenerationConfig -> GenerationConfig -> Bool
(GenerationConfig -> GenerationConfig -> Bool)
-> (GenerationConfig -> GenerationConfig -> Bool)
-> Eq GenerationConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GenerationConfig -> GenerationConfig -> Bool
== :: GenerationConfig -> GenerationConfig -> Bool
$c/= :: GenerationConfig -> GenerationConfig -> Bool
/= :: GenerationConfig -> GenerationConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GenerationConfig where
parseJSON :: Value -> Parser GenerationConfig
parseJSON = [Char]
-> (Object -> Parser GenerationConfig)
-> Value
-> Parser GenerationConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GenerationConfig" ((Object -> Parser GenerationConfig)
-> Value -> Parser GenerationConfig)
-> (Object -> Parser GenerationConfig)
-> Value
-> Parser GenerationConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Schema
-> Maybe ThinkingConfig
-> Maybe Int
-> Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig
GenerationConfig
(Maybe Schema
-> Maybe ThinkingConfig
-> Maybe Int
-> Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Schema)
-> Parser
(Maybe ThinkingConfig
-> Maybe Int
-> Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Schema)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"responseSchema")
Parser
(Maybe ThinkingConfig
-> Maybe Int
-> Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe ThinkingConfig)
-> Parser
(Maybe Int
-> Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe ThinkingConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"thinkingConfig")
Parser
(Maybe Int
-> Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Int)
-> Parser
(Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"logprobs")
Parser
(Maybe E'MediaResolution
-> Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe E'MediaResolution)
-> Parser
(Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'MediaResolution)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"mediaResolution")
Parser
(Maybe [Text]
-> Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe [Text])
-> Parser
(Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"stopSequences")
Parser
(Maybe SpeechConfig
-> Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe SpeechConfig)
-> Parser
(Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe SpeechConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"speechConfig")
Parser
(Maybe [Char]
-> Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe [Char])
-> Parser
(Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Char])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"responseJsonSchema")
Parser
(Maybe Float
-> Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Float)
-> Parser
(Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"presencePenalty")
Parser
(Maybe Float
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Float)
-> Parser
(Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topP")
Parser
(Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Float)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"temperature")
Parser
(Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topK")
Parser
(Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Int)
-> Parser
(Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidateCount")
Parser
(Maybe Bool
-> Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Bool)
-> Parser
(Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"enableEnhancedCivicAnswers")
Parser
(Maybe Bool
-> Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe Bool)
-> Parser
(Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"responseLogprobs")
Parser
(Maybe [E'ResponseModalities]
-> Maybe Float
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> GenerationConfig)
-> Parser (Maybe [E'ResponseModalities])
-> Parser
(Maybe Float
-> Maybe Int -> Maybe Int -> Maybe Text -> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [E'ResponseModalities])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"responseModalities")
Parser
(Maybe Float
-> Maybe Int -> Maybe Int -> Maybe Text -> GenerationConfig)
-> Parser (Maybe Float)
-> Parser
(Maybe Int -> Maybe Int -> Maybe Text -> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"frequencyPenalty")
Parser (Maybe Int -> Maybe Int -> Maybe Text -> GenerationConfig)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Text -> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"seed")
Parser (Maybe Int -> Maybe Text -> GenerationConfig)
-> Parser (Maybe Int) -> Parser (Maybe Text -> GenerationConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxOutputTokens")
Parser (Maybe Text -> GenerationConfig)
-> Parser (Maybe Text) -> Parser GenerationConfig
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"responseMimeType")
instance A.ToJSON GenerationConfig where
toJSON :: GenerationConfig -> Value
toJSON GenerationConfig {Maybe Bool
Maybe Float
Maybe Int
Maybe [Char]
Maybe [Text]
Maybe [E'ResponseModalities]
Maybe Text
Maybe E'MediaResolution
Maybe Schema
Maybe SpeechConfig
Maybe ThinkingConfig
generationConfigResponseSchema :: GenerationConfig -> Maybe Schema
generationConfigThinkingConfig :: GenerationConfig -> Maybe ThinkingConfig
generationConfigLogprobs :: GenerationConfig -> Maybe Int
generationConfigMediaResolution :: GenerationConfig -> Maybe E'MediaResolution
generationConfigStopSequences :: GenerationConfig -> Maybe [Text]
generationConfigSpeechConfig :: GenerationConfig -> Maybe SpeechConfig
generationConfigResponseJsonSchema :: GenerationConfig -> Maybe [Char]
generationConfigPresencePenalty :: GenerationConfig -> Maybe Float
generationConfigTopP :: GenerationConfig -> Maybe Float
generationConfigTemperature :: GenerationConfig -> Maybe Float
generationConfigTopK :: GenerationConfig -> Maybe Int
generationConfigCandidateCount :: GenerationConfig -> Maybe Int
generationConfigEnableEnhancedCivicAnswers :: GenerationConfig -> Maybe Bool
generationConfigResponseLogprobs :: GenerationConfig -> Maybe Bool
generationConfigResponseModalities :: GenerationConfig -> Maybe [E'ResponseModalities]
generationConfigFrequencyPenalty :: GenerationConfig -> Maybe Float
generationConfigSeed :: GenerationConfig -> Maybe Int
generationConfigMaxOutputTokens :: GenerationConfig -> Maybe Int
generationConfigResponseMimeType :: GenerationConfig -> Maybe Text
generationConfigResponseSchema :: Maybe Schema
generationConfigThinkingConfig :: Maybe ThinkingConfig
generationConfigLogprobs :: Maybe Int
generationConfigMediaResolution :: Maybe E'MediaResolution
generationConfigStopSequences :: Maybe [Text]
generationConfigSpeechConfig :: Maybe SpeechConfig
generationConfigResponseJsonSchema :: Maybe [Char]
generationConfigPresencePenalty :: Maybe Float
generationConfigTopP :: Maybe Float
generationConfigTemperature :: Maybe Float
generationConfigTopK :: Maybe Int
generationConfigCandidateCount :: Maybe Int
generationConfigEnableEnhancedCivicAnswers :: Maybe Bool
generationConfigResponseLogprobs :: Maybe Bool
generationConfigResponseModalities :: Maybe [E'ResponseModalities]
generationConfigFrequencyPenalty :: Maybe Float
generationConfigSeed :: Maybe Int
generationConfigMaxOutputTokens :: Maybe Int
generationConfigResponseMimeType :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"responseSchema" Key -> Maybe Schema -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Schema
generationConfigResponseSchema
, Key
"thinkingConfig" Key -> Maybe ThinkingConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ThinkingConfig
generationConfigThinkingConfig
, Key
"logprobs" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generationConfigLogprobs
, Key
"mediaResolution" Key -> Maybe E'MediaResolution -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'MediaResolution
generationConfigMediaResolution
, Key
"stopSequences" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
generationConfigStopSequences
, Key
"speechConfig" Key -> Maybe SpeechConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe SpeechConfig
generationConfigSpeechConfig
, Key
"responseJsonSchema" Key -> Maybe [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Char]
generationConfigResponseJsonSchema
, Key
"presencePenalty" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generationConfigPresencePenalty
, Key
"topP" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generationConfigTopP
, Key
"temperature" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generationConfigTemperature
, Key
"topK" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generationConfigTopK
, Key
"candidateCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generationConfigCandidateCount
, Key
"enableEnhancedCivicAnswers" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
generationConfigEnableEnhancedCivicAnswers
, Key
"responseLogprobs" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
generationConfigResponseLogprobs
, Key
"responseModalities" Key -> Maybe [E'ResponseModalities] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [E'ResponseModalities]
generationConfigResponseModalities
, Key
"frequencyPenalty" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
generationConfigFrequencyPenalty
, Key
"seed" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generationConfigSeed
, Key
"maxOutputTokens" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
generationConfigMaxOutputTokens
, Key
"responseMimeType" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
generationConfigResponseMimeType
]
mkGenerationConfig ::
GenerationConfig
mkGenerationConfig :: GenerationConfig
mkGenerationConfig =
GenerationConfig
{ generationConfigResponseSchema :: Maybe Schema
generationConfigResponseSchema = Maybe Schema
forall a. Maybe a
Nothing
, generationConfigThinkingConfig :: Maybe ThinkingConfig
generationConfigThinkingConfig = Maybe ThinkingConfig
forall a. Maybe a
Nothing
, generationConfigLogprobs :: Maybe Int
generationConfigLogprobs = Maybe Int
forall a. Maybe a
Nothing
, generationConfigMediaResolution :: Maybe E'MediaResolution
generationConfigMediaResolution = Maybe E'MediaResolution
forall a. Maybe a
Nothing
, generationConfigStopSequences :: Maybe [Text]
generationConfigStopSequences = Maybe [Text]
forall a. Maybe a
Nothing
, generationConfigSpeechConfig :: Maybe SpeechConfig
generationConfigSpeechConfig = Maybe SpeechConfig
forall a. Maybe a
Nothing
, generationConfigResponseJsonSchema :: Maybe [Char]
generationConfigResponseJsonSchema = Maybe [Char]
forall a. Maybe a
Nothing
, generationConfigPresencePenalty :: Maybe Float
generationConfigPresencePenalty = Maybe Float
forall a. Maybe a
Nothing
, generationConfigTopP :: Maybe Float
generationConfigTopP = Maybe Float
forall a. Maybe a
Nothing
, generationConfigTemperature :: Maybe Float
generationConfigTemperature = Maybe Float
forall a. Maybe a
Nothing
, generationConfigTopK :: Maybe Int
generationConfigTopK = Maybe Int
forall a. Maybe a
Nothing
, generationConfigCandidateCount :: Maybe Int
generationConfigCandidateCount = Maybe Int
forall a. Maybe a
Nothing
, generationConfigEnableEnhancedCivicAnswers :: Maybe Bool
generationConfigEnableEnhancedCivicAnswers = Maybe Bool
forall a. Maybe a
Nothing
, generationConfigResponseLogprobs :: Maybe Bool
generationConfigResponseLogprobs = Maybe Bool
forall a. Maybe a
Nothing
, generationConfigResponseModalities :: Maybe [E'ResponseModalities]
generationConfigResponseModalities = Maybe [E'ResponseModalities]
forall a. Maybe a
Nothing
, generationConfigFrequencyPenalty :: Maybe Float
generationConfigFrequencyPenalty = Maybe Float
forall a. Maybe a
Nothing
, generationConfigSeed :: Maybe Int
generationConfigSeed = Maybe Int
forall a. Maybe a
Nothing
, generationConfigMaxOutputTokens :: Maybe Int
generationConfigMaxOutputTokens = Maybe Int
forall a. Maybe a
Nothing
, generationConfigResponseMimeType :: Maybe Text
generationConfigResponseMimeType = Maybe Text
forall a. Maybe a
Nothing
}
data GoogleSearch = GoogleSearch
{ GoogleSearch -> Maybe Interval
googleSearchTimeRangeFilter :: !(Maybe Interval)
}
deriving (Int -> GoogleSearch -> ShowS
[GoogleSearch] -> ShowS
GoogleSearch -> [Char]
(Int -> GoogleSearch -> ShowS)
-> (GoogleSearch -> [Char])
-> ([GoogleSearch] -> ShowS)
-> Show GoogleSearch
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GoogleSearch -> ShowS
showsPrec :: Int -> GoogleSearch -> ShowS
$cshow :: GoogleSearch -> [Char]
show :: GoogleSearch -> [Char]
$cshowList :: [GoogleSearch] -> ShowS
showList :: [GoogleSearch] -> ShowS
P.Show, GoogleSearch -> GoogleSearch -> Bool
(GoogleSearch -> GoogleSearch -> Bool)
-> (GoogleSearch -> GoogleSearch -> Bool) -> Eq GoogleSearch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GoogleSearch -> GoogleSearch -> Bool
== :: GoogleSearch -> GoogleSearch -> Bool
$c/= :: GoogleSearch -> GoogleSearch -> Bool
/= :: GoogleSearch -> GoogleSearch -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GoogleSearch where
parseJSON :: Value -> Parser GoogleSearch
parseJSON = [Char]
-> (Object -> Parser GoogleSearch) -> Value -> Parser GoogleSearch
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GoogleSearch" ((Object -> Parser GoogleSearch) -> Value -> Parser GoogleSearch)
-> (Object -> Parser GoogleSearch) -> Value -> Parser GoogleSearch
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Interval -> GoogleSearch
GoogleSearch
(Maybe Interval -> GoogleSearch)
-> Parser (Maybe Interval) -> Parser GoogleSearch
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Interval)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"timeRangeFilter")
instance A.ToJSON GoogleSearch where
toJSON :: GoogleSearch -> Value
toJSON GoogleSearch {Maybe Interval
googleSearchTimeRangeFilter :: GoogleSearch -> Maybe Interval
googleSearchTimeRangeFilter :: Maybe Interval
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"timeRangeFilter" Key -> Maybe Interval -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Interval
googleSearchTimeRangeFilter
]
mkGoogleSearch ::
GoogleSearch
mkGoogleSearch :: GoogleSearch
mkGoogleSearch =
GoogleSearch
{ googleSearchTimeRangeFilter :: Maybe Interval
googleSearchTimeRangeFilter = Maybe Interval
forall a. Maybe a
Nothing
}
data GoogleSearchRetrieval = GoogleSearchRetrieval
{ GoogleSearchRetrieval -> Maybe DynamicRetrievalConfig
googleSearchRetrievalDynamicRetrievalConfig :: !(Maybe DynamicRetrievalConfig)
}
deriving (Int -> GoogleSearchRetrieval -> ShowS
[GoogleSearchRetrieval] -> ShowS
GoogleSearchRetrieval -> [Char]
(Int -> GoogleSearchRetrieval -> ShowS)
-> (GoogleSearchRetrieval -> [Char])
-> ([GoogleSearchRetrieval] -> ShowS)
-> Show GoogleSearchRetrieval
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GoogleSearchRetrieval -> ShowS
showsPrec :: Int -> GoogleSearchRetrieval -> ShowS
$cshow :: GoogleSearchRetrieval -> [Char]
show :: GoogleSearchRetrieval -> [Char]
$cshowList :: [GoogleSearchRetrieval] -> ShowS
showList :: [GoogleSearchRetrieval] -> ShowS
P.Show, GoogleSearchRetrieval -> GoogleSearchRetrieval -> Bool
(GoogleSearchRetrieval -> GoogleSearchRetrieval -> Bool)
-> (GoogleSearchRetrieval -> GoogleSearchRetrieval -> Bool)
-> Eq GoogleSearchRetrieval
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GoogleSearchRetrieval -> GoogleSearchRetrieval -> Bool
== :: GoogleSearchRetrieval -> GoogleSearchRetrieval -> Bool
$c/= :: GoogleSearchRetrieval -> GoogleSearchRetrieval -> Bool
/= :: GoogleSearchRetrieval -> GoogleSearchRetrieval -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GoogleSearchRetrieval where
parseJSON :: Value -> Parser GoogleSearchRetrieval
parseJSON = [Char]
-> (Object -> Parser GoogleSearchRetrieval)
-> Value
-> Parser GoogleSearchRetrieval
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GoogleSearchRetrieval" ((Object -> Parser GoogleSearchRetrieval)
-> Value -> Parser GoogleSearchRetrieval)
-> (Object -> Parser GoogleSearchRetrieval)
-> Value
-> Parser GoogleSearchRetrieval
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe DynamicRetrievalConfig -> GoogleSearchRetrieval
GoogleSearchRetrieval
(Maybe DynamicRetrievalConfig -> GoogleSearchRetrieval)
-> Parser (Maybe DynamicRetrievalConfig)
-> Parser GoogleSearchRetrieval
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe DynamicRetrievalConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"dynamicRetrievalConfig")
instance A.ToJSON GoogleSearchRetrieval where
toJSON :: GoogleSearchRetrieval -> Value
toJSON GoogleSearchRetrieval {Maybe DynamicRetrievalConfig
googleSearchRetrievalDynamicRetrievalConfig :: GoogleSearchRetrieval -> Maybe DynamicRetrievalConfig
googleSearchRetrievalDynamicRetrievalConfig :: Maybe DynamicRetrievalConfig
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"dynamicRetrievalConfig" Key -> Maybe DynamicRetrievalConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DynamicRetrievalConfig
googleSearchRetrievalDynamicRetrievalConfig
]
mkGoogleSearchRetrieval ::
GoogleSearchRetrieval
mkGoogleSearchRetrieval :: GoogleSearchRetrieval
mkGoogleSearchRetrieval =
GoogleSearchRetrieval
{ googleSearchRetrievalDynamicRetrievalConfig :: Maybe DynamicRetrievalConfig
googleSearchRetrievalDynamicRetrievalConfig = Maybe DynamicRetrievalConfig
forall a. Maybe a
Nothing
}
data GroundingAttribution = GroundingAttribution
{ GroundingAttribution -> Maybe AttributionSourceId
groundingAttributionSourceId :: !(Maybe AttributionSourceId)
, GroundingAttribution -> Maybe Content
groundingAttributionContent :: !(Maybe Content)
}
deriving (Int -> GroundingAttribution -> ShowS
[GroundingAttribution] -> ShowS
GroundingAttribution -> [Char]
(Int -> GroundingAttribution -> ShowS)
-> (GroundingAttribution -> [Char])
-> ([GroundingAttribution] -> ShowS)
-> Show GroundingAttribution
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GroundingAttribution -> ShowS
showsPrec :: Int -> GroundingAttribution -> ShowS
$cshow :: GroundingAttribution -> [Char]
show :: GroundingAttribution -> [Char]
$cshowList :: [GroundingAttribution] -> ShowS
showList :: [GroundingAttribution] -> ShowS
P.Show, GroundingAttribution -> GroundingAttribution -> Bool
(GroundingAttribution -> GroundingAttribution -> Bool)
-> (GroundingAttribution -> GroundingAttribution -> Bool)
-> Eq GroundingAttribution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroundingAttribution -> GroundingAttribution -> Bool
== :: GroundingAttribution -> GroundingAttribution -> Bool
$c/= :: GroundingAttribution -> GroundingAttribution -> Bool
/= :: GroundingAttribution -> GroundingAttribution -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GroundingAttribution where
parseJSON :: Value -> Parser GroundingAttribution
parseJSON = [Char]
-> (Object -> Parser GroundingAttribution)
-> Value
-> Parser GroundingAttribution
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GroundingAttribution" ((Object -> Parser GroundingAttribution)
-> Value -> Parser GroundingAttribution)
-> (Object -> Parser GroundingAttribution)
-> Value
-> Parser GroundingAttribution
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe AttributionSourceId -> Maybe Content -> GroundingAttribution
GroundingAttribution
(Maybe AttributionSourceId
-> Maybe Content -> GroundingAttribution)
-> Parser (Maybe AttributionSourceId)
-> Parser (Maybe Content -> GroundingAttribution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe AttributionSourceId)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"sourceId")
Parser (Maybe Content -> GroundingAttribution)
-> Parser (Maybe Content) -> Parser GroundingAttribution
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Content)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"content")
instance A.ToJSON GroundingAttribution where
toJSON :: GroundingAttribution -> Value
toJSON GroundingAttribution {Maybe AttributionSourceId
Maybe Content
groundingAttributionSourceId :: GroundingAttribution -> Maybe AttributionSourceId
groundingAttributionContent :: GroundingAttribution -> Maybe Content
groundingAttributionSourceId :: Maybe AttributionSourceId
groundingAttributionContent :: Maybe Content
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"sourceId" Key -> Maybe AttributionSourceId -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe AttributionSourceId
groundingAttributionSourceId
, Key
"content" Key -> Maybe Content -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Content
groundingAttributionContent
]
mkGroundingAttribution ::
GroundingAttribution
mkGroundingAttribution :: GroundingAttribution
mkGroundingAttribution =
GroundingAttribution
{ groundingAttributionSourceId :: Maybe AttributionSourceId
groundingAttributionSourceId = Maybe AttributionSourceId
forall a. Maybe a
Nothing
, groundingAttributionContent :: Maybe Content
groundingAttributionContent = Maybe Content
forall a. Maybe a
Nothing
}
data GroundingChunk = GroundingChunk
{ GroundingChunk -> Maybe Web
groundingChunkWeb :: !(Maybe Web)
}
deriving (Int -> GroundingChunk -> ShowS
[GroundingChunk] -> ShowS
GroundingChunk -> [Char]
(Int -> GroundingChunk -> ShowS)
-> (GroundingChunk -> [Char])
-> ([GroundingChunk] -> ShowS)
-> Show GroundingChunk
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GroundingChunk -> ShowS
showsPrec :: Int -> GroundingChunk -> ShowS
$cshow :: GroundingChunk -> [Char]
show :: GroundingChunk -> [Char]
$cshowList :: [GroundingChunk] -> ShowS
showList :: [GroundingChunk] -> ShowS
P.Show, GroundingChunk -> GroundingChunk -> Bool
(GroundingChunk -> GroundingChunk -> Bool)
-> (GroundingChunk -> GroundingChunk -> Bool) -> Eq GroundingChunk
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroundingChunk -> GroundingChunk -> Bool
== :: GroundingChunk -> GroundingChunk -> Bool
$c/= :: GroundingChunk -> GroundingChunk -> Bool
/= :: GroundingChunk -> GroundingChunk -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GroundingChunk where
parseJSON :: Value -> Parser GroundingChunk
parseJSON = [Char]
-> (Object -> Parser GroundingChunk)
-> Value
-> Parser GroundingChunk
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GroundingChunk" ((Object -> Parser GroundingChunk)
-> Value -> Parser GroundingChunk)
-> (Object -> Parser GroundingChunk)
-> Value
-> Parser GroundingChunk
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Web -> GroundingChunk
GroundingChunk
(Maybe Web -> GroundingChunk)
-> Parser (Maybe Web) -> Parser GroundingChunk
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Web)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"web")
instance A.ToJSON GroundingChunk where
toJSON :: GroundingChunk -> Value
toJSON GroundingChunk {Maybe Web
groundingChunkWeb :: GroundingChunk -> Maybe Web
groundingChunkWeb :: Maybe Web
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"web" Key -> Maybe Web -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Web
groundingChunkWeb
]
mkGroundingChunk ::
GroundingChunk
mkGroundingChunk :: GroundingChunk
mkGroundingChunk =
GroundingChunk
{ groundingChunkWeb :: Maybe Web
groundingChunkWeb = Maybe Web
forall a. Maybe a
Nothing
}
data GroundingMetadata = GroundingMetadata
{ GroundingMetadata -> Maybe RetrievalMetadata
groundingMetadataRetrievalMetadata :: !(Maybe RetrievalMetadata)
, GroundingMetadata -> Maybe [Text]
groundingMetadataWebSearchQueries :: !(Maybe [Text])
, GroundingMetadata -> Maybe [GroundingChunk]
groundingMetadataGroundingChunks :: !(Maybe [GroundingChunk])
, GroundingMetadata -> Maybe SearchEntryPoint
groundingMetadataSearchEntryPoint :: !(Maybe SearchEntryPoint)
, GroundingMetadata -> Maybe [GroundingSupport]
groundingMetadataGroundingSupports :: !(Maybe [GroundingSupport])
}
deriving (Int -> GroundingMetadata -> ShowS
[GroundingMetadata] -> ShowS
GroundingMetadata -> [Char]
(Int -> GroundingMetadata -> ShowS)
-> (GroundingMetadata -> [Char])
-> ([GroundingMetadata] -> ShowS)
-> Show GroundingMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GroundingMetadata -> ShowS
showsPrec :: Int -> GroundingMetadata -> ShowS
$cshow :: GroundingMetadata -> [Char]
show :: GroundingMetadata -> [Char]
$cshowList :: [GroundingMetadata] -> ShowS
showList :: [GroundingMetadata] -> ShowS
P.Show, GroundingMetadata -> GroundingMetadata -> Bool
(GroundingMetadata -> GroundingMetadata -> Bool)
-> (GroundingMetadata -> GroundingMetadata -> Bool)
-> Eq GroundingMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroundingMetadata -> GroundingMetadata -> Bool
== :: GroundingMetadata -> GroundingMetadata -> Bool
$c/= :: GroundingMetadata -> GroundingMetadata -> Bool
/= :: GroundingMetadata -> GroundingMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GroundingMetadata where
parseJSON :: Value -> Parser GroundingMetadata
parseJSON = [Char]
-> (Object -> Parser GroundingMetadata)
-> Value
-> Parser GroundingMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GroundingMetadata" ((Object -> Parser GroundingMetadata)
-> Value -> Parser GroundingMetadata)
-> (Object -> Parser GroundingMetadata)
-> Value
-> Parser GroundingMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe RetrievalMetadata
-> Maybe [Text]
-> Maybe [GroundingChunk]
-> Maybe SearchEntryPoint
-> Maybe [GroundingSupport]
-> GroundingMetadata
GroundingMetadata
(Maybe RetrievalMetadata
-> Maybe [Text]
-> Maybe [GroundingChunk]
-> Maybe SearchEntryPoint
-> Maybe [GroundingSupport]
-> GroundingMetadata)
-> Parser (Maybe RetrievalMetadata)
-> Parser
(Maybe [Text]
-> Maybe [GroundingChunk]
-> Maybe SearchEntryPoint
-> Maybe [GroundingSupport]
-> GroundingMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe RetrievalMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"retrievalMetadata")
Parser
(Maybe [Text]
-> Maybe [GroundingChunk]
-> Maybe SearchEntryPoint
-> Maybe [GroundingSupport]
-> GroundingMetadata)
-> Parser (Maybe [Text])
-> Parser
(Maybe [GroundingChunk]
-> Maybe SearchEntryPoint
-> Maybe [GroundingSupport]
-> GroundingMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"webSearchQueries")
Parser
(Maybe [GroundingChunk]
-> Maybe SearchEntryPoint
-> Maybe [GroundingSupport]
-> GroundingMetadata)
-> Parser (Maybe [GroundingChunk])
-> Parser
(Maybe SearchEntryPoint
-> Maybe [GroundingSupport] -> GroundingMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [GroundingChunk])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"groundingChunks")
Parser
(Maybe SearchEntryPoint
-> Maybe [GroundingSupport] -> GroundingMetadata)
-> Parser (Maybe SearchEntryPoint)
-> Parser (Maybe [GroundingSupport] -> GroundingMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe SearchEntryPoint)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"searchEntryPoint")
Parser (Maybe [GroundingSupport] -> GroundingMetadata)
-> Parser (Maybe [GroundingSupport]) -> Parser GroundingMetadata
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [GroundingSupport])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"groundingSupports")
instance A.ToJSON GroundingMetadata where
toJSON :: GroundingMetadata -> Value
toJSON GroundingMetadata {Maybe [Text]
Maybe [GroundingChunk]
Maybe [GroundingSupport]
Maybe RetrievalMetadata
Maybe SearchEntryPoint
groundingMetadataRetrievalMetadata :: GroundingMetadata -> Maybe RetrievalMetadata
groundingMetadataWebSearchQueries :: GroundingMetadata -> Maybe [Text]
groundingMetadataGroundingChunks :: GroundingMetadata -> Maybe [GroundingChunk]
groundingMetadataSearchEntryPoint :: GroundingMetadata -> Maybe SearchEntryPoint
groundingMetadataGroundingSupports :: GroundingMetadata -> Maybe [GroundingSupport]
groundingMetadataRetrievalMetadata :: Maybe RetrievalMetadata
groundingMetadataWebSearchQueries :: Maybe [Text]
groundingMetadataGroundingChunks :: Maybe [GroundingChunk]
groundingMetadataSearchEntryPoint :: Maybe SearchEntryPoint
groundingMetadataGroundingSupports :: Maybe [GroundingSupport]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"retrievalMetadata" Key -> Maybe RetrievalMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe RetrievalMetadata
groundingMetadataRetrievalMetadata
, Key
"webSearchQueries" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
groundingMetadataWebSearchQueries
, Key
"groundingChunks" Key -> Maybe [GroundingChunk] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [GroundingChunk]
groundingMetadataGroundingChunks
, Key
"searchEntryPoint" Key -> Maybe SearchEntryPoint -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe SearchEntryPoint
groundingMetadataSearchEntryPoint
, Key
"groundingSupports" Key -> Maybe [GroundingSupport] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [GroundingSupport]
groundingMetadataGroundingSupports
]
mkGroundingMetadata ::
GroundingMetadata
mkGroundingMetadata :: GroundingMetadata
mkGroundingMetadata =
GroundingMetadata
{ groundingMetadataRetrievalMetadata :: Maybe RetrievalMetadata
groundingMetadataRetrievalMetadata = Maybe RetrievalMetadata
forall a. Maybe a
Nothing
, groundingMetadataWebSearchQueries :: Maybe [Text]
groundingMetadataWebSearchQueries = Maybe [Text]
forall a. Maybe a
Nothing
, groundingMetadataGroundingChunks :: Maybe [GroundingChunk]
groundingMetadataGroundingChunks = Maybe [GroundingChunk]
forall a. Maybe a
Nothing
, groundingMetadataSearchEntryPoint :: Maybe SearchEntryPoint
groundingMetadataSearchEntryPoint = Maybe SearchEntryPoint
forall a. Maybe a
Nothing
, groundingMetadataGroundingSupports :: Maybe [GroundingSupport]
groundingMetadataGroundingSupports = Maybe [GroundingSupport]
forall a. Maybe a
Nothing
}
data GroundingPassage = GroundingPassage
{ GroundingPassage -> Maybe Content
groundingPassageContent :: !(Maybe Content)
, GroundingPassage -> Maybe Text
groundingPassageId :: !(Maybe Text)
}
deriving (Int -> GroundingPassage -> ShowS
[GroundingPassage] -> ShowS
GroundingPassage -> [Char]
(Int -> GroundingPassage -> ShowS)
-> (GroundingPassage -> [Char])
-> ([GroundingPassage] -> ShowS)
-> Show GroundingPassage
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GroundingPassage -> ShowS
showsPrec :: Int -> GroundingPassage -> ShowS
$cshow :: GroundingPassage -> [Char]
show :: GroundingPassage -> [Char]
$cshowList :: [GroundingPassage] -> ShowS
showList :: [GroundingPassage] -> ShowS
P.Show, GroundingPassage -> GroundingPassage -> Bool
(GroundingPassage -> GroundingPassage -> Bool)
-> (GroundingPassage -> GroundingPassage -> Bool)
-> Eq GroundingPassage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroundingPassage -> GroundingPassage -> Bool
== :: GroundingPassage -> GroundingPassage -> Bool
$c/= :: GroundingPassage -> GroundingPassage -> Bool
/= :: GroundingPassage -> GroundingPassage -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GroundingPassage where
parseJSON :: Value -> Parser GroundingPassage
parseJSON = [Char]
-> (Object -> Parser GroundingPassage)
-> Value
-> Parser GroundingPassage
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GroundingPassage" ((Object -> Parser GroundingPassage)
-> Value -> Parser GroundingPassage)
-> (Object -> Parser GroundingPassage)
-> Value
-> Parser GroundingPassage
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Content -> Maybe Text -> GroundingPassage
GroundingPassage
(Maybe Content -> Maybe Text -> GroundingPassage)
-> Parser (Maybe Content)
-> Parser (Maybe Text -> GroundingPassage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Content)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"content")
Parser (Maybe Text -> GroundingPassage)
-> Parser (Maybe Text) -> Parser GroundingPassage
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"id")
instance A.ToJSON GroundingPassage where
toJSON :: GroundingPassage -> Value
toJSON GroundingPassage {Maybe Text
Maybe Content
groundingPassageContent :: GroundingPassage -> Maybe Content
groundingPassageId :: GroundingPassage -> Maybe Text
groundingPassageContent :: Maybe Content
groundingPassageId :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"content" Key -> Maybe Content -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Content
groundingPassageContent
, Key
"id" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
groundingPassageId
]
mkGroundingPassage ::
GroundingPassage
mkGroundingPassage :: GroundingPassage
mkGroundingPassage =
GroundingPassage
{ groundingPassageContent :: Maybe Content
groundingPassageContent = Maybe Content
forall a. Maybe a
Nothing
, groundingPassageId :: Maybe Text
groundingPassageId = Maybe Text
forall a. Maybe a
Nothing
}
data GroundingPassageId = GroundingPassageId
{ GroundingPassageId -> Maybe Text
groundingPassageIdPassageId :: !(Maybe Text)
, GroundingPassageId -> Maybe Int
groundingPassageIdPartIndex :: !(Maybe Int)
}
deriving (Int -> GroundingPassageId -> ShowS
[GroundingPassageId] -> ShowS
GroundingPassageId -> [Char]
(Int -> GroundingPassageId -> ShowS)
-> (GroundingPassageId -> [Char])
-> ([GroundingPassageId] -> ShowS)
-> Show GroundingPassageId
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GroundingPassageId -> ShowS
showsPrec :: Int -> GroundingPassageId -> ShowS
$cshow :: GroundingPassageId -> [Char]
show :: GroundingPassageId -> [Char]
$cshowList :: [GroundingPassageId] -> ShowS
showList :: [GroundingPassageId] -> ShowS
P.Show, GroundingPassageId -> GroundingPassageId -> Bool
(GroundingPassageId -> GroundingPassageId -> Bool)
-> (GroundingPassageId -> GroundingPassageId -> Bool)
-> Eq GroundingPassageId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroundingPassageId -> GroundingPassageId -> Bool
== :: GroundingPassageId -> GroundingPassageId -> Bool
$c/= :: GroundingPassageId -> GroundingPassageId -> Bool
/= :: GroundingPassageId -> GroundingPassageId -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GroundingPassageId where
parseJSON :: Value -> Parser GroundingPassageId
parseJSON = [Char]
-> (Object -> Parser GroundingPassageId)
-> Value
-> Parser GroundingPassageId
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GroundingPassageId" ((Object -> Parser GroundingPassageId)
-> Value -> Parser GroundingPassageId)
-> (Object -> Parser GroundingPassageId)
-> Value
-> Parser GroundingPassageId
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe Int -> GroundingPassageId
GroundingPassageId
(Maybe Text -> Maybe Int -> GroundingPassageId)
-> Parser (Maybe Text) -> Parser (Maybe Int -> GroundingPassageId)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"passageId")
Parser (Maybe Int -> GroundingPassageId)
-> Parser (Maybe Int) -> Parser GroundingPassageId
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"partIndex")
instance A.ToJSON GroundingPassageId where
toJSON :: GroundingPassageId -> Value
toJSON GroundingPassageId {Maybe Int
Maybe Text
groundingPassageIdPassageId :: GroundingPassageId -> Maybe Text
groundingPassageIdPartIndex :: GroundingPassageId -> Maybe Int
groundingPassageIdPassageId :: Maybe Text
groundingPassageIdPartIndex :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"passageId" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
groundingPassageIdPassageId
, Key
"partIndex" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
groundingPassageIdPartIndex
]
mkGroundingPassageId ::
GroundingPassageId
mkGroundingPassageId :: GroundingPassageId
mkGroundingPassageId =
GroundingPassageId
{ groundingPassageIdPassageId :: Maybe Text
groundingPassageIdPassageId = Maybe Text
forall a. Maybe a
Nothing
, groundingPassageIdPartIndex :: Maybe Int
groundingPassageIdPartIndex = Maybe Int
forall a. Maybe a
Nothing
}
data GroundingPassages = GroundingPassages
{ GroundingPassages -> Maybe [GroundingPassage]
groundingPassagesPassages :: !(Maybe [GroundingPassage])
}
deriving (Int -> GroundingPassages -> ShowS
[GroundingPassages] -> ShowS
GroundingPassages -> [Char]
(Int -> GroundingPassages -> ShowS)
-> (GroundingPassages -> [Char])
-> ([GroundingPassages] -> ShowS)
-> Show GroundingPassages
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GroundingPassages -> ShowS
showsPrec :: Int -> GroundingPassages -> ShowS
$cshow :: GroundingPassages -> [Char]
show :: GroundingPassages -> [Char]
$cshowList :: [GroundingPassages] -> ShowS
showList :: [GroundingPassages] -> ShowS
P.Show, GroundingPassages -> GroundingPassages -> Bool
(GroundingPassages -> GroundingPassages -> Bool)
-> (GroundingPassages -> GroundingPassages -> Bool)
-> Eq GroundingPassages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroundingPassages -> GroundingPassages -> Bool
== :: GroundingPassages -> GroundingPassages -> Bool
$c/= :: GroundingPassages -> GroundingPassages -> Bool
/= :: GroundingPassages -> GroundingPassages -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GroundingPassages where
parseJSON :: Value -> Parser GroundingPassages
parseJSON = [Char]
-> (Object -> Parser GroundingPassages)
-> Value
-> Parser GroundingPassages
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GroundingPassages" ((Object -> Parser GroundingPassages)
-> Value -> Parser GroundingPassages)
-> (Object -> Parser GroundingPassages)
-> Value
-> Parser GroundingPassages
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [GroundingPassage] -> GroundingPassages
GroundingPassages
(Maybe [GroundingPassage] -> GroundingPassages)
-> Parser (Maybe [GroundingPassage]) -> Parser GroundingPassages
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [GroundingPassage])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"passages")
instance A.ToJSON GroundingPassages where
toJSON :: GroundingPassages -> Value
toJSON GroundingPassages {Maybe [GroundingPassage]
groundingPassagesPassages :: GroundingPassages -> Maybe [GroundingPassage]
groundingPassagesPassages :: Maybe [GroundingPassage]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"passages" Key -> Maybe [GroundingPassage] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [GroundingPassage]
groundingPassagesPassages
]
mkGroundingPassages ::
GroundingPassages
mkGroundingPassages :: GroundingPassages
mkGroundingPassages =
GroundingPassages
{ groundingPassagesPassages :: Maybe [GroundingPassage]
groundingPassagesPassages = Maybe [GroundingPassage]
forall a. Maybe a
Nothing
}
data GroundingSupport = GroundingSupport
{ GroundingSupport -> Maybe [Float]
groundingSupportConfidenceScores :: !(Maybe [Float])
, GroundingSupport -> Maybe [Int]
groundingSupportGroundingChunkIndices :: !(Maybe [Int])
, GroundingSupport -> Maybe Segment
groundingSupportSegment :: !(Maybe Segment)
}
deriving (Int -> GroundingSupport -> ShowS
[GroundingSupport] -> ShowS
GroundingSupport -> [Char]
(Int -> GroundingSupport -> ShowS)
-> (GroundingSupport -> [Char])
-> ([GroundingSupport] -> ShowS)
-> Show GroundingSupport
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GroundingSupport -> ShowS
showsPrec :: Int -> GroundingSupport -> ShowS
$cshow :: GroundingSupport -> [Char]
show :: GroundingSupport -> [Char]
$cshowList :: [GroundingSupport] -> ShowS
showList :: [GroundingSupport] -> ShowS
P.Show, GroundingSupport -> GroundingSupport -> Bool
(GroundingSupport -> GroundingSupport -> Bool)
-> (GroundingSupport -> GroundingSupport -> Bool)
-> Eq GroundingSupport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroundingSupport -> GroundingSupport -> Bool
== :: GroundingSupport -> GroundingSupport -> Bool
$c/= :: GroundingSupport -> GroundingSupport -> Bool
/= :: GroundingSupport -> GroundingSupport -> Bool
P.Eq, P.Typeable)
instance A.FromJSON GroundingSupport where
parseJSON :: Value -> Parser GroundingSupport
parseJSON = [Char]
-> (Object -> Parser GroundingSupport)
-> Value
-> Parser GroundingSupport
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"GroundingSupport" ((Object -> Parser GroundingSupport)
-> Value -> Parser GroundingSupport)
-> (Object -> Parser GroundingSupport)
-> Value
-> Parser GroundingSupport
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Float] -> Maybe [Int] -> Maybe Segment -> GroundingSupport
GroundingSupport
(Maybe [Float] -> Maybe [Int] -> Maybe Segment -> GroundingSupport)
-> Parser (Maybe [Float])
-> Parser (Maybe [Int] -> Maybe Segment -> GroundingSupport)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Float])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"confidenceScores")
Parser (Maybe [Int] -> Maybe Segment -> GroundingSupport)
-> Parser (Maybe [Int])
-> Parser (Maybe Segment -> GroundingSupport)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"groundingChunkIndices")
Parser (Maybe Segment -> GroundingSupport)
-> Parser (Maybe Segment) -> Parser GroundingSupport
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Segment)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"segment")
instance A.ToJSON GroundingSupport where
toJSON :: GroundingSupport -> Value
toJSON GroundingSupport {Maybe [Float]
Maybe [Int]
Maybe Segment
groundingSupportConfidenceScores :: GroundingSupport -> Maybe [Float]
groundingSupportGroundingChunkIndices :: GroundingSupport -> Maybe [Int]
groundingSupportSegment :: GroundingSupport -> Maybe Segment
groundingSupportConfidenceScores :: Maybe [Float]
groundingSupportGroundingChunkIndices :: Maybe [Int]
groundingSupportSegment :: Maybe Segment
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"confidenceScores" Key -> Maybe [Float] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Float]
groundingSupportConfidenceScores
, Key
"groundingChunkIndices" Key -> Maybe [Int] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Int]
groundingSupportGroundingChunkIndices
, Key
"segment" Key -> Maybe Segment -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Segment
groundingSupportSegment
]
mkGroundingSupport ::
GroundingSupport
mkGroundingSupport :: GroundingSupport
mkGroundingSupport =
GroundingSupport
{ groundingSupportConfidenceScores :: Maybe [Float]
groundingSupportConfidenceScores = Maybe [Float]
forall a. Maybe a
Nothing
, groundingSupportGroundingChunkIndices :: Maybe [Int]
groundingSupportGroundingChunkIndices = Maybe [Int]
forall a. Maybe a
Nothing
, groundingSupportSegment :: Maybe Segment
groundingSupportSegment = Maybe Segment
forall a. Maybe a
Nothing
}
data Hyperparameters = Hyperparameters
{ Hyperparameters -> Maybe Int
hyperparametersEpochCount :: !(Maybe Int)
, Hyperparameters -> Maybe Float
hyperparametersLearningRate :: !(Maybe Float)
, Hyperparameters -> Maybe Float
hyperparametersLearningRateMultiplier :: !(Maybe Float)
, Hyperparameters -> Maybe Int
hyperparametersBatchSize :: !(Maybe Int)
}
deriving (Int -> Hyperparameters -> ShowS
[Hyperparameters] -> ShowS
Hyperparameters -> [Char]
(Int -> Hyperparameters -> ShowS)
-> (Hyperparameters -> [Char])
-> ([Hyperparameters] -> ShowS)
-> Show Hyperparameters
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Hyperparameters -> ShowS
showsPrec :: Int -> Hyperparameters -> ShowS
$cshow :: Hyperparameters -> [Char]
show :: Hyperparameters -> [Char]
$cshowList :: [Hyperparameters] -> ShowS
showList :: [Hyperparameters] -> ShowS
P.Show, Hyperparameters -> Hyperparameters -> Bool
(Hyperparameters -> Hyperparameters -> Bool)
-> (Hyperparameters -> Hyperparameters -> Bool)
-> Eq Hyperparameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Hyperparameters -> Hyperparameters -> Bool
== :: Hyperparameters -> Hyperparameters -> Bool
$c/= :: Hyperparameters -> Hyperparameters -> Bool
/= :: Hyperparameters -> Hyperparameters -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Hyperparameters where
parseJSON :: Value -> Parser Hyperparameters
parseJSON = [Char]
-> (Object -> Parser Hyperparameters)
-> Value
-> Parser Hyperparameters
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Hyperparameters" ((Object -> Parser Hyperparameters)
-> Value -> Parser Hyperparameters)
-> (Object -> Parser Hyperparameters)
-> Value
-> Parser Hyperparameters
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int
-> Maybe Float -> Maybe Float -> Maybe Int -> Hyperparameters
Hyperparameters
(Maybe Int
-> Maybe Float -> Maybe Float -> Maybe Int -> Hyperparameters)
-> Parser (Maybe Int)
-> Parser
(Maybe Float -> Maybe Float -> Maybe Int -> Hyperparameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"epochCount")
Parser (Maybe Float -> Maybe Float -> Maybe Int -> Hyperparameters)
-> Parser (Maybe Float)
-> Parser (Maybe Float -> Maybe Int -> Hyperparameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"learningRate")
Parser (Maybe Float -> Maybe Int -> Hyperparameters)
-> Parser (Maybe Float) -> Parser (Maybe Int -> Hyperparameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"learningRateMultiplier")
Parser (Maybe Int -> Hyperparameters)
-> Parser (Maybe Int) -> Parser Hyperparameters
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"batchSize")
instance A.ToJSON Hyperparameters where
toJSON :: Hyperparameters -> Value
toJSON Hyperparameters {Maybe Float
Maybe Int
hyperparametersEpochCount :: Hyperparameters -> Maybe Int
hyperparametersLearningRate :: Hyperparameters -> Maybe Float
hyperparametersLearningRateMultiplier :: Hyperparameters -> Maybe Float
hyperparametersBatchSize :: Hyperparameters -> Maybe Int
hyperparametersEpochCount :: Maybe Int
hyperparametersLearningRate :: Maybe Float
hyperparametersLearningRateMultiplier :: Maybe Float
hyperparametersBatchSize :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"epochCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
hyperparametersEpochCount
, Key
"learningRate" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
hyperparametersLearningRate
, Key
"learningRateMultiplier" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
hyperparametersLearningRateMultiplier
, Key
"batchSize" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
hyperparametersBatchSize
]
mkHyperparameters ::
Hyperparameters
mkHyperparameters :: Hyperparameters
mkHyperparameters =
Hyperparameters
{ hyperparametersEpochCount :: Maybe Int
hyperparametersEpochCount = Maybe Int
forall a. Maybe a
Nothing
, hyperparametersLearningRate :: Maybe Float
hyperparametersLearningRate = Maybe Float
forall a. Maybe a
Nothing
, hyperparametersLearningRateMultiplier :: Maybe Float
hyperparametersLearningRateMultiplier = Maybe Float
forall a. Maybe a
Nothing
, hyperparametersBatchSize :: Maybe Int
hyperparametersBatchSize = Maybe Int
forall a. Maybe a
Nothing
}
data InputFeedback = InputFeedback
{ InputFeedback -> Maybe [SafetyRating]
inputFeedbackSafetyRatings :: !(Maybe [SafetyRating])
, InputFeedback -> Maybe E'BlockReason2
inputFeedbackBlockReason :: !(Maybe E'BlockReason2)
}
deriving (Int -> InputFeedback -> ShowS
[InputFeedback] -> ShowS
InputFeedback -> [Char]
(Int -> InputFeedback -> ShowS)
-> (InputFeedback -> [Char])
-> ([InputFeedback] -> ShowS)
-> Show InputFeedback
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InputFeedback -> ShowS
showsPrec :: Int -> InputFeedback -> ShowS
$cshow :: InputFeedback -> [Char]
show :: InputFeedback -> [Char]
$cshowList :: [InputFeedback] -> ShowS
showList :: [InputFeedback] -> ShowS
P.Show, InputFeedback -> InputFeedback -> Bool
(InputFeedback -> InputFeedback -> Bool)
-> (InputFeedback -> InputFeedback -> Bool) -> Eq InputFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InputFeedback -> InputFeedback -> Bool
== :: InputFeedback -> InputFeedback -> Bool
$c/= :: InputFeedback -> InputFeedback -> Bool
/= :: InputFeedback -> InputFeedback -> Bool
P.Eq, P.Typeable)
instance A.FromJSON InputFeedback where
parseJSON :: Value -> Parser InputFeedback
parseJSON = [Char]
-> (Object -> Parser InputFeedback)
-> Value
-> Parser InputFeedback
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"InputFeedback" ((Object -> Parser InputFeedback) -> Value -> Parser InputFeedback)
-> (Object -> Parser InputFeedback)
-> Value
-> Parser InputFeedback
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [SafetyRating] -> Maybe E'BlockReason2 -> InputFeedback
InputFeedback
(Maybe [SafetyRating] -> Maybe E'BlockReason2 -> InputFeedback)
-> Parser (Maybe [SafetyRating])
-> Parser (Maybe E'BlockReason2 -> InputFeedback)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [SafetyRating])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetyRatings")
Parser (Maybe E'BlockReason2 -> InputFeedback)
-> Parser (Maybe E'BlockReason2) -> Parser InputFeedback
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'BlockReason2)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"blockReason")
instance A.ToJSON InputFeedback where
toJSON :: InputFeedback -> Value
toJSON InputFeedback {Maybe [SafetyRating]
Maybe E'BlockReason2
inputFeedbackSafetyRatings :: InputFeedback -> Maybe [SafetyRating]
inputFeedbackBlockReason :: InputFeedback -> Maybe E'BlockReason2
inputFeedbackSafetyRatings :: Maybe [SafetyRating]
inputFeedbackBlockReason :: Maybe E'BlockReason2
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"safetyRatings" Key -> Maybe [SafetyRating] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetyRating]
inputFeedbackSafetyRatings
, Key
"blockReason" Key -> Maybe E'BlockReason2 -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'BlockReason2
inputFeedbackBlockReason
]
mkInputFeedback ::
InputFeedback
mkInputFeedback :: InputFeedback
mkInputFeedback =
InputFeedback
{ inputFeedbackSafetyRatings :: Maybe [SafetyRating]
inputFeedbackSafetyRatings = Maybe [SafetyRating]
forall a. Maybe a
Nothing
, inputFeedbackBlockReason :: Maybe E'BlockReason2
inputFeedbackBlockReason = Maybe E'BlockReason2
forall a. Maybe a
Nothing
}
data Interval = Interval
{ Interval -> Maybe DateTime
intervalStartTime :: !(Maybe DateTime)
, Interval -> Maybe DateTime
intervalEndTime :: !(Maybe DateTime)
}
deriving (Int -> Interval -> ShowS
[Interval] -> ShowS
Interval -> [Char]
(Int -> Interval -> ShowS)
-> (Interval -> [Char]) -> ([Interval] -> ShowS) -> Show Interval
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Interval -> ShowS
showsPrec :: Int -> Interval -> ShowS
$cshow :: Interval -> [Char]
show :: Interval -> [Char]
$cshowList :: [Interval] -> ShowS
showList :: [Interval] -> ShowS
P.Show, Interval -> Interval -> Bool
(Interval -> Interval -> Bool)
-> (Interval -> Interval -> Bool) -> Eq Interval
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Interval -> Interval -> Bool
== :: Interval -> Interval -> Bool
$c/= :: Interval -> Interval -> Bool
/= :: Interval -> Interval -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Interval where
parseJSON :: Value -> Parser Interval
parseJSON = [Char] -> (Object -> Parser Interval) -> Value -> Parser Interval
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Interval" ((Object -> Parser Interval) -> Value -> Parser Interval)
-> (Object -> Parser Interval) -> Value -> Parser Interval
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe DateTime -> Maybe DateTime -> Interval
Interval
(Maybe DateTime -> Maybe DateTime -> Interval)
-> Parser (Maybe DateTime) -> Parser (Maybe DateTime -> Interval)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"startTime")
Parser (Maybe DateTime -> Interval)
-> Parser (Maybe DateTime) -> Parser Interval
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"endTime")
instance A.ToJSON Interval where
toJSON :: Interval -> Value
toJSON Interval {Maybe DateTime
intervalStartTime :: Interval -> Maybe DateTime
intervalEndTime :: Interval -> Maybe DateTime
intervalStartTime :: Maybe DateTime
intervalEndTime :: Maybe DateTime
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"startTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
intervalStartTime
, Key
"endTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
intervalEndTime
]
mkInterval ::
Interval
mkInterval :: Interval
mkInterval =
Interval
{ intervalStartTime :: Maybe DateTime
intervalStartTime = Maybe DateTime
forall a. Maybe a
Nothing
, intervalEndTime :: Maybe DateTime
intervalEndTime = Maybe DateTime
forall a. Maybe a
Nothing
}
data ListCachedContentsResponse = ListCachedContentsResponse
{ ListCachedContentsResponse -> Maybe Text
listCachedContentsResponseNextPageToken :: !(Maybe Text)
, ListCachedContentsResponse -> Maybe [CachedContent]
listCachedContentsResponseCachedContents :: !(Maybe [CachedContent])
}
deriving (Int -> ListCachedContentsResponse -> ShowS
[ListCachedContentsResponse] -> ShowS
ListCachedContentsResponse -> [Char]
(Int -> ListCachedContentsResponse -> ShowS)
-> (ListCachedContentsResponse -> [Char])
-> ([ListCachedContentsResponse] -> ShowS)
-> Show ListCachedContentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListCachedContentsResponse -> ShowS
showsPrec :: Int -> ListCachedContentsResponse -> ShowS
$cshow :: ListCachedContentsResponse -> [Char]
show :: ListCachedContentsResponse -> [Char]
$cshowList :: [ListCachedContentsResponse] -> ShowS
showList :: [ListCachedContentsResponse] -> ShowS
P.Show, ListCachedContentsResponse -> ListCachedContentsResponse -> Bool
(ListCachedContentsResponse -> ListCachedContentsResponse -> Bool)
-> (ListCachedContentsResponse
-> ListCachedContentsResponse -> Bool)
-> Eq ListCachedContentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListCachedContentsResponse -> ListCachedContentsResponse -> Bool
== :: ListCachedContentsResponse -> ListCachedContentsResponse -> Bool
$c/= :: ListCachedContentsResponse -> ListCachedContentsResponse -> Bool
/= :: ListCachedContentsResponse -> ListCachedContentsResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListCachedContentsResponse where
parseJSON :: Value -> Parser ListCachedContentsResponse
parseJSON = [Char]
-> (Object -> Parser ListCachedContentsResponse)
-> Value
-> Parser ListCachedContentsResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListCachedContentsResponse" ((Object -> Parser ListCachedContentsResponse)
-> Value -> Parser ListCachedContentsResponse)
-> (Object -> Parser ListCachedContentsResponse)
-> Value
-> Parser ListCachedContentsResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe [CachedContent] -> ListCachedContentsResponse
ListCachedContentsResponse
(Maybe Text -> Maybe [CachedContent] -> ListCachedContentsResponse)
-> Parser (Maybe Text)
-> Parser (Maybe [CachedContent] -> ListCachedContentsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
Parser (Maybe [CachedContent] -> ListCachedContentsResponse)
-> Parser (Maybe [CachedContent])
-> Parser ListCachedContentsResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [CachedContent])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"cachedContents")
instance A.ToJSON ListCachedContentsResponse where
toJSON :: ListCachedContentsResponse -> Value
toJSON ListCachedContentsResponse {Maybe [CachedContent]
Maybe Text
listCachedContentsResponseNextPageToken :: ListCachedContentsResponse -> Maybe Text
listCachedContentsResponseCachedContents :: ListCachedContentsResponse -> Maybe [CachedContent]
listCachedContentsResponseNextPageToken :: Maybe Text
listCachedContentsResponseCachedContents :: Maybe [CachedContent]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listCachedContentsResponseNextPageToken
, Key
"cachedContents" Key -> Maybe [CachedContent] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [CachedContent]
listCachedContentsResponseCachedContents
]
mkListCachedContentsResponse ::
ListCachedContentsResponse
mkListCachedContentsResponse :: ListCachedContentsResponse
mkListCachedContentsResponse =
ListCachedContentsResponse
{ listCachedContentsResponseNextPageToken :: Maybe Text
listCachedContentsResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
, listCachedContentsResponseCachedContents :: Maybe [CachedContent]
listCachedContentsResponseCachedContents = Maybe [CachedContent]
forall a. Maybe a
Nothing
}
data ListChunksResponse = ListChunksResponse
{ ListChunksResponse -> Maybe Text
listChunksResponseNextPageToken :: !(Maybe Text)
, ListChunksResponse -> Maybe [Chunk]
listChunksResponseChunks :: !(Maybe [Chunk])
}
deriving (Int -> ListChunksResponse -> ShowS
[ListChunksResponse] -> ShowS
ListChunksResponse -> [Char]
(Int -> ListChunksResponse -> ShowS)
-> (ListChunksResponse -> [Char])
-> ([ListChunksResponse] -> ShowS)
-> Show ListChunksResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListChunksResponse -> ShowS
showsPrec :: Int -> ListChunksResponse -> ShowS
$cshow :: ListChunksResponse -> [Char]
show :: ListChunksResponse -> [Char]
$cshowList :: [ListChunksResponse] -> ShowS
showList :: [ListChunksResponse] -> ShowS
P.Show, ListChunksResponse -> ListChunksResponse -> Bool
(ListChunksResponse -> ListChunksResponse -> Bool)
-> (ListChunksResponse -> ListChunksResponse -> Bool)
-> Eq ListChunksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListChunksResponse -> ListChunksResponse -> Bool
== :: ListChunksResponse -> ListChunksResponse -> Bool
$c/= :: ListChunksResponse -> ListChunksResponse -> Bool
/= :: ListChunksResponse -> ListChunksResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListChunksResponse where
parseJSON :: Value -> Parser ListChunksResponse
parseJSON = [Char]
-> (Object -> Parser ListChunksResponse)
-> Value
-> Parser ListChunksResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListChunksResponse" ((Object -> Parser ListChunksResponse)
-> Value -> Parser ListChunksResponse)
-> (Object -> Parser ListChunksResponse)
-> Value
-> Parser ListChunksResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe [Chunk] -> ListChunksResponse
ListChunksResponse
(Maybe Text -> Maybe [Chunk] -> ListChunksResponse)
-> Parser (Maybe Text)
-> Parser (Maybe [Chunk] -> ListChunksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
Parser (Maybe [Chunk] -> ListChunksResponse)
-> Parser (Maybe [Chunk]) -> Parser ListChunksResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Chunk])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"chunks")
instance A.ToJSON ListChunksResponse where
toJSON :: ListChunksResponse -> Value
toJSON ListChunksResponse {Maybe [Chunk]
Maybe Text
listChunksResponseNextPageToken :: ListChunksResponse -> Maybe Text
listChunksResponseChunks :: ListChunksResponse -> Maybe [Chunk]
listChunksResponseNextPageToken :: Maybe Text
listChunksResponseChunks :: Maybe [Chunk]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listChunksResponseNextPageToken
, Key
"chunks" Key -> Maybe [Chunk] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Chunk]
listChunksResponseChunks
]
mkListChunksResponse ::
ListChunksResponse
mkListChunksResponse :: ListChunksResponse
mkListChunksResponse =
ListChunksResponse
{ listChunksResponseNextPageToken :: Maybe Text
listChunksResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
, listChunksResponseChunks :: Maybe [Chunk]
listChunksResponseChunks = Maybe [Chunk]
forall a. Maybe a
Nothing
}
data ListCorporaResponse = ListCorporaResponse
{ ListCorporaResponse -> Maybe [Corpus]
listCorporaResponseCorpora :: !(Maybe [Corpus])
, ListCorporaResponse -> Maybe Text
listCorporaResponseNextPageToken :: !(Maybe Text)
}
deriving (Int -> ListCorporaResponse -> ShowS
[ListCorporaResponse] -> ShowS
ListCorporaResponse -> [Char]
(Int -> ListCorporaResponse -> ShowS)
-> (ListCorporaResponse -> [Char])
-> ([ListCorporaResponse] -> ShowS)
-> Show ListCorporaResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListCorporaResponse -> ShowS
showsPrec :: Int -> ListCorporaResponse -> ShowS
$cshow :: ListCorporaResponse -> [Char]
show :: ListCorporaResponse -> [Char]
$cshowList :: [ListCorporaResponse] -> ShowS
showList :: [ListCorporaResponse] -> ShowS
P.Show, ListCorporaResponse -> ListCorporaResponse -> Bool
(ListCorporaResponse -> ListCorporaResponse -> Bool)
-> (ListCorporaResponse -> ListCorporaResponse -> Bool)
-> Eq ListCorporaResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListCorporaResponse -> ListCorporaResponse -> Bool
== :: ListCorporaResponse -> ListCorporaResponse -> Bool
$c/= :: ListCorporaResponse -> ListCorporaResponse -> Bool
/= :: ListCorporaResponse -> ListCorporaResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListCorporaResponse where
parseJSON :: Value -> Parser ListCorporaResponse
parseJSON = [Char]
-> (Object -> Parser ListCorporaResponse)
-> Value
-> Parser ListCorporaResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListCorporaResponse" ((Object -> Parser ListCorporaResponse)
-> Value -> Parser ListCorporaResponse)
-> (Object -> Parser ListCorporaResponse)
-> Value
-> Parser ListCorporaResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Corpus] -> Maybe Text -> ListCorporaResponse
ListCorporaResponse
(Maybe [Corpus] -> Maybe Text -> ListCorporaResponse)
-> Parser (Maybe [Corpus])
-> Parser (Maybe Text -> ListCorporaResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Corpus])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"corpora")
Parser (Maybe Text -> ListCorporaResponse)
-> Parser (Maybe Text) -> Parser ListCorporaResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
instance A.ToJSON ListCorporaResponse where
toJSON :: ListCorporaResponse -> Value
toJSON ListCorporaResponse {Maybe [Corpus]
Maybe Text
listCorporaResponseCorpora :: ListCorporaResponse -> Maybe [Corpus]
listCorporaResponseNextPageToken :: ListCorporaResponse -> Maybe Text
listCorporaResponseCorpora :: Maybe [Corpus]
listCorporaResponseNextPageToken :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"corpora" Key -> Maybe [Corpus] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Corpus]
listCorporaResponseCorpora
, Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listCorporaResponseNextPageToken
]
mkListCorporaResponse ::
ListCorporaResponse
mkListCorporaResponse :: ListCorporaResponse
mkListCorporaResponse =
ListCorporaResponse
{ listCorporaResponseCorpora :: Maybe [Corpus]
listCorporaResponseCorpora = Maybe [Corpus]
forall a. Maybe a
Nothing
, listCorporaResponseNextPageToken :: Maybe Text
listCorporaResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
}
data ListDocumentsResponse = ListDocumentsResponse
{ ListDocumentsResponse -> Maybe Text
listDocumentsResponseNextPageToken :: !(Maybe Text)
, ListDocumentsResponse -> Maybe [Document]
listDocumentsResponseDocuments :: !(Maybe [Document])
}
deriving (Int -> ListDocumentsResponse -> ShowS
[ListDocumentsResponse] -> ShowS
ListDocumentsResponse -> [Char]
(Int -> ListDocumentsResponse -> ShowS)
-> (ListDocumentsResponse -> [Char])
-> ([ListDocumentsResponse] -> ShowS)
-> Show ListDocumentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListDocumentsResponse -> ShowS
showsPrec :: Int -> ListDocumentsResponse -> ShowS
$cshow :: ListDocumentsResponse -> [Char]
show :: ListDocumentsResponse -> [Char]
$cshowList :: [ListDocumentsResponse] -> ShowS
showList :: [ListDocumentsResponse] -> ShowS
P.Show, ListDocumentsResponse -> ListDocumentsResponse -> Bool
(ListDocumentsResponse -> ListDocumentsResponse -> Bool)
-> (ListDocumentsResponse -> ListDocumentsResponse -> Bool)
-> Eq ListDocumentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
== :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
$c/= :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
/= :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListDocumentsResponse where
parseJSON :: Value -> Parser ListDocumentsResponse
parseJSON = [Char]
-> (Object -> Parser ListDocumentsResponse)
-> Value
-> Parser ListDocumentsResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListDocumentsResponse" ((Object -> Parser ListDocumentsResponse)
-> Value -> Parser ListDocumentsResponse)
-> (Object -> Parser ListDocumentsResponse)
-> Value
-> Parser ListDocumentsResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe [Document] -> ListDocumentsResponse
ListDocumentsResponse
(Maybe Text -> Maybe [Document] -> ListDocumentsResponse)
-> Parser (Maybe Text)
-> Parser (Maybe [Document] -> ListDocumentsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
Parser (Maybe [Document] -> ListDocumentsResponse)
-> Parser (Maybe [Document]) -> Parser ListDocumentsResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Document])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"documents")
instance A.ToJSON ListDocumentsResponse where
toJSON :: ListDocumentsResponse -> Value
toJSON ListDocumentsResponse {Maybe [Document]
Maybe Text
listDocumentsResponseNextPageToken :: ListDocumentsResponse -> Maybe Text
listDocumentsResponseDocuments :: ListDocumentsResponse -> Maybe [Document]
listDocumentsResponseNextPageToken :: Maybe Text
listDocumentsResponseDocuments :: Maybe [Document]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listDocumentsResponseNextPageToken
, Key
"documents" Key -> Maybe [Document] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Document]
listDocumentsResponseDocuments
]
mkListDocumentsResponse ::
ListDocumentsResponse
mkListDocumentsResponse :: ListDocumentsResponse
mkListDocumentsResponse =
ListDocumentsResponse
{ listDocumentsResponseNextPageToken :: Maybe Text
listDocumentsResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
, listDocumentsResponseDocuments :: Maybe [Document]
listDocumentsResponseDocuments = Maybe [Document]
forall a. Maybe a
Nothing
}
data ListFilesResponse = ListFilesResponse
{ ListFilesResponse -> Maybe Text
listFilesResponseNextPageToken :: !(Maybe Text)
, ListFilesResponse -> Maybe [File]
listFilesResponseFiles :: !(Maybe [File])
}
deriving (Int -> ListFilesResponse -> ShowS
[ListFilesResponse] -> ShowS
ListFilesResponse -> [Char]
(Int -> ListFilesResponse -> ShowS)
-> (ListFilesResponse -> [Char])
-> ([ListFilesResponse] -> ShowS)
-> Show ListFilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListFilesResponse -> ShowS
showsPrec :: Int -> ListFilesResponse -> ShowS
$cshow :: ListFilesResponse -> [Char]
show :: ListFilesResponse -> [Char]
$cshowList :: [ListFilesResponse] -> ShowS
showList :: [ListFilesResponse] -> ShowS
P.Show, ListFilesResponse -> ListFilesResponse -> Bool
(ListFilesResponse -> ListFilesResponse -> Bool)
-> (ListFilesResponse -> ListFilesResponse -> Bool)
-> Eq ListFilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListFilesResponse -> ListFilesResponse -> Bool
== :: ListFilesResponse -> ListFilesResponse -> Bool
$c/= :: ListFilesResponse -> ListFilesResponse -> Bool
/= :: ListFilesResponse -> ListFilesResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListFilesResponse where
parseJSON :: Value -> Parser ListFilesResponse
parseJSON = [Char]
-> (Object -> Parser ListFilesResponse)
-> Value
-> Parser ListFilesResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListFilesResponse" ((Object -> Parser ListFilesResponse)
-> Value -> Parser ListFilesResponse)
-> (Object -> Parser ListFilesResponse)
-> Value
-> Parser ListFilesResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe [File] -> ListFilesResponse
ListFilesResponse
(Maybe Text -> Maybe [File] -> ListFilesResponse)
-> Parser (Maybe Text)
-> Parser (Maybe [File] -> ListFilesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
Parser (Maybe [File] -> ListFilesResponse)
-> Parser (Maybe [File]) -> Parser ListFilesResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [File])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"files")
instance A.ToJSON ListFilesResponse where
toJSON :: ListFilesResponse -> Value
toJSON ListFilesResponse {Maybe [File]
Maybe Text
listFilesResponseNextPageToken :: ListFilesResponse -> Maybe Text
listFilesResponseFiles :: ListFilesResponse -> Maybe [File]
listFilesResponseNextPageToken :: Maybe Text
listFilesResponseFiles :: Maybe [File]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listFilesResponseNextPageToken
, Key
"files" Key -> Maybe [File] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [File]
listFilesResponseFiles
]
mkListFilesResponse ::
ListFilesResponse
mkListFilesResponse :: ListFilesResponse
mkListFilesResponse =
ListFilesResponse
{ listFilesResponseNextPageToken :: Maybe Text
listFilesResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
, listFilesResponseFiles :: Maybe [File]
listFilesResponseFiles = Maybe [File]
forall a. Maybe a
Nothing
}
data ListGeneratedFilesResponse = ListGeneratedFilesResponse
{ ListGeneratedFilesResponse -> Maybe Text
listGeneratedFilesResponseNextPageToken :: !(Maybe Text)
, ListGeneratedFilesResponse -> Maybe [GeneratedFile]
listGeneratedFilesResponseGeneratedFiles :: !(Maybe [GeneratedFile])
}
deriving (Int -> ListGeneratedFilesResponse -> ShowS
[ListGeneratedFilesResponse] -> ShowS
ListGeneratedFilesResponse -> [Char]
(Int -> ListGeneratedFilesResponse -> ShowS)
-> (ListGeneratedFilesResponse -> [Char])
-> ([ListGeneratedFilesResponse] -> ShowS)
-> Show ListGeneratedFilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListGeneratedFilesResponse -> ShowS
showsPrec :: Int -> ListGeneratedFilesResponse -> ShowS
$cshow :: ListGeneratedFilesResponse -> [Char]
show :: ListGeneratedFilesResponse -> [Char]
$cshowList :: [ListGeneratedFilesResponse] -> ShowS
showList :: [ListGeneratedFilesResponse] -> ShowS
P.Show, ListGeneratedFilesResponse -> ListGeneratedFilesResponse -> Bool
(ListGeneratedFilesResponse -> ListGeneratedFilesResponse -> Bool)
-> (ListGeneratedFilesResponse
-> ListGeneratedFilesResponse -> Bool)
-> Eq ListGeneratedFilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListGeneratedFilesResponse -> ListGeneratedFilesResponse -> Bool
== :: ListGeneratedFilesResponse -> ListGeneratedFilesResponse -> Bool
$c/= :: ListGeneratedFilesResponse -> ListGeneratedFilesResponse -> Bool
/= :: ListGeneratedFilesResponse -> ListGeneratedFilesResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListGeneratedFilesResponse where
parseJSON :: Value -> Parser ListGeneratedFilesResponse
parseJSON = [Char]
-> (Object -> Parser ListGeneratedFilesResponse)
-> Value
-> Parser ListGeneratedFilesResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListGeneratedFilesResponse" ((Object -> Parser ListGeneratedFilesResponse)
-> Value -> Parser ListGeneratedFilesResponse)
-> (Object -> Parser ListGeneratedFilesResponse)
-> Value
-> Parser ListGeneratedFilesResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe [GeneratedFile] -> ListGeneratedFilesResponse
ListGeneratedFilesResponse
(Maybe Text -> Maybe [GeneratedFile] -> ListGeneratedFilesResponse)
-> Parser (Maybe Text)
-> Parser (Maybe [GeneratedFile] -> ListGeneratedFilesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
Parser (Maybe [GeneratedFile] -> ListGeneratedFilesResponse)
-> Parser (Maybe [GeneratedFile])
-> Parser ListGeneratedFilesResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [GeneratedFile])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"generatedFiles")
instance A.ToJSON ListGeneratedFilesResponse where
toJSON :: ListGeneratedFilesResponse -> Value
toJSON ListGeneratedFilesResponse {Maybe [GeneratedFile]
Maybe Text
listGeneratedFilesResponseNextPageToken :: ListGeneratedFilesResponse -> Maybe Text
listGeneratedFilesResponseGeneratedFiles :: ListGeneratedFilesResponse -> Maybe [GeneratedFile]
listGeneratedFilesResponseNextPageToken :: Maybe Text
listGeneratedFilesResponseGeneratedFiles :: Maybe [GeneratedFile]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listGeneratedFilesResponseNextPageToken
, Key
"generatedFiles" Key -> Maybe [GeneratedFile] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [GeneratedFile]
listGeneratedFilesResponseGeneratedFiles
]
mkListGeneratedFilesResponse ::
ListGeneratedFilesResponse
mkListGeneratedFilesResponse :: ListGeneratedFilesResponse
mkListGeneratedFilesResponse =
ListGeneratedFilesResponse
{ listGeneratedFilesResponseNextPageToken :: Maybe Text
listGeneratedFilesResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
, listGeneratedFilesResponseGeneratedFiles :: Maybe [GeneratedFile]
listGeneratedFilesResponseGeneratedFiles = Maybe [GeneratedFile]
forall a. Maybe a
Nothing
}
data ListModelsResponse = ListModelsResponse
{ ListModelsResponse -> Maybe [Model]
listModelsResponseModels :: !(Maybe [Model])
, ListModelsResponse -> Maybe Text
listModelsResponseNextPageToken :: !(Maybe Text)
}
deriving (Int -> ListModelsResponse -> ShowS
[ListModelsResponse] -> ShowS
ListModelsResponse -> [Char]
(Int -> ListModelsResponse -> ShowS)
-> (ListModelsResponse -> [Char])
-> ([ListModelsResponse] -> ShowS)
-> Show ListModelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListModelsResponse -> ShowS
showsPrec :: Int -> ListModelsResponse -> ShowS
$cshow :: ListModelsResponse -> [Char]
show :: ListModelsResponse -> [Char]
$cshowList :: [ListModelsResponse] -> ShowS
showList :: [ListModelsResponse] -> ShowS
P.Show, ListModelsResponse -> ListModelsResponse -> Bool
(ListModelsResponse -> ListModelsResponse -> Bool)
-> (ListModelsResponse -> ListModelsResponse -> Bool)
-> Eq ListModelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListModelsResponse -> ListModelsResponse -> Bool
== :: ListModelsResponse -> ListModelsResponse -> Bool
$c/= :: ListModelsResponse -> ListModelsResponse -> Bool
/= :: ListModelsResponse -> ListModelsResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListModelsResponse where
parseJSON :: Value -> Parser ListModelsResponse
parseJSON = [Char]
-> (Object -> Parser ListModelsResponse)
-> Value
-> Parser ListModelsResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListModelsResponse" ((Object -> Parser ListModelsResponse)
-> Value -> Parser ListModelsResponse)
-> (Object -> Parser ListModelsResponse)
-> Value
-> Parser ListModelsResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Model] -> Maybe Text -> ListModelsResponse
ListModelsResponse
(Maybe [Model] -> Maybe Text -> ListModelsResponse)
-> Parser (Maybe [Model])
-> Parser (Maybe Text -> ListModelsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Model])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"models")
Parser (Maybe Text -> ListModelsResponse)
-> Parser (Maybe Text) -> Parser ListModelsResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
instance A.ToJSON ListModelsResponse where
toJSON :: ListModelsResponse -> Value
toJSON ListModelsResponse {Maybe [Model]
Maybe Text
listModelsResponseModels :: ListModelsResponse -> Maybe [Model]
listModelsResponseNextPageToken :: ListModelsResponse -> Maybe Text
listModelsResponseModels :: Maybe [Model]
listModelsResponseNextPageToken :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"models" Key -> Maybe [Model] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Model]
listModelsResponseModels
, Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listModelsResponseNextPageToken
]
mkListModelsResponse ::
ListModelsResponse
mkListModelsResponse :: ListModelsResponse
mkListModelsResponse =
ListModelsResponse
{ listModelsResponseModels :: Maybe [Model]
listModelsResponseModels = Maybe [Model]
forall a. Maybe a
Nothing
, listModelsResponseNextPageToken :: Maybe Text
listModelsResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
}
data ListOperationsResponse = ListOperationsResponse
{ ListOperationsResponse -> Maybe Text
listOperationsResponseNextPageToken :: !(Maybe Text)
, ListOperationsResponse -> Maybe [Operation]
listOperationsResponseOperations :: !(Maybe [Operation])
}
deriving (Int -> ListOperationsResponse -> ShowS
[ListOperationsResponse] -> ShowS
ListOperationsResponse -> [Char]
(Int -> ListOperationsResponse -> ShowS)
-> (ListOperationsResponse -> [Char])
-> ([ListOperationsResponse] -> ShowS)
-> Show ListOperationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListOperationsResponse -> ShowS
showsPrec :: Int -> ListOperationsResponse -> ShowS
$cshow :: ListOperationsResponse -> [Char]
show :: ListOperationsResponse -> [Char]
$cshowList :: [ListOperationsResponse] -> ShowS
showList :: [ListOperationsResponse] -> ShowS
P.Show, ListOperationsResponse -> ListOperationsResponse -> Bool
(ListOperationsResponse -> ListOperationsResponse -> Bool)
-> (ListOperationsResponse -> ListOperationsResponse -> Bool)
-> Eq ListOperationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListOperationsResponse -> ListOperationsResponse -> Bool
== :: ListOperationsResponse -> ListOperationsResponse -> Bool
$c/= :: ListOperationsResponse -> ListOperationsResponse -> Bool
/= :: ListOperationsResponse -> ListOperationsResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListOperationsResponse where
parseJSON :: Value -> Parser ListOperationsResponse
parseJSON = [Char]
-> (Object -> Parser ListOperationsResponse)
-> Value
-> Parser ListOperationsResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListOperationsResponse" ((Object -> Parser ListOperationsResponse)
-> Value -> Parser ListOperationsResponse)
-> (Object -> Parser ListOperationsResponse)
-> Value
-> Parser ListOperationsResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe [Operation] -> ListOperationsResponse
ListOperationsResponse
(Maybe Text -> Maybe [Operation] -> ListOperationsResponse)
-> Parser (Maybe Text)
-> Parser (Maybe [Operation] -> ListOperationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
Parser (Maybe [Operation] -> ListOperationsResponse)
-> Parser (Maybe [Operation]) -> Parser ListOperationsResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Operation])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"operations")
instance A.ToJSON ListOperationsResponse where
toJSON :: ListOperationsResponse -> Value
toJSON ListOperationsResponse {Maybe [Operation]
Maybe Text
listOperationsResponseNextPageToken :: ListOperationsResponse -> Maybe Text
listOperationsResponseOperations :: ListOperationsResponse -> Maybe [Operation]
listOperationsResponseNextPageToken :: Maybe Text
listOperationsResponseOperations :: Maybe [Operation]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listOperationsResponseNextPageToken
, Key
"operations" Key -> Maybe [Operation] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Operation]
listOperationsResponseOperations
]
mkListOperationsResponse ::
ListOperationsResponse
mkListOperationsResponse :: ListOperationsResponse
mkListOperationsResponse =
ListOperationsResponse
{ listOperationsResponseNextPageToken :: Maybe Text
listOperationsResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
, listOperationsResponseOperations :: Maybe [Operation]
listOperationsResponseOperations = Maybe [Operation]
forall a. Maybe a
Nothing
}
data ListPermissionsResponse = ListPermissionsResponse
{ ListPermissionsResponse -> Maybe [Permission]
listPermissionsResponsePermissions :: !(Maybe [Permission])
, ListPermissionsResponse -> Maybe Text
listPermissionsResponseNextPageToken :: !(Maybe Text)
}
deriving (Int -> ListPermissionsResponse -> ShowS
[ListPermissionsResponse] -> ShowS
ListPermissionsResponse -> [Char]
(Int -> ListPermissionsResponse -> ShowS)
-> (ListPermissionsResponse -> [Char])
-> ([ListPermissionsResponse] -> ShowS)
-> Show ListPermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListPermissionsResponse -> ShowS
showsPrec :: Int -> ListPermissionsResponse -> ShowS
$cshow :: ListPermissionsResponse -> [Char]
show :: ListPermissionsResponse -> [Char]
$cshowList :: [ListPermissionsResponse] -> ShowS
showList :: [ListPermissionsResponse] -> ShowS
P.Show, ListPermissionsResponse -> ListPermissionsResponse -> Bool
(ListPermissionsResponse -> ListPermissionsResponse -> Bool)
-> (ListPermissionsResponse -> ListPermissionsResponse -> Bool)
-> Eq ListPermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListPermissionsResponse -> ListPermissionsResponse -> Bool
== :: ListPermissionsResponse -> ListPermissionsResponse -> Bool
$c/= :: ListPermissionsResponse -> ListPermissionsResponse -> Bool
/= :: ListPermissionsResponse -> ListPermissionsResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListPermissionsResponse where
parseJSON :: Value -> Parser ListPermissionsResponse
parseJSON = [Char]
-> (Object -> Parser ListPermissionsResponse)
-> Value
-> Parser ListPermissionsResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListPermissionsResponse" ((Object -> Parser ListPermissionsResponse)
-> Value -> Parser ListPermissionsResponse)
-> (Object -> Parser ListPermissionsResponse)
-> Value
-> Parser ListPermissionsResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Permission] -> Maybe Text -> ListPermissionsResponse
ListPermissionsResponse
(Maybe [Permission] -> Maybe Text -> ListPermissionsResponse)
-> Parser (Maybe [Permission])
-> Parser (Maybe Text -> ListPermissionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Permission])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"permissions")
Parser (Maybe Text -> ListPermissionsResponse)
-> Parser (Maybe Text) -> Parser ListPermissionsResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
instance A.ToJSON ListPermissionsResponse where
toJSON :: ListPermissionsResponse -> Value
toJSON ListPermissionsResponse {Maybe [Permission]
Maybe Text
listPermissionsResponsePermissions :: ListPermissionsResponse -> Maybe [Permission]
listPermissionsResponseNextPageToken :: ListPermissionsResponse -> Maybe Text
listPermissionsResponsePermissions :: Maybe [Permission]
listPermissionsResponseNextPageToken :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"permissions" Key -> Maybe [Permission] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Permission]
listPermissionsResponsePermissions
, Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listPermissionsResponseNextPageToken
]
mkListPermissionsResponse ::
ListPermissionsResponse
mkListPermissionsResponse :: ListPermissionsResponse
mkListPermissionsResponse =
ListPermissionsResponse
{ listPermissionsResponsePermissions :: Maybe [Permission]
listPermissionsResponsePermissions = Maybe [Permission]
forall a. Maybe a
Nothing
, listPermissionsResponseNextPageToken :: Maybe Text
listPermissionsResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
}
data ListTunedModelsResponse = ListTunedModelsResponse
{ ListTunedModelsResponse -> Maybe Text
listTunedModelsResponseNextPageToken :: !(Maybe Text)
, ListTunedModelsResponse -> Maybe [TunedModel]
listTunedModelsResponseTunedModels :: !(Maybe [TunedModel])
}
deriving (Int -> ListTunedModelsResponse -> ShowS
[ListTunedModelsResponse] -> ShowS
ListTunedModelsResponse -> [Char]
(Int -> ListTunedModelsResponse -> ShowS)
-> (ListTunedModelsResponse -> [Char])
-> ([ListTunedModelsResponse] -> ShowS)
-> Show ListTunedModelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListTunedModelsResponse -> ShowS
showsPrec :: Int -> ListTunedModelsResponse -> ShowS
$cshow :: ListTunedModelsResponse -> [Char]
show :: ListTunedModelsResponse -> [Char]
$cshowList :: [ListTunedModelsResponse] -> ShowS
showList :: [ListTunedModelsResponse] -> ShowS
P.Show, ListTunedModelsResponse -> ListTunedModelsResponse -> Bool
(ListTunedModelsResponse -> ListTunedModelsResponse -> Bool)
-> (ListTunedModelsResponse -> ListTunedModelsResponse -> Bool)
-> Eq ListTunedModelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListTunedModelsResponse -> ListTunedModelsResponse -> Bool
== :: ListTunedModelsResponse -> ListTunedModelsResponse -> Bool
$c/= :: ListTunedModelsResponse -> ListTunedModelsResponse -> Bool
/= :: ListTunedModelsResponse -> ListTunedModelsResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ListTunedModelsResponse where
parseJSON :: Value -> Parser ListTunedModelsResponse
parseJSON = [Char]
-> (Object -> Parser ListTunedModelsResponse)
-> Value
-> Parser ListTunedModelsResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ListTunedModelsResponse" ((Object -> Parser ListTunedModelsResponse)
-> Value -> Parser ListTunedModelsResponse)
-> (Object -> Parser ListTunedModelsResponse)
-> Value
-> Parser ListTunedModelsResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe [TunedModel] -> ListTunedModelsResponse
ListTunedModelsResponse
(Maybe Text -> Maybe [TunedModel] -> ListTunedModelsResponse)
-> Parser (Maybe Text)
-> Parser (Maybe [TunedModel] -> ListTunedModelsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nextPageToken")
Parser (Maybe [TunedModel] -> ListTunedModelsResponse)
-> Parser (Maybe [TunedModel]) -> Parser ListTunedModelsResponse
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [TunedModel])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tunedModels")
instance A.ToJSON ListTunedModelsResponse where
toJSON :: ListTunedModelsResponse -> Value
toJSON ListTunedModelsResponse {Maybe [TunedModel]
Maybe Text
listTunedModelsResponseNextPageToken :: ListTunedModelsResponse -> Maybe Text
listTunedModelsResponseTunedModels :: ListTunedModelsResponse -> Maybe [TunedModel]
listTunedModelsResponseNextPageToken :: Maybe Text
listTunedModelsResponseTunedModels :: Maybe [TunedModel]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"nextPageToken" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
listTunedModelsResponseNextPageToken
, Key
"tunedModels" Key -> Maybe [TunedModel] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [TunedModel]
listTunedModelsResponseTunedModels
]
mkListTunedModelsResponse ::
ListTunedModelsResponse
mkListTunedModelsResponse :: ListTunedModelsResponse
mkListTunedModelsResponse =
ListTunedModelsResponse
{ listTunedModelsResponseNextPageToken :: Maybe Text
listTunedModelsResponseNextPageToken = Maybe Text
forall a. Maybe a
Nothing
, listTunedModelsResponseTunedModels :: Maybe [TunedModel]
listTunedModelsResponseTunedModels = Maybe [TunedModel]
forall a. Maybe a
Nothing
}
data LogprobsResult = LogprobsResult
{ LogprobsResult -> Maybe [LogprobsResultCandidate]
logprobsResultChosenCandidates :: !(Maybe [LogprobsResultCandidate])
, LogprobsResult -> Maybe [TopCandidates]
logprobsResultTopCandidates :: !(Maybe [TopCandidates])
}
deriving (Int -> LogprobsResult -> ShowS
[LogprobsResult] -> ShowS
LogprobsResult -> [Char]
(Int -> LogprobsResult -> ShowS)
-> (LogprobsResult -> [Char])
-> ([LogprobsResult] -> ShowS)
-> Show LogprobsResult
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LogprobsResult -> ShowS
showsPrec :: Int -> LogprobsResult -> ShowS
$cshow :: LogprobsResult -> [Char]
show :: LogprobsResult -> [Char]
$cshowList :: [LogprobsResult] -> ShowS
showList :: [LogprobsResult] -> ShowS
P.Show, LogprobsResult -> LogprobsResult -> Bool
(LogprobsResult -> LogprobsResult -> Bool)
-> (LogprobsResult -> LogprobsResult -> Bool) -> Eq LogprobsResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LogprobsResult -> LogprobsResult -> Bool
== :: LogprobsResult -> LogprobsResult -> Bool
$c/= :: LogprobsResult -> LogprobsResult -> Bool
/= :: LogprobsResult -> LogprobsResult -> Bool
P.Eq, P.Typeable)
instance A.FromJSON LogprobsResult where
parseJSON :: Value -> Parser LogprobsResult
parseJSON = [Char]
-> (Object -> Parser LogprobsResult)
-> Value
-> Parser LogprobsResult
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"LogprobsResult" ((Object -> Parser LogprobsResult)
-> Value -> Parser LogprobsResult)
-> (Object -> Parser LogprobsResult)
-> Value
-> Parser LogprobsResult
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [LogprobsResultCandidate]
-> Maybe [TopCandidates] -> LogprobsResult
LogprobsResult
(Maybe [LogprobsResultCandidate]
-> Maybe [TopCandidates] -> LogprobsResult)
-> Parser (Maybe [LogprobsResultCandidate])
-> Parser (Maybe [TopCandidates] -> LogprobsResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [LogprobsResultCandidate])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"chosenCandidates")
Parser (Maybe [TopCandidates] -> LogprobsResult)
-> Parser (Maybe [TopCandidates]) -> Parser LogprobsResult
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [TopCandidates])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topCandidates")
instance A.ToJSON LogprobsResult where
toJSON :: LogprobsResult -> Value
toJSON LogprobsResult {Maybe [LogprobsResultCandidate]
Maybe [TopCandidates]
logprobsResultChosenCandidates :: LogprobsResult -> Maybe [LogprobsResultCandidate]
logprobsResultTopCandidates :: LogprobsResult -> Maybe [TopCandidates]
logprobsResultChosenCandidates :: Maybe [LogprobsResultCandidate]
logprobsResultTopCandidates :: Maybe [TopCandidates]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"chosenCandidates" Key -> Maybe [LogprobsResultCandidate] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [LogprobsResultCandidate]
logprobsResultChosenCandidates
, Key
"topCandidates" Key -> Maybe [TopCandidates] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [TopCandidates]
logprobsResultTopCandidates
]
mkLogprobsResult ::
LogprobsResult
mkLogprobsResult :: LogprobsResult
mkLogprobsResult =
LogprobsResult
{ logprobsResultChosenCandidates :: Maybe [LogprobsResultCandidate]
logprobsResultChosenCandidates = Maybe [LogprobsResultCandidate]
forall a. Maybe a
Nothing
, logprobsResultTopCandidates :: Maybe [TopCandidates]
logprobsResultTopCandidates = Maybe [TopCandidates]
forall a. Maybe a
Nothing
}
data LogprobsResultCandidate = LogprobsResultCandidate
{ LogprobsResultCandidate -> Maybe Float
logprobsResultCandidateLogProbability :: !(Maybe Float)
, LogprobsResultCandidate -> Maybe Int
logprobsResultCandidateTokenId :: !(Maybe Int)
, LogprobsResultCandidate -> Maybe Text
logprobsResultCandidateToken :: !(Maybe Text)
}
deriving (Int -> LogprobsResultCandidate -> ShowS
[LogprobsResultCandidate] -> ShowS
LogprobsResultCandidate -> [Char]
(Int -> LogprobsResultCandidate -> ShowS)
-> (LogprobsResultCandidate -> [Char])
-> ([LogprobsResultCandidate] -> ShowS)
-> Show LogprobsResultCandidate
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LogprobsResultCandidate -> ShowS
showsPrec :: Int -> LogprobsResultCandidate -> ShowS
$cshow :: LogprobsResultCandidate -> [Char]
show :: LogprobsResultCandidate -> [Char]
$cshowList :: [LogprobsResultCandidate] -> ShowS
showList :: [LogprobsResultCandidate] -> ShowS
P.Show, LogprobsResultCandidate -> LogprobsResultCandidate -> Bool
(LogprobsResultCandidate -> LogprobsResultCandidate -> Bool)
-> (LogprobsResultCandidate -> LogprobsResultCandidate -> Bool)
-> Eq LogprobsResultCandidate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LogprobsResultCandidate -> LogprobsResultCandidate -> Bool
== :: LogprobsResultCandidate -> LogprobsResultCandidate -> Bool
$c/= :: LogprobsResultCandidate -> LogprobsResultCandidate -> Bool
/= :: LogprobsResultCandidate -> LogprobsResultCandidate -> Bool
P.Eq, P.Typeable)
instance A.FromJSON LogprobsResultCandidate where
parseJSON :: Value -> Parser LogprobsResultCandidate
parseJSON = [Char]
-> (Object -> Parser LogprobsResultCandidate)
-> Value
-> Parser LogprobsResultCandidate
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"LogprobsResultCandidate" ((Object -> Parser LogprobsResultCandidate)
-> Value -> Parser LogprobsResultCandidate)
-> (Object -> Parser LogprobsResultCandidate)
-> Value
-> Parser LogprobsResultCandidate
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Float -> Maybe Int -> Maybe Text -> LogprobsResultCandidate
LogprobsResultCandidate
(Maybe Float -> Maybe Int -> Maybe Text -> LogprobsResultCandidate)
-> Parser (Maybe Float)
-> Parser (Maybe Int -> Maybe Text -> LogprobsResultCandidate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"logProbability")
Parser (Maybe Int -> Maybe Text -> LogprobsResultCandidate)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> LogprobsResultCandidate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tokenId")
Parser (Maybe Text -> LogprobsResultCandidate)
-> Parser (Maybe Text) -> Parser LogprobsResultCandidate
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"token")
instance A.ToJSON LogprobsResultCandidate where
toJSON :: LogprobsResultCandidate -> Value
toJSON LogprobsResultCandidate {Maybe Float
Maybe Int
Maybe Text
logprobsResultCandidateLogProbability :: LogprobsResultCandidate -> Maybe Float
logprobsResultCandidateTokenId :: LogprobsResultCandidate -> Maybe Int
logprobsResultCandidateToken :: LogprobsResultCandidate -> Maybe Text
logprobsResultCandidateLogProbability :: Maybe Float
logprobsResultCandidateTokenId :: Maybe Int
logprobsResultCandidateToken :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"logProbability" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
logprobsResultCandidateLogProbability
, Key
"tokenId" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
logprobsResultCandidateTokenId
, Key
"token" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
logprobsResultCandidateToken
]
mkLogprobsResultCandidate ::
LogprobsResultCandidate
mkLogprobsResultCandidate :: LogprobsResultCandidate
mkLogprobsResultCandidate =
LogprobsResultCandidate
{ logprobsResultCandidateLogProbability :: Maybe Float
logprobsResultCandidateLogProbability = Maybe Float
forall a. Maybe a
Nothing
, logprobsResultCandidateTokenId :: Maybe Int
logprobsResultCandidateTokenId = Maybe Int
forall a. Maybe a
Nothing
, logprobsResultCandidateToken :: Maybe Text
logprobsResultCandidateToken = Maybe Text
forall a. Maybe a
Nothing
}
data Media = Media
{ Media -> Maybe Video
mediaVideo :: !(Maybe Video)
}
deriving (Int -> Media -> ShowS
[Media] -> ShowS
Media -> [Char]
(Int -> Media -> ShowS)
-> (Media -> [Char]) -> ([Media] -> ShowS) -> Show Media
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Media -> ShowS
showsPrec :: Int -> Media -> ShowS
$cshow :: Media -> [Char]
show :: Media -> [Char]
$cshowList :: [Media] -> ShowS
showList :: [Media] -> ShowS
P.Show, Media -> Media -> Bool
(Media -> Media -> Bool) -> (Media -> Media -> Bool) -> Eq Media
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Media -> Media -> Bool
== :: Media -> Media -> Bool
$c/= :: Media -> Media -> Bool
/= :: Media -> Media -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Media where
parseJSON :: Value -> Parser Media
parseJSON = [Char] -> (Object -> Parser Media) -> Value -> Parser Media
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Media" ((Object -> Parser Media) -> Value -> Parser Media)
-> (Object -> Parser Media) -> Value -> Parser Media
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Video -> Media
Media
(Maybe Video -> Media) -> Parser (Maybe Video) -> Parser Media
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Video)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"video")
instance A.ToJSON Media where
toJSON :: Media -> Value
toJSON Media {Maybe Video
mediaVideo :: Media -> Maybe Video
mediaVideo :: Maybe Video
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"video" Key -> Maybe Video -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Video
mediaVideo
]
mkMedia ::
Media
mkMedia :: Media
mkMedia =
Media
{ mediaVideo :: Maybe Video
mediaVideo = Maybe Video
forall a. Maybe a
Nothing
}
data Message = Message
{ Message -> Maybe CitationMetadata
messageCitationMetadata :: !(Maybe CitationMetadata)
, Message -> Maybe Text
messageAuthor :: !(Maybe Text)
, Message -> Text
messageContent :: !(Text)
}
deriving (Int -> Message -> ShowS
[Message] -> ShowS
Message -> [Char]
(Int -> Message -> ShowS)
-> (Message -> [Char]) -> ([Message] -> ShowS) -> Show Message
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Message -> ShowS
showsPrec :: Int -> Message -> ShowS
$cshow :: Message -> [Char]
show :: Message -> [Char]
$cshowList :: [Message] -> ShowS
showList :: [Message] -> ShowS
P.Show, Message -> Message -> Bool
(Message -> Message -> Bool)
-> (Message -> Message -> Bool) -> Eq Message
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Message -> Message -> Bool
== :: Message -> Message -> Bool
$c/= :: Message -> Message -> Bool
/= :: Message -> Message -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Message where
parseJSON :: Value -> Parser Message
parseJSON = [Char] -> (Object -> Parser Message) -> Value -> Parser Message
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Message" ((Object -> Parser Message) -> Value -> Parser Message)
-> (Object -> Parser Message) -> Value -> Parser Message
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe CitationMetadata -> Maybe Text -> Text -> Message
Message
(Maybe CitationMetadata -> Maybe Text -> Text -> Message)
-> Parser (Maybe CitationMetadata)
-> Parser (Maybe Text -> Text -> Message)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe CitationMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"citationMetadata")
Parser (Maybe Text -> Text -> Message)
-> Parser (Maybe Text) -> Parser (Text -> Message)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"author")
Parser (Text -> Message) -> Parser Text -> Parser Message
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"content")
instance A.ToJSON Message where
toJSON :: Message -> Value
toJSON Message {Maybe Text
Maybe CitationMetadata
Text
messageCitationMetadata :: Message -> Maybe CitationMetadata
messageAuthor :: Message -> Maybe Text
messageContent :: Message -> Text
messageCitationMetadata :: Maybe CitationMetadata
messageAuthor :: Maybe Text
messageContent :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"citationMetadata" Key -> Maybe CitationMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe CitationMetadata
messageCitationMetadata
, Key
"author" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
messageAuthor
, Key
"content" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
messageContent
]
mkMessage ::
Text ->
Message
mkMessage :: Text -> Message
mkMessage Text
messageContent =
Message
{ messageCitationMetadata :: Maybe CitationMetadata
messageCitationMetadata = Maybe CitationMetadata
forall a. Maybe a
Nothing
, messageAuthor :: Maybe Text
messageAuthor = Maybe Text
forall a. Maybe a
Nothing
, Text
messageContent :: Text
messageContent :: Text
messageContent
}
data MessagePrompt = MessagePrompt
{ MessagePrompt -> Maybe Text
messagePromptContext :: !(Maybe Text)
, MessagePrompt -> [Message]
messagePromptMessages :: !([Message])
, MessagePrompt -> Maybe [Example]
messagePromptExamples :: !(Maybe [Example])
}
deriving (Int -> MessagePrompt -> ShowS
[MessagePrompt] -> ShowS
MessagePrompt -> [Char]
(Int -> MessagePrompt -> ShowS)
-> (MessagePrompt -> [Char])
-> ([MessagePrompt] -> ShowS)
-> Show MessagePrompt
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MessagePrompt -> ShowS
showsPrec :: Int -> MessagePrompt -> ShowS
$cshow :: MessagePrompt -> [Char]
show :: MessagePrompt -> [Char]
$cshowList :: [MessagePrompt] -> ShowS
showList :: [MessagePrompt] -> ShowS
P.Show, MessagePrompt -> MessagePrompt -> Bool
(MessagePrompt -> MessagePrompt -> Bool)
-> (MessagePrompt -> MessagePrompt -> Bool) -> Eq MessagePrompt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MessagePrompt -> MessagePrompt -> Bool
== :: MessagePrompt -> MessagePrompt -> Bool
$c/= :: MessagePrompt -> MessagePrompt -> Bool
/= :: MessagePrompt -> MessagePrompt -> Bool
P.Eq, P.Typeable)
instance A.FromJSON MessagePrompt where
parseJSON :: Value -> Parser MessagePrompt
parseJSON = [Char]
-> (Object -> Parser MessagePrompt)
-> Value
-> Parser MessagePrompt
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"MessagePrompt" ((Object -> Parser MessagePrompt) -> Value -> Parser MessagePrompt)
-> (Object -> Parser MessagePrompt)
-> Value
-> Parser MessagePrompt
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> [Message] -> Maybe [Example] -> MessagePrompt
MessagePrompt
(Maybe Text -> [Message] -> Maybe [Example] -> MessagePrompt)
-> Parser (Maybe Text)
-> Parser ([Message] -> Maybe [Example] -> MessagePrompt)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"context")
Parser ([Message] -> Maybe [Example] -> MessagePrompt)
-> Parser [Message] -> Parser (Maybe [Example] -> MessagePrompt)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser [Message]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"messages")
Parser (Maybe [Example] -> MessagePrompt)
-> Parser (Maybe [Example]) -> Parser MessagePrompt
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Example])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"examples")
instance A.ToJSON MessagePrompt where
toJSON :: MessagePrompt -> Value
toJSON MessagePrompt {[Message]
Maybe [Example]
Maybe Text
messagePromptContext :: MessagePrompt -> Maybe Text
messagePromptMessages :: MessagePrompt -> [Message]
messagePromptExamples :: MessagePrompt -> Maybe [Example]
messagePromptContext :: Maybe Text
messagePromptMessages :: [Message]
messagePromptExamples :: Maybe [Example]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"context" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
messagePromptContext
, Key
"messages" Key -> [Message] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Message]
messagePromptMessages
, Key
"examples" Key -> Maybe [Example] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Example]
messagePromptExamples
]
mkMessagePrompt ::
[Message] ->
MessagePrompt
mkMessagePrompt :: [Message] -> MessagePrompt
mkMessagePrompt [Message]
messagePromptMessages =
MessagePrompt
{ messagePromptContext :: Maybe Text
messagePromptContext = Maybe Text
forall a. Maybe a
Nothing
, [Message]
messagePromptMessages :: [Message]
messagePromptMessages :: [Message]
messagePromptMessages
, messagePromptExamples :: Maybe [Example]
messagePromptExamples = Maybe [Example]
forall a. Maybe a
Nothing
}
data MetadataFilter = MetadataFilter
{ MetadataFilter -> [Condition]
metadataFilterConditions :: !([Condition])
, MetadataFilter -> Text
metadataFilterKey :: !(Text)
}
deriving (Int -> MetadataFilter -> ShowS
[MetadataFilter] -> ShowS
MetadataFilter -> [Char]
(Int -> MetadataFilter -> ShowS)
-> (MetadataFilter -> [Char])
-> ([MetadataFilter] -> ShowS)
-> Show MetadataFilter
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetadataFilter -> ShowS
showsPrec :: Int -> MetadataFilter -> ShowS
$cshow :: MetadataFilter -> [Char]
show :: MetadataFilter -> [Char]
$cshowList :: [MetadataFilter] -> ShowS
showList :: [MetadataFilter] -> ShowS
P.Show, MetadataFilter -> MetadataFilter -> Bool
(MetadataFilter -> MetadataFilter -> Bool)
-> (MetadataFilter -> MetadataFilter -> Bool) -> Eq MetadataFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetadataFilter -> MetadataFilter -> Bool
== :: MetadataFilter -> MetadataFilter -> Bool
$c/= :: MetadataFilter -> MetadataFilter -> Bool
/= :: MetadataFilter -> MetadataFilter -> Bool
P.Eq, P.Typeable)
instance A.FromJSON MetadataFilter where
parseJSON :: Value -> Parser MetadataFilter
parseJSON = [Char]
-> (Object -> Parser MetadataFilter)
-> Value
-> Parser MetadataFilter
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"MetadataFilter" ((Object -> Parser MetadataFilter)
-> Value -> Parser MetadataFilter)
-> (Object -> Parser MetadataFilter)
-> Value
-> Parser MetadataFilter
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[Condition] -> Text -> MetadataFilter
MetadataFilter
([Condition] -> Text -> MetadataFilter)
-> Parser [Condition] -> Parser (Text -> MetadataFilter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser [Condition]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"conditions")
Parser (Text -> MetadataFilter)
-> Parser Text -> Parser MetadataFilter
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"key")
instance A.ToJSON MetadataFilter where
toJSON :: MetadataFilter -> Value
toJSON MetadataFilter {[Condition]
Text
metadataFilterConditions :: MetadataFilter -> [Condition]
metadataFilterKey :: MetadataFilter -> Text
metadataFilterConditions :: [Condition]
metadataFilterKey :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"conditions" Key -> [Condition] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Condition]
metadataFilterConditions
, Key
"key" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
metadataFilterKey
]
mkMetadataFilter ::
[Condition] ->
Text ->
MetadataFilter
mkMetadataFilter :: [Condition] -> Text -> MetadataFilter
mkMetadataFilter [Condition]
metadataFilterConditions Text
metadataFilterKey =
MetadataFilter
{ [Condition]
metadataFilterConditions :: [Condition]
metadataFilterConditions :: [Condition]
metadataFilterConditions
, Text
metadataFilterKey :: Text
metadataFilterKey :: Text
metadataFilterKey
}
data ModalityTokenCount = ModalityTokenCount
{ ModalityTokenCount -> Maybe Int
modalityTokenCountTokenCount :: !(Maybe Int)
, ModalityTokenCount -> Maybe Modality
modalityTokenCountModality :: !(Maybe Modality)
}
deriving (Int -> ModalityTokenCount -> ShowS
[ModalityTokenCount] -> ShowS
ModalityTokenCount -> [Char]
(Int -> ModalityTokenCount -> ShowS)
-> (ModalityTokenCount -> [Char])
-> ([ModalityTokenCount] -> ShowS)
-> Show ModalityTokenCount
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ModalityTokenCount -> ShowS
showsPrec :: Int -> ModalityTokenCount -> ShowS
$cshow :: ModalityTokenCount -> [Char]
show :: ModalityTokenCount -> [Char]
$cshowList :: [ModalityTokenCount] -> ShowS
showList :: [ModalityTokenCount] -> ShowS
P.Show, ModalityTokenCount -> ModalityTokenCount -> Bool
(ModalityTokenCount -> ModalityTokenCount -> Bool)
-> (ModalityTokenCount -> ModalityTokenCount -> Bool)
-> Eq ModalityTokenCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModalityTokenCount -> ModalityTokenCount -> Bool
== :: ModalityTokenCount -> ModalityTokenCount -> Bool
$c/= :: ModalityTokenCount -> ModalityTokenCount -> Bool
/= :: ModalityTokenCount -> ModalityTokenCount -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ModalityTokenCount where
parseJSON :: Value -> Parser ModalityTokenCount
parseJSON = [Char]
-> (Object -> Parser ModalityTokenCount)
-> Value
-> Parser ModalityTokenCount
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ModalityTokenCount" ((Object -> Parser ModalityTokenCount)
-> Value -> Parser ModalityTokenCount)
-> (Object -> Parser ModalityTokenCount)
-> Value
-> Parser ModalityTokenCount
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int -> Maybe Modality -> ModalityTokenCount
ModalityTokenCount
(Maybe Int -> Maybe Modality -> ModalityTokenCount)
-> Parser (Maybe Int)
-> Parser (Maybe Modality -> ModalityTokenCount)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tokenCount")
Parser (Maybe Modality -> ModalityTokenCount)
-> Parser (Maybe Modality) -> Parser ModalityTokenCount
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Modality)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"modality")
instance A.ToJSON ModalityTokenCount where
toJSON :: ModalityTokenCount -> Value
toJSON ModalityTokenCount {Maybe Int
Maybe Modality
modalityTokenCountTokenCount :: ModalityTokenCount -> Maybe Int
modalityTokenCountModality :: ModalityTokenCount -> Maybe Modality
modalityTokenCountTokenCount :: Maybe Int
modalityTokenCountModality :: Maybe Modality
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"tokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
modalityTokenCountTokenCount
, Key
"modality" Key -> Maybe Modality -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Modality
modalityTokenCountModality
]
mkModalityTokenCount ::
ModalityTokenCount
mkModalityTokenCount :: ModalityTokenCount
mkModalityTokenCount =
ModalityTokenCount
{ modalityTokenCountTokenCount :: Maybe Int
modalityTokenCountTokenCount = Maybe Int
forall a. Maybe a
Nothing
, modalityTokenCountModality :: Maybe Modality
modalityTokenCountModality = Maybe Modality
forall a. Maybe a
Nothing
}
data Model = Model
{ Model -> Maybe Int
modelTopK :: !(Maybe Int)
, Model -> Text
modelName :: !(Text)
, Model -> Text
modelBaseModelId :: !(Text)
, Model -> Text
modelVersion :: !(Text)
, Model -> Maybe Int
modelInputTokenLimit :: !(Maybe Int)
, Model -> Maybe Float
modelTopP :: !(Maybe Float)
, Model -> Maybe [Text]
modelSupportedGenerationMethods :: !(Maybe [Text])
, Model -> Maybe Float
modelTemperature :: !(Maybe Float)
, Model -> Maybe Text
modelDisplayName :: !(Maybe Text)
, Model -> Maybe Text
modelDescription :: !(Maybe Text)
, Model -> Maybe Float
modelMaxTemperature :: !(Maybe Float)
, Model -> Maybe Int
modelOutputTokenLimit :: !(Maybe Int)
}
deriving (Int -> Model -> ShowS
[Model] -> ShowS
Model -> [Char]
(Int -> Model -> ShowS)
-> (Model -> [Char]) -> ([Model] -> ShowS) -> Show Model
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Model -> ShowS
showsPrec :: Int -> Model -> ShowS
$cshow :: Model -> [Char]
show :: Model -> [Char]
$cshowList :: [Model] -> ShowS
showList :: [Model] -> ShowS
P.Show, Model -> Model -> Bool
(Model -> Model -> Bool) -> (Model -> Model -> Bool) -> Eq Model
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Model -> Model -> Bool
== :: Model -> Model -> Bool
$c/= :: Model -> Model -> Bool
/= :: Model -> Model -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Model where
parseJSON :: Value -> Parser Model
parseJSON = [Char] -> (Object -> Parser Model) -> Value -> Parser Model
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Model" ((Object -> Parser Model) -> Value -> Parser Model)
-> (Object -> Parser Model) -> Value -> Parser Model
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int
-> Text
-> Text
-> Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model
Model
(Maybe Int
-> Text
-> Text
-> Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
-> Parser (Maybe Int)
-> Parser
(Text
-> Text
-> Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topK")
Parser
(Text
-> Text
-> Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
-> Parser Text
-> Parser
(Text
-> Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"name")
Parser
(Text
-> Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
-> Parser Text
-> Parser
(Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"baseModelId")
Parser
(Text
-> Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
-> Parser Text
-> Parser
(Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"version")
Parser
(Maybe Int
-> Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
-> Parser (Maybe Int)
-> Parser
(Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"inputTokenLimit")
Parser
(Maybe Float
-> Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
-> Parser (Maybe Float)
-> Parser
(Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topP")
Parser
(Maybe [Text]
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Model)
-> Parser (Maybe [Text])
-> Parser
(Maybe Float
-> Maybe Text -> Maybe Text -> Maybe Float -> Maybe Int -> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"supportedGenerationMethods")
Parser
(Maybe Float
-> Maybe Text -> Maybe Text -> Maybe Float -> Maybe Int -> Model)
-> Parser (Maybe Float)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Float -> Maybe Int -> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"temperature")
Parser
(Maybe Text -> Maybe Text -> Maybe Float -> Maybe Int -> Model)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Float -> Maybe Int -> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"displayName")
Parser (Maybe Text -> Maybe Float -> Maybe Int -> Model)
-> Parser (Maybe Text)
-> Parser (Maybe Float -> Maybe Int -> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description")
Parser (Maybe Float -> Maybe Int -> Model)
-> Parser (Maybe Float) -> Parser (Maybe Int -> Model)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxTemperature")
Parser (Maybe Int -> Model) -> Parser (Maybe Int) -> Parser Model
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"outputTokenLimit")
instance A.ToJSON Model where
toJSON :: Model -> Value
toJSON Model {Maybe Float
Maybe Int
Maybe [Text]
Maybe Text
Text
modelTopK :: Model -> Maybe Int
modelName :: Model -> Text
modelBaseModelId :: Model -> Text
modelVersion :: Model -> Text
modelInputTokenLimit :: Model -> Maybe Int
modelTopP :: Model -> Maybe Float
modelSupportedGenerationMethods :: Model -> Maybe [Text]
modelTemperature :: Model -> Maybe Float
modelDisplayName :: Model -> Maybe Text
modelDescription :: Model -> Maybe Text
modelMaxTemperature :: Model -> Maybe Float
modelOutputTokenLimit :: Model -> Maybe Int
modelTopK :: Maybe Int
modelName :: Text
modelBaseModelId :: Text
modelVersion :: Text
modelInputTokenLimit :: Maybe Int
modelTopP :: Maybe Float
modelSupportedGenerationMethods :: Maybe [Text]
modelTemperature :: Maybe Float
modelDisplayName :: Maybe Text
modelDescription :: Maybe Text
modelMaxTemperature :: Maybe Float
modelOutputTokenLimit :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"topK" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
modelTopK
, Key
"name" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
modelName
, Key
"baseModelId" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
modelBaseModelId
, Key
"version" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
modelVersion
, Key
"inputTokenLimit" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
modelInputTokenLimit
, Key
"topP" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
modelTopP
, Key
"supportedGenerationMethods" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
modelSupportedGenerationMethods
, Key
"temperature" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
modelTemperature
, Key
"displayName" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
modelDisplayName
, Key
"description" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
modelDescription
, Key
"maxTemperature" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
modelMaxTemperature
, Key
"outputTokenLimit" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
modelOutputTokenLimit
]
mkModel ::
Text ->
Text ->
Text ->
Model
mkModel :: Text -> Text -> Text -> Model
mkModel Text
modelName Text
modelBaseModelId Text
modelVersion =
Model
{ modelTopK :: Maybe Int
modelTopK = Maybe Int
forall a. Maybe a
Nothing
, Text
modelName :: Text
modelName :: Text
modelName
, Text
modelBaseModelId :: Text
modelBaseModelId :: Text
modelBaseModelId
, Text
modelVersion :: Text
modelVersion :: Text
modelVersion
, modelInputTokenLimit :: Maybe Int
modelInputTokenLimit = Maybe Int
forall a. Maybe a
Nothing
, modelTopP :: Maybe Float
modelTopP = Maybe Float
forall a. Maybe a
Nothing
, modelSupportedGenerationMethods :: Maybe [Text]
modelSupportedGenerationMethods = Maybe [Text]
forall a. Maybe a
Nothing
, modelTemperature :: Maybe Float
modelTemperature = Maybe Float
forall a. Maybe a
Nothing
, modelDisplayName :: Maybe Text
modelDisplayName = Maybe Text
forall a. Maybe a
Nothing
, modelDescription :: Maybe Text
modelDescription = Maybe Text
forall a. Maybe a
Nothing
, modelMaxTemperature :: Maybe Float
modelMaxTemperature = Maybe Float
forall a. Maybe a
Nothing
, modelOutputTokenLimit :: Maybe Int
modelOutputTokenLimit = Maybe Int
forall a. Maybe a
Nothing
}
data MultiSpeakerVoiceConfig = MultiSpeakerVoiceConfig
{ MultiSpeakerVoiceConfig -> [SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs :: !([SpeakerVoiceConfig])
}
deriving (Int -> MultiSpeakerVoiceConfig -> ShowS
[MultiSpeakerVoiceConfig] -> ShowS
MultiSpeakerVoiceConfig -> [Char]
(Int -> MultiSpeakerVoiceConfig -> ShowS)
-> (MultiSpeakerVoiceConfig -> [Char])
-> ([MultiSpeakerVoiceConfig] -> ShowS)
-> Show MultiSpeakerVoiceConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MultiSpeakerVoiceConfig -> ShowS
showsPrec :: Int -> MultiSpeakerVoiceConfig -> ShowS
$cshow :: MultiSpeakerVoiceConfig -> [Char]
show :: MultiSpeakerVoiceConfig -> [Char]
$cshowList :: [MultiSpeakerVoiceConfig] -> ShowS
showList :: [MultiSpeakerVoiceConfig] -> ShowS
P.Show, MultiSpeakerVoiceConfig -> MultiSpeakerVoiceConfig -> Bool
(MultiSpeakerVoiceConfig -> MultiSpeakerVoiceConfig -> Bool)
-> (MultiSpeakerVoiceConfig -> MultiSpeakerVoiceConfig -> Bool)
-> Eq MultiSpeakerVoiceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MultiSpeakerVoiceConfig -> MultiSpeakerVoiceConfig -> Bool
== :: MultiSpeakerVoiceConfig -> MultiSpeakerVoiceConfig -> Bool
$c/= :: MultiSpeakerVoiceConfig -> MultiSpeakerVoiceConfig -> Bool
/= :: MultiSpeakerVoiceConfig -> MultiSpeakerVoiceConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON MultiSpeakerVoiceConfig where
parseJSON :: Value -> Parser MultiSpeakerVoiceConfig
parseJSON = [Char]
-> (Object -> Parser MultiSpeakerVoiceConfig)
-> Value
-> Parser MultiSpeakerVoiceConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"MultiSpeakerVoiceConfig" ((Object -> Parser MultiSpeakerVoiceConfig)
-> Value -> Parser MultiSpeakerVoiceConfig)
-> (Object -> Parser MultiSpeakerVoiceConfig)
-> Value
-> Parser MultiSpeakerVoiceConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[SpeakerVoiceConfig] -> MultiSpeakerVoiceConfig
MultiSpeakerVoiceConfig
([SpeakerVoiceConfig] -> MultiSpeakerVoiceConfig)
-> Parser [SpeakerVoiceConfig] -> Parser MultiSpeakerVoiceConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser [SpeakerVoiceConfig]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"speakerVoiceConfigs")
instance A.ToJSON MultiSpeakerVoiceConfig where
toJSON :: MultiSpeakerVoiceConfig -> Value
toJSON MultiSpeakerVoiceConfig {[SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs :: MultiSpeakerVoiceConfig -> [SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs :: [SpeakerVoiceConfig]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"speakerVoiceConfigs" Key -> [SpeakerVoiceConfig] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs
]
mkMultiSpeakerVoiceConfig ::
[SpeakerVoiceConfig] ->
MultiSpeakerVoiceConfig
mkMultiSpeakerVoiceConfig :: [SpeakerVoiceConfig] -> MultiSpeakerVoiceConfig
mkMultiSpeakerVoiceConfig [SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs =
MultiSpeakerVoiceConfig
{ [SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs :: [SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs :: [SpeakerVoiceConfig]
multiSpeakerVoiceConfigSpeakerVoiceConfigs
}
data Operation = Operation
{ Operation -> Maybe Bool
operationDone :: !(Maybe Bool)
, Operation -> Maybe Text
operationName :: !(Maybe Text)
, Operation -> Maybe Status
operationError :: !(Maybe Status)
, Operation -> Maybe (Map [Char] [Char])
operationMetadata :: !(Maybe (Map.Map String String))
, Operation -> Maybe (Map [Char] [Char])
operationResponse :: !(Maybe (Map.Map String String))
}
deriving (Int -> Operation -> ShowS
[Operation] -> ShowS
Operation -> [Char]
(Int -> Operation -> ShowS)
-> (Operation -> [Char])
-> ([Operation] -> ShowS)
-> Show Operation
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Operation -> ShowS
showsPrec :: Int -> Operation -> ShowS
$cshow :: Operation -> [Char]
show :: Operation -> [Char]
$cshowList :: [Operation] -> ShowS
showList :: [Operation] -> ShowS
P.Show, Operation -> Operation -> Bool
(Operation -> Operation -> Bool)
-> (Operation -> Operation -> Bool) -> Eq Operation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Operation -> Operation -> Bool
== :: Operation -> Operation -> Bool
$c/= :: Operation -> Operation -> Bool
/= :: Operation -> Operation -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Operation where
parseJSON :: Value -> Parser Operation
parseJSON = [Char] -> (Object -> Parser Operation) -> Value -> Parser Operation
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Operation" ((Object -> Parser Operation) -> Value -> Parser Operation)
-> (Object -> Parser Operation) -> Value -> Parser Operation
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Bool
-> Maybe Text
-> Maybe Status
-> Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char])
-> Operation
Operation
(Maybe Bool
-> Maybe Text
-> Maybe Status
-> Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char])
-> Operation)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Status
-> Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char])
-> Operation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"done")
Parser
(Maybe Text
-> Maybe Status
-> Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char])
-> Operation)
-> Parser (Maybe Text)
-> Parser
(Maybe Status
-> Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char])
-> Operation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser
(Maybe Status
-> Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char])
-> Operation)
-> Parser (Maybe Status)
-> Parser
(Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char]) -> Operation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"error")
Parser
(Maybe (Map [Char] [Char])
-> Maybe (Map [Char] [Char]) -> Operation)
-> Parser (Maybe (Map [Char] [Char]))
-> Parser (Maybe (Map [Char] [Char]) -> Operation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe (Map [Char] [Char]))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"metadata")
Parser (Maybe (Map [Char] [Char]) -> Operation)
-> Parser (Maybe (Map [Char] [Char])) -> Parser Operation
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe (Map [Char] [Char]))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"response")
instance A.ToJSON Operation where
toJSON :: Operation -> Value
toJSON Operation {Maybe Bool
Maybe Text
Maybe (Map [Char] [Char])
Maybe Status
operationDone :: Operation -> Maybe Bool
operationName :: Operation -> Maybe Text
operationError :: Operation -> Maybe Status
operationMetadata :: Operation -> Maybe (Map [Char] [Char])
operationResponse :: Operation -> Maybe (Map [Char] [Char])
operationDone :: Maybe Bool
operationName :: Maybe Text
operationError :: Maybe Status
operationMetadata :: Maybe (Map [Char] [Char])
operationResponse :: Maybe (Map [Char] [Char])
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"done" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
operationDone
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
operationName
, Key
"error" Key -> Maybe Status -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Status
operationError
, Key
"metadata" Key -> Maybe (Map [Char] [Char]) -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe (Map [Char] [Char])
operationMetadata
, Key
"response" Key -> Maybe (Map [Char] [Char]) -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe (Map [Char] [Char])
operationResponse
]
mkOperation ::
Operation
mkOperation :: Operation
mkOperation =
Operation
{ operationDone :: Maybe Bool
operationDone = Maybe Bool
forall a. Maybe a
Nothing
, operationName :: Maybe Text
operationName = Maybe Text
forall a. Maybe a
Nothing
, operationError :: Maybe Status
operationError = Maybe Status
forall a. Maybe a
Nothing
, operationMetadata :: Maybe (Map [Char] [Char])
operationMetadata = Maybe (Map [Char] [Char])
forall a. Maybe a
Nothing
, operationResponse :: Maybe (Map [Char] [Char])
operationResponse = Maybe (Map [Char] [Char])
forall a. Maybe a
Nothing
}
data Part = Part
{ Part -> Maybe Blob
partInlineData :: !(Maybe Blob)
, Part -> Maybe FunctionResponse
partFunctionResponse :: !(Maybe FunctionResponse)
, Part -> Maybe CodeExecutionResult
partCodeExecutionResult :: !(Maybe CodeExecutionResult)
, Part -> Maybe FileData
partFileData :: !(Maybe FileData)
, Part -> Maybe ExecutableCode
partExecutableCode :: !(Maybe ExecutableCode)
, Part -> Maybe VideoMetadata
partVideoMetadata :: !(Maybe VideoMetadata)
, Part -> Maybe Bool
partThought :: !(Maybe Bool)
, Part -> Maybe Text
partText :: !(Maybe Text)
, Part -> Maybe ByteArray
partThoughtSignature :: !(Maybe ByteArray)
, Part -> Maybe FunctionCall
partFunctionCall :: !(Maybe FunctionCall)
}
deriving (Int -> Part -> ShowS
[Part] -> ShowS
Part -> [Char]
(Int -> Part -> ShowS)
-> (Part -> [Char]) -> ([Part] -> ShowS) -> Show Part
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Part -> ShowS
showsPrec :: Int -> Part -> ShowS
$cshow :: Part -> [Char]
show :: Part -> [Char]
$cshowList :: [Part] -> ShowS
showList :: [Part] -> ShowS
P.Show, Part -> Part -> Bool
(Part -> Part -> Bool) -> (Part -> Part -> Bool) -> Eq Part
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Part -> Part -> Bool
== :: Part -> Part -> Bool
$c/= :: Part -> Part -> Bool
/= :: Part -> Part -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Part where
parseJSON :: Value -> Parser Part
parseJSON = [Char] -> (Object -> Parser Part) -> Value -> Parser Part
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Part" ((Object -> Parser Part) -> Value -> Parser Part)
-> (Object -> Parser Part) -> Value -> Parser Part
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Blob
-> Maybe FunctionResponse
-> Maybe CodeExecutionResult
-> Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part
Part
(Maybe Blob
-> Maybe FunctionResponse
-> Maybe CodeExecutionResult
-> Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
-> Parser (Maybe Blob)
-> Parser
(Maybe FunctionResponse
-> Maybe CodeExecutionResult
-> Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Blob)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"inlineData")
Parser
(Maybe FunctionResponse
-> Maybe CodeExecutionResult
-> Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
-> Parser (Maybe FunctionResponse)
-> Parser
(Maybe CodeExecutionResult
-> Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe FunctionResponse)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"functionResponse")
Parser
(Maybe CodeExecutionResult
-> Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
-> Parser (Maybe CodeExecutionResult)
-> Parser
(Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe CodeExecutionResult)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"codeExecutionResult")
Parser
(Maybe FileData
-> Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
-> Parser (Maybe FileData)
-> Parser
(Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe FileData)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"fileData")
Parser
(Maybe ExecutableCode
-> Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
-> Parser (Maybe ExecutableCode)
-> Parser
(Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe ExecutableCode)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"executableCode")
Parser
(Maybe VideoMetadata
-> Maybe Bool
-> Maybe Text
-> Maybe ByteArray
-> Maybe FunctionCall
-> Part)
-> Parser (Maybe VideoMetadata)
-> Parser
(Maybe Bool
-> Maybe Text -> Maybe ByteArray -> Maybe FunctionCall -> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe VideoMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"videoMetadata")
Parser
(Maybe Bool
-> Maybe Text -> Maybe ByteArray -> Maybe FunctionCall -> Part)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text -> Maybe ByteArray -> Maybe FunctionCall -> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"thought")
Parser
(Maybe Text -> Maybe ByteArray -> Maybe FunctionCall -> Part)
-> Parser (Maybe Text)
-> Parser (Maybe ByteArray -> Maybe FunctionCall -> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"text")
Parser (Maybe ByteArray -> Maybe FunctionCall -> Part)
-> Parser (Maybe ByteArray) -> Parser (Maybe FunctionCall -> Part)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe ByteArray)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"thoughtSignature")
Parser (Maybe FunctionCall -> Part)
-> Parser (Maybe FunctionCall) -> Parser Part
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe FunctionCall)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"functionCall")
instance A.ToJSON Part where
toJSON :: Part -> Value
toJSON Part {Maybe Bool
Maybe Text
Maybe ByteArray
Maybe Blob
Maybe CodeExecutionResult
Maybe ExecutableCode
Maybe FileData
Maybe FunctionCall
Maybe FunctionResponse
Maybe VideoMetadata
partInlineData :: Part -> Maybe Blob
partFunctionResponse :: Part -> Maybe FunctionResponse
partCodeExecutionResult :: Part -> Maybe CodeExecutionResult
partFileData :: Part -> Maybe FileData
partExecutableCode :: Part -> Maybe ExecutableCode
partVideoMetadata :: Part -> Maybe VideoMetadata
partThought :: Part -> Maybe Bool
partText :: Part -> Maybe Text
partThoughtSignature :: Part -> Maybe ByteArray
partFunctionCall :: Part -> Maybe FunctionCall
partInlineData :: Maybe Blob
partFunctionResponse :: Maybe FunctionResponse
partCodeExecutionResult :: Maybe CodeExecutionResult
partFileData :: Maybe FileData
partExecutableCode :: Maybe ExecutableCode
partVideoMetadata :: Maybe VideoMetadata
partThought :: Maybe Bool
partText :: Maybe Text
partThoughtSignature :: Maybe ByteArray
partFunctionCall :: Maybe FunctionCall
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"inlineData" Key -> Maybe Blob -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Blob
partInlineData
, Key
"functionResponse" Key -> Maybe FunctionResponse -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe FunctionResponse
partFunctionResponse
, Key
"codeExecutionResult" Key -> Maybe CodeExecutionResult -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe CodeExecutionResult
partCodeExecutionResult
, Key
"fileData" Key -> Maybe FileData -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe FileData
partFileData
, Key
"executableCode" Key -> Maybe ExecutableCode -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ExecutableCode
partExecutableCode
, Key
"videoMetadata" Key -> Maybe VideoMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe VideoMetadata
partVideoMetadata
, Key
"thought" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
partThought
, Key
"text" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
partText
, Key
"thoughtSignature" Key -> Maybe ByteArray -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ByteArray
partThoughtSignature
, Key
"functionCall" Key -> Maybe FunctionCall -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe FunctionCall
partFunctionCall
]
mkPart ::
Part
mkPart :: Part
mkPart =
Part
{ partInlineData :: Maybe Blob
partInlineData = Maybe Blob
forall a. Maybe a
Nothing
, partFunctionResponse :: Maybe FunctionResponse
partFunctionResponse = Maybe FunctionResponse
forall a. Maybe a
Nothing
, partCodeExecutionResult :: Maybe CodeExecutionResult
partCodeExecutionResult = Maybe CodeExecutionResult
forall a. Maybe a
Nothing
, partFileData :: Maybe FileData
partFileData = Maybe FileData
forall a. Maybe a
Nothing
, partExecutableCode :: Maybe ExecutableCode
partExecutableCode = Maybe ExecutableCode
forall a. Maybe a
Nothing
, partVideoMetadata :: Maybe VideoMetadata
partVideoMetadata = Maybe VideoMetadata
forall a. Maybe a
Nothing
, partThought :: Maybe Bool
partThought = Maybe Bool
forall a. Maybe a
Nothing
, partText :: Maybe Text
partText = Maybe Text
forall a. Maybe a
Nothing
, partThoughtSignature :: Maybe ByteArray
partThoughtSignature = Maybe ByteArray
forall a. Maybe a
Nothing
, partFunctionCall :: Maybe FunctionCall
partFunctionCall = Maybe FunctionCall
forall a. Maybe a
Nothing
}
data Permission = Permission
{ Permission -> Maybe Text
permissionName :: !(Maybe Text)
, Permission -> Maybe E'GranteeType
permissionGranteeType :: !(Maybe E'GranteeType)
, Permission -> E'Role
permissionRole :: !(E'Role)
, Permission -> Maybe Text
permissionEmailAddress :: !(Maybe Text)
}
deriving (Int -> Permission -> ShowS
[Permission] -> ShowS
Permission -> [Char]
(Int -> Permission -> ShowS)
-> (Permission -> [Char])
-> ([Permission] -> ShowS)
-> Show Permission
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Permission -> ShowS
showsPrec :: Int -> Permission -> ShowS
$cshow :: Permission -> [Char]
show :: Permission -> [Char]
$cshowList :: [Permission] -> ShowS
showList :: [Permission] -> ShowS
P.Show, Permission -> Permission -> Bool
(Permission -> Permission -> Bool)
-> (Permission -> Permission -> Bool) -> Eq Permission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Permission -> Permission -> Bool
== :: Permission -> Permission -> Bool
$c/= :: Permission -> Permission -> Bool
/= :: Permission -> Permission -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Permission where
parseJSON :: Value -> Parser Permission
parseJSON = [Char]
-> (Object -> Parser Permission) -> Value -> Parser Permission
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Permission" ((Object -> Parser Permission) -> Value -> Parser Permission)
-> (Object -> Parser Permission) -> Value -> Parser Permission
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text
-> Maybe E'GranteeType -> E'Role -> Maybe Text -> Permission
Permission
(Maybe Text
-> Maybe E'GranteeType -> E'Role -> Maybe Text -> Permission)
-> Parser (Maybe Text)
-> Parser
(Maybe E'GranteeType -> E'Role -> Maybe Text -> Permission)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser (Maybe E'GranteeType -> E'Role -> Maybe Text -> Permission)
-> Parser (Maybe E'GranteeType)
-> Parser (E'Role -> Maybe Text -> Permission)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'GranteeType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"granteeType")
Parser (E'Role -> Maybe Text -> Permission)
-> Parser E'Role -> Parser (Maybe Text -> Permission)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser E'Role
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"role")
Parser (Maybe Text -> Permission)
-> Parser (Maybe Text) -> Parser Permission
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"emailAddress")
instance A.ToJSON Permission where
toJSON :: Permission -> Value
toJSON Permission {Maybe Text
Maybe E'GranteeType
E'Role
permissionName :: Permission -> Maybe Text
permissionGranteeType :: Permission -> Maybe E'GranteeType
permissionRole :: Permission -> E'Role
permissionEmailAddress :: Permission -> Maybe Text
permissionName :: Maybe Text
permissionGranteeType :: Maybe E'GranteeType
permissionRole :: E'Role
permissionEmailAddress :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
permissionName
, Key
"granteeType" Key -> Maybe E'GranteeType -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'GranteeType
permissionGranteeType
, Key
"role" Key -> E'Role -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= E'Role
permissionRole
, Key
"emailAddress" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
permissionEmailAddress
]
mkPermission ::
E'Role ->
Permission
mkPermission :: E'Role -> Permission
mkPermission E'Role
permissionRole =
Permission
{ permissionName :: Maybe Text
permissionName = Maybe Text
forall a. Maybe a
Nothing
, permissionGranteeType :: Maybe E'GranteeType
permissionGranteeType = Maybe E'GranteeType
forall a. Maybe a
Nothing
, E'Role
permissionRole :: E'Role
permissionRole :: E'Role
permissionRole
, permissionEmailAddress :: Maybe Text
permissionEmailAddress = Maybe Text
forall a. Maybe a
Nothing
}
data PrebuiltVoiceConfig = PrebuiltVoiceConfig
{ PrebuiltVoiceConfig -> Maybe Text
prebuiltVoiceConfigVoiceName :: !(Maybe Text)
}
deriving (Int -> PrebuiltVoiceConfig -> ShowS
[PrebuiltVoiceConfig] -> ShowS
PrebuiltVoiceConfig -> [Char]
(Int -> PrebuiltVoiceConfig -> ShowS)
-> (PrebuiltVoiceConfig -> [Char])
-> ([PrebuiltVoiceConfig] -> ShowS)
-> Show PrebuiltVoiceConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrebuiltVoiceConfig -> ShowS
showsPrec :: Int -> PrebuiltVoiceConfig -> ShowS
$cshow :: PrebuiltVoiceConfig -> [Char]
show :: PrebuiltVoiceConfig -> [Char]
$cshowList :: [PrebuiltVoiceConfig] -> ShowS
showList :: [PrebuiltVoiceConfig] -> ShowS
P.Show, PrebuiltVoiceConfig -> PrebuiltVoiceConfig -> Bool
(PrebuiltVoiceConfig -> PrebuiltVoiceConfig -> Bool)
-> (PrebuiltVoiceConfig -> PrebuiltVoiceConfig -> Bool)
-> Eq PrebuiltVoiceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PrebuiltVoiceConfig -> PrebuiltVoiceConfig -> Bool
== :: PrebuiltVoiceConfig -> PrebuiltVoiceConfig -> Bool
$c/= :: PrebuiltVoiceConfig -> PrebuiltVoiceConfig -> Bool
/= :: PrebuiltVoiceConfig -> PrebuiltVoiceConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON PrebuiltVoiceConfig where
parseJSON :: Value -> Parser PrebuiltVoiceConfig
parseJSON = [Char]
-> (Object -> Parser PrebuiltVoiceConfig)
-> Value
-> Parser PrebuiltVoiceConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"PrebuiltVoiceConfig" ((Object -> Parser PrebuiltVoiceConfig)
-> Value -> Parser PrebuiltVoiceConfig)
-> (Object -> Parser PrebuiltVoiceConfig)
-> Value
-> Parser PrebuiltVoiceConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> PrebuiltVoiceConfig
PrebuiltVoiceConfig
(Maybe Text -> PrebuiltVoiceConfig)
-> Parser (Maybe Text) -> Parser PrebuiltVoiceConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"voiceName")
instance A.ToJSON PrebuiltVoiceConfig where
toJSON :: PrebuiltVoiceConfig -> Value
toJSON PrebuiltVoiceConfig {Maybe Text
prebuiltVoiceConfigVoiceName :: PrebuiltVoiceConfig -> Maybe Text
prebuiltVoiceConfigVoiceName :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"voiceName" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
prebuiltVoiceConfigVoiceName
]
mkPrebuiltVoiceConfig ::
PrebuiltVoiceConfig
mkPrebuiltVoiceConfig :: PrebuiltVoiceConfig
mkPrebuiltVoiceConfig =
PrebuiltVoiceConfig
{ prebuiltVoiceConfigVoiceName :: Maybe Text
prebuiltVoiceConfigVoiceName = Maybe Text
forall a. Maybe a
Nothing
}
data PredictLongRunningOperation = PredictLongRunningOperation
{ PredictLongRunningOperation -> Maybe Bool
predictLongRunningOperationDone :: !(Maybe Bool)
, PredictLongRunningOperation -> Maybe Text
predictLongRunningOperationName :: !(Maybe Text)
, PredictLongRunningOperation -> Maybe Status
predictLongRunningOperationError :: !(Maybe Status)
, PredictLongRunningOperation -> Maybe Value
predictLongRunningOperationMetadata :: !(Maybe A.Value)
, PredictLongRunningOperation -> Maybe PredictLongRunningResponse
predictLongRunningOperationResponse :: !(Maybe PredictLongRunningResponse)
}
deriving (Int -> PredictLongRunningOperation -> ShowS
[PredictLongRunningOperation] -> ShowS
PredictLongRunningOperation -> [Char]
(Int -> PredictLongRunningOperation -> ShowS)
-> (PredictLongRunningOperation -> [Char])
-> ([PredictLongRunningOperation] -> ShowS)
-> Show PredictLongRunningOperation
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PredictLongRunningOperation -> ShowS
showsPrec :: Int -> PredictLongRunningOperation -> ShowS
$cshow :: PredictLongRunningOperation -> [Char]
show :: PredictLongRunningOperation -> [Char]
$cshowList :: [PredictLongRunningOperation] -> ShowS
showList :: [PredictLongRunningOperation] -> ShowS
P.Show, PredictLongRunningOperation -> PredictLongRunningOperation -> Bool
(PredictLongRunningOperation
-> PredictLongRunningOperation -> Bool)
-> (PredictLongRunningOperation
-> PredictLongRunningOperation -> Bool)
-> Eq PredictLongRunningOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PredictLongRunningOperation -> PredictLongRunningOperation -> Bool
== :: PredictLongRunningOperation -> PredictLongRunningOperation -> Bool
$c/= :: PredictLongRunningOperation -> PredictLongRunningOperation -> Bool
/= :: PredictLongRunningOperation -> PredictLongRunningOperation -> Bool
P.Eq, P.Typeable)
instance A.FromJSON PredictLongRunningOperation where
parseJSON :: Value -> Parser PredictLongRunningOperation
parseJSON = [Char]
-> (Object -> Parser PredictLongRunningOperation)
-> Value
-> Parser PredictLongRunningOperation
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"PredictLongRunningOperation" ((Object -> Parser PredictLongRunningOperation)
-> Value -> Parser PredictLongRunningOperation)
-> (Object -> Parser PredictLongRunningOperation)
-> Value
-> Parser PredictLongRunningOperation
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Bool
-> Maybe Text
-> Maybe Status
-> Maybe Value
-> Maybe PredictLongRunningResponse
-> PredictLongRunningOperation
PredictLongRunningOperation
(Maybe Bool
-> Maybe Text
-> Maybe Status
-> Maybe Value
-> Maybe PredictLongRunningResponse
-> PredictLongRunningOperation)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Status
-> Maybe Value
-> Maybe PredictLongRunningResponse
-> PredictLongRunningOperation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"done")
Parser
(Maybe Text
-> Maybe Status
-> Maybe Value
-> Maybe PredictLongRunningResponse
-> PredictLongRunningOperation)
-> Parser (Maybe Text)
-> Parser
(Maybe Status
-> Maybe Value
-> Maybe PredictLongRunningResponse
-> PredictLongRunningOperation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser
(Maybe Status
-> Maybe Value
-> Maybe PredictLongRunningResponse
-> PredictLongRunningOperation)
-> Parser (Maybe Status)
-> Parser
(Maybe Value
-> Maybe PredictLongRunningResponse -> PredictLongRunningOperation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"error")
Parser
(Maybe Value
-> Maybe PredictLongRunningResponse -> PredictLongRunningOperation)
-> Parser (Maybe Value)
-> Parser
(Maybe PredictLongRunningResponse -> PredictLongRunningOperation)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"metadata")
Parser
(Maybe PredictLongRunningResponse -> PredictLongRunningOperation)
-> Parser (Maybe PredictLongRunningResponse)
-> Parser PredictLongRunningOperation
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe PredictLongRunningResponse)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"response")
instance A.ToJSON PredictLongRunningOperation where
toJSON :: PredictLongRunningOperation -> Value
toJSON PredictLongRunningOperation {Maybe Bool
Maybe Value
Maybe Text
Maybe PredictLongRunningResponse
Maybe Status
predictLongRunningOperationDone :: PredictLongRunningOperation -> Maybe Bool
predictLongRunningOperationName :: PredictLongRunningOperation -> Maybe Text
predictLongRunningOperationError :: PredictLongRunningOperation -> Maybe Status
predictLongRunningOperationMetadata :: PredictLongRunningOperation -> Maybe Value
predictLongRunningOperationResponse :: PredictLongRunningOperation -> Maybe PredictLongRunningResponse
predictLongRunningOperationDone :: Maybe Bool
predictLongRunningOperationName :: Maybe Text
predictLongRunningOperationError :: Maybe Status
predictLongRunningOperationMetadata :: Maybe Value
predictLongRunningOperationResponse :: Maybe PredictLongRunningResponse
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"done" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
predictLongRunningOperationDone
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
predictLongRunningOperationName
, Key
"error" Key -> Maybe Status -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Status
predictLongRunningOperationError
, Key
"metadata" Key -> Maybe Value -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Value
predictLongRunningOperationMetadata
, Key
"response" Key -> Maybe PredictLongRunningResponse -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe PredictLongRunningResponse
predictLongRunningOperationResponse
]
mkPredictLongRunningOperation ::
PredictLongRunningOperation
mkPredictLongRunningOperation :: PredictLongRunningOperation
mkPredictLongRunningOperation =
PredictLongRunningOperation
{ predictLongRunningOperationDone :: Maybe Bool
predictLongRunningOperationDone = Maybe Bool
forall a. Maybe a
Nothing
, predictLongRunningOperationName :: Maybe Text
predictLongRunningOperationName = Maybe Text
forall a. Maybe a
Nothing
, predictLongRunningOperationError :: Maybe Status
predictLongRunningOperationError = Maybe Status
forall a. Maybe a
Nothing
, predictLongRunningOperationMetadata :: Maybe Value
predictLongRunningOperationMetadata = Maybe Value
forall a. Maybe a
Nothing
, predictLongRunningOperationResponse :: Maybe PredictLongRunningResponse
predictLongRunningOperationResponse = Maybe PredictLongRunningResponse
forall a. Maybe a
Nothing
}
data PredictLongRunningRequest = PredictLongRunningRequest
{ PredictLongRunningRequest -> Maybe [Char]
predictLongRunningRequestParameters :: !(Maybe String)
, PredictLongRunningRequest -> [[Char]]
predictLongRunningRequestInstances :: !([String])
}
deriving (Int -> PredictLongRunningRequest -> ShowS
[PredictLongRunningRequest] -> ShowS
PredictLongRunningRequest -> [Char]
(Int -> PredictLongRunningRequest -> ShowS)
-> (PredictLongRunningRequest -> [Char])
-> ([PredictLongRunningRequest] -> ShowS)
-> Show PredictLongRunningRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PredictLongRunningRequest -> ShowS
showsPrec :: Int -> PredictLongRunningRequest -> ShowS
$cshow :: PredictLongRunningRequest -> [Char]
show :: PredictLongRunningRequest -> [Char]
$cshowList :: [PredictLongRunningRequest] -> ShowS
showList :: [PredictLongRunningRequest] -> ShowS
P.Show, PredictLongRunningRequest -> PredictLongRunningRequest -> Bool
(PredictLongRunningRequest -> PredictLongRunningRequest -> Bool)
-> (PredictLongRunningRequest -> PredictLongRunningRequest -> Bool)
-> Eq PredictLongRunningRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PredictLongRunningRequest -> PredictLongRunningRequest -> Bool
== :: PredictLongRunningRequest -> PredictLongRunningRequest -> Bool
$c/= :: PredictLongRunningRequest -> PredictLongRunningRequest -> Bool
/= :: PredictLongRunningRequest -> PredictLongRunningRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON PredictLongRunningRequest where
parseJSON :: Value -> Parser PredictLongRunningRequest
parseJSON = [Char]
-> (Object -> Parser PredictLongRunningRequest)
-> Value
-> Parser PredictLongRunningRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"PredictLongRunningRequest" ((Object -> Parser PredictLongRunningRequest)
-> Value -> Parser PredictLongRunningRequest)
-> (Object -> Parser PredictLongRunningRequest)
-> Value
-> Parser PredictLongRunningRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Char] -> [[Char]] -> PredictLongRunningRequest
PredictLongRunningRequest
(Maybe [Char] -> [[Char]] -> PredictLongRunningRequest)
-> Parser (Maybe [Char])
-> Parser ([[Char]] -> PredictLongRunningRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Char])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"parameters")
Parser ([[Char]] -> PredictLongRunningRequest)
-> Parser [[Char]] -> Parser PredictLongRunningRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser [[Char]]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"instances")
instance A.ToJSON PredictLongRunningRequest where
toJSON :: PredictLongRunningRequest -> Value
toJSON PredictLongRunningRequest {[[Char]]
Maybe [Char]
predictLongRunningRequestParameters :: PredictLongRunningRequest -> Maybe [Char]
predictLongRunningRequestInstances :: PredictLongRunningRequest -> [[Char]]
predictLongRunningRequestParameters :: Maybe [Char]
predictLongRunningRequestInstances :: [[Char]]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"parameters" Key -> Maybe [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Char]
predictLongRunningRequestParameters
, Key
"instances" Key -> [[Char]] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [[Char]]
predictLongRunningRequestInstances
]
mkPredictLongRunningRequest ::
[String] ->
PredictLongRunningRequest
mkPredictLongRunningRequest :: [[Char]] -> PredictLongRunningRequest
mkPredictLongRunningRequest [[Char]]
predictLongRunningRequestInstances =
PredictLongRunningRequest
{ predictLongRunningRequestParameters :: Maybe [Char]
predictLongRunningRequestParameters = Maybe [Char]
forall a. Maybe a
Nothing
, [[Char]]
predictLongRunningRequestInstances :: [[Char]]
predictLongRunningRequestInstances :: [[Char]]
predictLongRunningRequestInstances
}
data PredictLongRunningResponse = PredictLongRunningResponse
{ PredictLongRunningResponse -> Maybe GenerateVideoResponse
predictLongRunningResponseGenerateVideoResponse :: !(Maybe GenerateVideoResponse)
}
deriving (Int -> PredictLongRunningResponse -> ShowS
[PredictLongRunningResponse] -> ShowS
PredictLongRunningResponse -> [Char]
(Int -> PredictLongRunningResponse -> ShowS)
-> (PredictLongRunningResponse -> [Char])
-> ([PredictLongRunningResponse] -> ShowS)
-> Show PredictLongRunningResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PredictLongRunningResponse -> ShowS
showsPrec :: Int -> PredictLongRunningResponse -> ShowS
$cshow :: PredictLongRunningResponse -> [Char]
show :: PredictLongRunningResponse -> [Char]
$cshowList :: [PredictLongRunningResponse] -> ShowS
showList :: [PredictLongRunningResponse] -> ShowS
P.Show, PredictLongRunningResponse -> PredictLongRunningResponse -> Bool
(PredictLongRunningResponse -> PredictLongRunningResponse -> Bool)
-> (PredictLongRunningResponse
-> PredictLongRunningResponse -> Bool)
-> Eq PredictLongRunningResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PredictLongRunningResponse -> PredictLongRunningResponse -> Bool
== :: PredictLongRunningResponse -> PredictLongRunningResponse -> Bool
$c/= :: PredictLongRunningResponse -> PredictLongRunningResponse -> Bool
/= :: PredictLongRunningResponse -> PredictLongRunningResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON PredictLongRunningResponse where
parseJSON :: Value -> Parser PredictLongRunningResponse
parseJSON = [Char]
-> (Object -> Parser PredictLongRunningResponse)
-> Value
-> Parser PredictLongRunningResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"PredictLongRunningResponse" ((Object -> Parser PredictLongRunningResponse)
-> Value -> Parser PredictLongRunningResponse)
-> (Object -> Parser PredictLongRunningResponse)
-> Value
-> Parser PredictLongRunningResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe GenerateVideoResponse -> PredictLongRunningResponse
PredictLongRunningResponse
(Maybe GenerateVideoResponse -> PredictLongRunningResponse)
-> Parser (Maybe GenerateVideoResponse)
-> Parser PredictLongRunningResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe GenerateVideoResponse)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"generateVideoResponse")
instance A.ToJSON PredictLongRunningResponse where
toJSON :: PredictLongRunningResponse -> Value
toJSON PredictLongRunningResponse {Maybe GenerateVideoResponse
predictLongRunningResponseGenerateVideoResponse :: PredictLongRunningResponse -> Maybe GenerateVideoResponse
predictLongRunningResponseGenerateVideoResponse :: Maybe GenerateVideoResponse
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"generateVideoResponse" Key -> Maybe GenerateVideoResponse -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GenerateVideoResponse
predictLongRunningResponseGenerateVideoResponse
]
mkPredictLongRunningResponse ::
PredictLongRunningResponse
mkPredictLongRunningResponse :: PredictLongRunningResponse
mkPredictLongRunningResponse =
PredictLongRunningResponse
{ predictLongRunningResponseGenerateVideoResponse :: Maybe GenerateVideoResponse
predictLongRunningResponseGenerateVideoResponse = Maybe GenerateVideoResponse
forall a. Maybe a
Nothing
}
data PredictRequest = PredictRequest
{ PredictRequest -> [[Char]]
predictRequestInstances :: !([String])
, PredictRequest -> Maybe [Char]
predictRequestParameters :: !(Maybe String)
}
deriving (Int -> PredictRequest -> ShowS
[PredictRequest] -> ShowS
PredictRequest -> [Char]
(Int -> PredictRequest -> ShowS)
-> (PredictRequest -> [Char])
-> ([PredictRequest] -> ShowS)
-> Show PredictRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PredictRequest -> ShowS
showsPrec :: Int -> PredictRequest -> ShowS
$cshow :: PredictRequest -> [Char]
show :: PredictRequest -> [Char]
$cshowList :: [PredictRequest] -> ShowS
showList :: [PredictRequest] -> ShowS
P.Show, PredictRequest -> PredictRequest -> Bool
(PredictRequest -> PredictRequest -> Bool)
-> (PredictRequest -> PredictRequest -> Bool) -> Eq PredictRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PredictRequest -> PredictRequest -> Bool
== :: PredictRequest -> PredictRequest -> Bool
$c/= :: PredictRequest -> PredictRequest -> Bool
/= :: PredictRequest -> PredictRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON PredictRequest where
parseJSON :: Value -> Parser PredictRequest
parseJSON = [Char]
-> (Object -> Parser PredictRequest)
-> Value
-> Parser PredictRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"PredictRequest" ((Object -> Parser PredictRequest)
-> Value -> Parser PredictRequest)
-> (Object -> Parser PredictRequest)
-> Value
-> Parser PredictRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[[Char]] -> Maybe [Char] -> PredictRequest
PredictRequest
([[Char]] -> Maybe [Char] -> PredictRequest)
-> Parser [[Char]] -> Parser (Maybe [Char] -> PredictRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser [[Char]]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"instances")
Parser (Maybe [Char] -> PredictRequest)
-> Parser (Maybe [Char]) -> Parser PredictRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Char])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"parameters")
instance A.ToJSON PredictRequest where
toJSON :: PredictRequest -> Value
toJSON PredictRequest {[[Char]]
Maybe [Char]
predictRequestInstances :: PredictRequest -> [[Char]]
predictRequestParameters :: PredictRequest -> Maybe [Char]
predictRequestInstances :: [[Char]]
predictRequestParameters :: Maybe [Char]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"instances" Key -> [[Char]] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [[Char]]
predictRequestInstances
, Key
"parameters" Key -> Maybe [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Char]
predictRequestParameters
]
mkPredictRequest ::
[String] ->
PredictRequest
mkPredictRequest :: [[Char]] -> PredictRequest
mkPredictRequest [[Char]]
predictRequestInstances =
PredictRequest
{ [[Char]]
predictRequestInstances :: [[Char]]
predictRequestInstances :: [[Char]]
predictRequestInstances
, predictRequestParameters :: Maybe [Char]
predictRequestParameters = Maybe [Char]
forall a. Maybe a
Nothing
}
data PredictResponse = PredictResponse
{ PredictResponse -> Maybe [[Char]]
predictResponsePredictions :: !(Maybe [String])
}
deriving (Int -> PredictResponse -> ShowS
[PredictResponse] -> ShowS
PredictResponse -> [Char]
(Int -> PredictResponse -> ShowS)
-> (PredictResponse -> [Char])
-> ([PredictResponse] -> ShowS)
-> Show PredictResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PredictResponse -> ShowS
showsPrec :: Int -> PredictResponse -> ShowS
$cshow :: PredictResponse -> [Char]
show :: PredictResponse -> [Char]
$cshowList :: [PredictResponse] -> ShowS
showList :: [PredictResponse] -> ShowS
P.Show, PredictResponse -> PredictResponse -> Bool
(PredictResponse -> PredictResponse -> Bool)
-> (PredictResponse -> PredictResponse -> Bool)
-> Eq PredictResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PredictResponse -> PredictResponse -> Bool
== :: PredictResponse -> PredictResponse -> Bool
$c/= :: PredictResponse -> PredictResponse -> Bool
/= :: PredictResponse -> PredictResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON PredictResponse where
parseJSON :: Value -> Parser PredictResponse
parseJSON = [Char]
-> (Object -> Parser PredictResponse)
-> Value
-> Parser PredictResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"PredictResponse" ((Object -> Parser PredictResponse)
-> Value -> Parser PredictResponse)
-> (Object -> Parser PredictResponse)
-> Value
-> Parser PredictResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [[Char]] -> PredictResponse
PredictResponse
(Maybe [[Char]] -> PredictResponse)
-> Parser (Maybe [[Char]]) -> Parser PredictResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [[Char]])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"predictions")
instance A.ToJSON PredictResponse where
toJSON :: PredictResponse -> Value
toJSON PredictResponse {Maybe [[Char]]
predictResponsePredictions :: PredictResponse -> Maybe [[Char]]
predictResponsePredictions :: Maybe [[Char]]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"predictions" Key -> Maybe [[Char]] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [[Char]]
predictResponsePredictions
]
mkPredictResponse ::
PredictResponse
mkPredictResponse :: PredictResponse
mkPredictResponse =
PredictResponse
{ predictResponsePredictions :: Maybe [[Char]]
predictResponsePredictions = Maybe [[Char]]
forall a. Maybe a
Nothing
}
data PromptFeedback = PromptFeedback
{ PromptFeedback -> Maybe E'BlockReason
promptFeedbackBlockReason :: !(Maybe E'BlockReason)
, PromptFeedback -> Maybe [SafetyRating]
promptFeedbackSafetyRatings :: !(Maybe [SafetyRating])
}
deriving (Int -> PromptFeedback -> ShowS
[PromptFeedback] -> ShowS
PromptFeedback -> [Char]
(Int -> PromptFeedback -> ShowS)
-> (PromptFeedback -> [Char])
-> ([PromptFeedback] -> ShowS)
-> Show PromptFeedback
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PromptFeedback -> ShowS
showsPrec :: Int -> PromptFeedback -> ShowS
$cshow :: PromptFeedback -> [Char]
show :: PromptFeedback -> [Char]
$cshowList :: [PromptFeedback] -> ShowS
showList :: [PromptFeedback] -> ShowS
P.Show, PromptFeedback -> PromptFeedback -> Bool
(PromptFeedback -> PromptFeedback -> Bool)
-> (PromptFeedback -> PromptFeedback -> Bool) -> Eq PromptFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PromptFeedback -> PromptFeedback -> Bool
== :: PromptFeedback -> PromptFeedback -> Bool
$c/= :: PromptFeedback -> PromptFeedback -> Bool
/= :: PromptFeedback -> PromptFeedback -> Bool
P.Eq, P.Typeable)
instance A.FromJSON PromptFeedback where
parseJSON :: Value -> Parser PromptFeedback
parseJSON = [Char]
-> (Object -> Parser PromptFeedback)
-> Value
-> Parser PromptFeedback
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"PromptFeedback" ((Object -> Parser PromptFeedback)
-> Value -> Parser PromptFeedback)
-> (Object -> Parser PromptFeedback)
-> Value
-> Parser PromptFeedback
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe E'BlockReason -> Maybe [SafetyRating] -> PromptFeedback
PromptFeedback
(Maybe E'BlockReason -> Maybe [SafetyRating] -> PromptFeedback)
-> Parser (Maybe E'BlockReason)
-> Parser (Maybe [SafetyRating] -> PromptFeedback)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe E'BlockReason)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"blockReason")
Parser (Maybe [SafetyRating] -> PromptFeedback)
-> Parser (Maybe [SafetyRating]) -> Parser PromptFeedback
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [SafetyRating])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetyRatings")
instance A.ToJSON PromptFeedback where
toJSON :: PromptFeedback -> Value
toJSON PromptFeedback {Maybe [SafetyRating]
Maybe E'BlockReason
promptFeedbackBlockReason :: PromptFeedback -> Maybe E'BlockReason
promptFeedbackSafetyRatings :: PromptFeedback -> Maybe [SafetyRating]
promptFeedbackBlockReason :: Maybe E'BlockReason
promptFeedbackSafetyRatings :: Maybe [SafetyRating]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"blockReason" Key -> Maybe E'BlockReason -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'BlockReason
promptFeedbackBlockReason
, Key
"safetyRatings" Key -> Maybe [SafetyRating] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetyRating]
promptFeedbackSafetyRatings
]
mkPromptFeedback ::
PromptFeedback
mkPromptFeedback :: PromptFeedback
mkPromptFeedback =
PromptFeedback
{ promptFeedbackBlockReason :: Maybe E'BlockReason
promptFeedbackBlockReason = Maybe E'BlockReason
forall a. Maybe a
Nothing
, promptFeedbackSafetyRatings :: Maybe [SafetyRating]
promptFeedbackSafetyRatings = Maybe [SafetyRating]
forall a. Maybe a
Nothing
}
data QueryCorpusRequest = QueryCorpusRequest
{ QueryCorpusRequest -> Maybe [MetadataFilter]
queryCorpusRequestMetadataFilters :: !(Maybe [MetadataFilter])
, QueryCorpusRequest -> Text
queryCorpusRequestQuery :: !(Text)
, QueryCorpusRequest -> Maybe Int
queryCorpusRequestResultsCount :: !(Maybe Int)
}
deriving (Int -> QueryCorpusRequest -> ShowS
[QueryCorpusRequest] -> ShowS
QueryCorpusRequest -> [Char]
(Int -> QueryCorpusRequest -> ShowS)
-> (QueryCorpusRequest -> [Char])
-> ([QueryCorpusRequest] -> ShowS)
-> Show QueryCorpusRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryCorpusRequest -> ShowS
showsPrec :: Int -> QueryCorpusRequest -> ShowS
$cshow :: QueryCorpusRequest -> [Char]
show :: QueryCorpusRequest -> [Char]
$cshowList :: [QueryCorpusRequest] -> ShowS
showList :: [QueryCorpusRequest] -> ShowS
P.Show, QueryCorpusRequest -> QueryCorpusRequest -> Bool
(QueryCorpusRequest -> QueryCorpusRequest -> Bool)
-> (QueryCorpusRequest -> QueryCorpusRequest -> Bool)
-> Eq QueryCorpusRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryCorpusRequest -> QueryCorpusRequest -> Bool
== :: QueryCorpusRequest -> QueryCorpusRequest -> Bool
$c/= :: QueryCorpusRequest -> QueryCorpusRequest -> Bool
/= :: QueryCorpusRequest -> QueryCorpusRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON QueryCorpusRequest where
parseJSON :: Value -> Parser QueryCorpusRequest
parseJSON = [Char]
-> (Object -> Parser QueryCorpusRequest)
-> Value
-> Parser QueryCorpusRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"QueryCorpusRequest" ((Object -> Parser QueryCorpusRequest)
-> Value -> Parser QueryCorpusRequest)
-> (Object -> Parser QueryCorpusRequest)
-> Value
-> Parser QueryCorpusRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [MetadataFilter] -> Text -> Maybe Int -> QueryCorpusRequest
QueryCorpusRequest
(Maybe [MetadataFilter] -> Text -> Maybe Int -> QueryCorpusRequest)
-> Parser (Maybe [MetadataFilter])
-> Parser (Text -> Maybe Int -> QueryCorpusRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [MetadataFilter])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"metadataFilters")
Parser (Text -> Maybe Int -> QueryCorpusRequest)
-> Parser Text -> Parser (Maybe Int -> QueryCorpusRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"query")
Parser (Maybe Int -> QueryCorpusRequest)
-> Parser (Maybe Int) -> Parser QueryCorpusRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"resultsCount")
instance A.ToJSON QueryCorpusRequest where
toJSON :: QueryCorpusRequest -> Value
toJSON QueryCorpusRequest {Maybe Int
Maybe [MetadataFilter]
Text
queryCorpusRequestMetadataFilters :: QueryCorpusRequest -> Maybe [MetadataFilter]
queryCorpusRequestQuery :: QueryCorpusRequest -> Text
queryCorpusRequestResultsCount :: QueryCorpusRequest -> Maybe Int
queryCorpusRequestMetadataFilters :: Maybe [MetadataFilter]
queryCorpusRequestQuery :: Text
queryCorpusRequestResultsCount :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"metadataFilters" Key -> Maybe [MetadataFilter] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [MetadataFilter]
queryCorpusRequestMetadataFilters
, Key
"query" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
queryCorpusRequestQuery
, Key
"resultsCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
queryCorpusRequestResultsCount
]
mkQueryCorpusRequest ::
Text ->
QueryCorpusRequest
mkQueryCorpusRequest :: Text -> QueryCorpusRequest
mkQueryCorpusRequest Text
queryCorpusRequestQuery =
QueryCorpusRequest
{ queryCorpusRequestMetadataFilters :: Maybe [MetadataFilter]
queryCorpusRequestMetadataFilters = Maybe [MetadataFilter]
forall a. Maybe a
Nothing
, Text
queryCorpusRequestQuery :: Text
queryCorpusRequestQuery :: Text
queryCorpusRequestQuery
, queryCorpusRequestResultsCount :: Maybe Int
queryCorpusRequestResultsCount = Maybe Int
forall a. Maybe a
Nothing
}
data QueryCorpusResponse = QueryCorpusResponse
{ QueryCorpusResponse -> Maybe [RelevantChunk]
queryCorpusResponseRelevantChunks :: !(Maybe [RelevantChunk])
}
deriving (Int -> QueryCorpusResponse -> ShowS
[QueryCorpusResponse] -> ShowS
QueryCorpusResponse -> [Char]
(Int -> QueryCorpusResponse -> ShowS)
-> (QueryCorpusResponse -> [Char])
-> ([QueryCorpusResponse] -> ShowS)
-> Show QueryCorpusResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryCorpusResponse -> ShowS
showsPrec :: Int -> QueryCorpusResponse -> ShowS
$cshow :: QueryCorpusResponse -> [Char]
show :: QueryCorpusResponse -> [Char]
$cshowList :: [QueryCorpusResponse] -> ShowS
showList :: [QueryCorpusResponse] -> ShowS
P.Show, QueryCorpusResponse -> QueryCorpusResponse -> Bool
(QueryCorpusResponse -> QueryCorpusResponse -> Bool)
-> (QueryCorpusResponse -> QueryCorpusResponse -> Bool)
-> Eq QueryCorpusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryCorpusResponse -> QueryCorpusResponse -> Bool
== :: QueryCorpusResponse -> QueryCorpusResponse -> Bool
$c/= :: QueryCorpusResponse -> QueryCorpusResponse -> Bool
/= :: QueryCorpusResponse -> QueryCorpusResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON QueryCorpusResponse where
parseJSON :: Value -> Parser QueryCorpusResponse
parseJSON = [Char]
-> (Object -> Parser QueryCorpusResponse)
-> Value
-> Parser QueryCorpusResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"QueryCorpusResponse" ((Object -> Parser QueryCorpusResponse)
-> Value -> Parser QueryCorpusResponse)
-> (Object -> Parser QueryCorpusResponse)
-> Value
-> Parser QueryCorpusResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [RelevantChunk] -> QueryCorpusResponse
QueryCorpusResponse
(Maybe [RelevantChunk] -> QueryCorpusResponse)
-> Parser (Maybe [RelevantChunk]) -> Parser QueryCorpusResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [RelevantChunk])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"relevantChunks")
instance A.ToJSON QueryCorpusResponse where
toJSON :: QueryCorpusResponse -> Value
toJSON QueryCorpusResponse {Maybe [RelevantChunk]
queryCorpusResponseRelevantChunks :: QueryCorpusResponse -> Maybe [RelevantChunk]
queryCorpusResponseRelevantChunks :: Maybe [RelevantChunk]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"relevantChunks" Key -> Maybe [RelevantChunk] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [RelevantChunk]
queryCorpusResponseRelevantChunks
]
mkQueryCorpusResponse ::
QueryCorpusResponse
mkQueryCorpusResponse :: QueryCorpusResponse
mkQueryCorpusResponse =
QueryCorpusResponse
{ queryCorpusResponseRelevantChunks :: Maybe [RelevantChunk]
queryCorpusResponseRelevantChunks = Maybe [RelevantChunk]
forall a. Maybe a
Nothing
}
data QueryDocumentRequest = QueryDocumentRequest
{ QueryDocumentRequest -> Text
queryDocumentRequestQuery :: !(Text)
, QueryDocumentRequest -> Maybe Int
queryDocumentRequestResultsCount :: !(Maybe Int)
, QueryDocumentRequest -> Maybe [MetadataFilter]
queryDocumentRequestMetadataFilters :: !(Maybe [MetadataFilter])
}
deriving (Int -> QueryDocumentRequest -> ShowS
[QueryDocumentRequest] -> ShowS
QueryDocumentRequest -> [Char]
(Int -> QueryDocumentRequest -> ShowS)
-> (QueryDocumentRequest -> [Char])
-> ([QueryDocumentRequest] -> ShowS)
-> Show QueryDocumentRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryDocumentRequest -> ShowS
showsPrec :: Int -> QueryDocumentRequest -> ShowS
$cshow :: QueryDocumentRequest -> [Char]
show :: QueryDocumentRequest -> [Char]
$cshowList :: [QueryDocumentRequest] -> ShowS
showList :: [QueryDocumentRequest] -> ShowS
P.Show, QueryDocumentRequest -> QueryDocumentRequest -> Bool
(QueryDocumentRequest -> QueryDocumentRequest -> Bool)
-> (QueryDocumentRequest -> QueryDocumentRequest -> Bool)
-> Eq QueryDocumentRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryDocumentRequest -> QueryDocumentRequest -> Bool
== :: QueryDocumentRequest -> QueryDocumentRequest -> Bool
$c/= :: QueryDocumentRequest -> QueryDocumentRequest -> Bool
/= :: QueryDocumentRequest -> QueryDocumentRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON QueryDocumentRequest where
parseJSON :: Value -> Parser QueryDocumentRequest
parseJSON = [Char]
-> (Object -> Parser QueryDocumentRequest)
-> Value
-> Parser QueryDocumentRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"QueryDocumentRequest" ((Object -> Parser QueryDocumentRequest)
-> Value -> Parser QueryDocumentRequest)
-> (Object -> Parser QueryDocumentRequest)
-> Value
-> Parser QueryDocumentRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Text -> Maybe Int -> Maybe [MetadataFilter] -> QueryDocumentRequest
QueryDocumentRequest
(Text
-> Maybe Int -> Maybe [MetadataFilter] -> QueryDocumentRequest)
-> Parser Text
-> Parser
(Maybe Int -> Maybe [MetadataFilter] -> QueryDocumentRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"query")
Parser
(Maybe Int -> Maybe [MetadataFilter] -> QueryDocumentRequest)
-> Parser (Maybe Int)
-> Parser (Maybe [MetadataFilter] -> QueryDocumentRequest)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"resultsCount")
Parser (Maybe [MetadataFilter] -> QueryDocumentRequest)
-> Parser (Maybe [MetadataFilter]) -> Parser QueryDocumentRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [MetadataFilter])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"metadataFilters")
instance A.ToJSON QueryDocumentRequest where
toJSON :: QueryDocumentRequest -> Value
toJSON QueryDocumentRequest {Maybe Int
Maybe [MetadataFilter]
Text
queryDocumentRequestQuery :: QueryDocumentRequest -> Text
queryDocumentRequestResultsCount :: QueryDocumentRequest -> Maybe Int
queryDocumentRequestMetadataFilters :: QueryDocumentRequest -> Maybe [MetadataFilter]
queryDocumentRequestQuery :: Text
queryDocumentRequestResultsCount :: Maybe Int
queryDocumentRequestMetadataFilters :: Maybe [MetadataFilter]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"query" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
queryDocumentRequestQuery
, Key
"resultsCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
queryDocumentRequestResultsCount
, Key
"metadataFilters" Key -> Maybe [MetadataFilter] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [MetadataFilter]
queryDocumentRequestMetadataFilters
]
mkQueryDocumentRequest ::
Text ->
QueryDocumentRequest
mkQueryDocumentRequest :: Text -> QueryDocumentRequest
mkQueryDocumentRequest Text
queryDocumentRequestQuery =
QueryDocumentRequest
{ Text
queryDocumentRequestQuery :: Text
queryDocumentRequestQuery :: Text
queryDocumentRequestQuery
, queryDocumentRequestResultsCount :: Maybe Int
queryDocumentRequestResultsCount = Maybe Int
forall a. Maybe a
Nothing
, queryDocumentRequestMetadataFilters :: Maybe [MetadataFilter]
queryDocumentRequestMetadataFilters = Maybe [MetadataFilter]
forall a. Maybe a
Nothing
}
data QueryDocumentResponse = QueryDocumentResponse
{ QueryDocumentResponse -> Maybe [RelevantChunk]
queryDocumentResponseRelevantChunks :: !(Maybe [RelevantChunk])
}
deriving (Int -> QueryDocumentResponse -> ShowS
[QueryDocumentResponse] -> ShowS
QueryDocumentResponse -> [Char]
(Int -> QueryDocumentResponse -> ShowS)
-> (QueryDocumentResponse -> [Char])
-> ([QueryDocumentResponse] -> ShowS)
-> Show QueryDocumentResponse
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryDocumentResponse -> ShowS
showsPrec :: Int -> QueryDocumentResponse -> ShowS
$cshow :: QueryDocumentResponse -> [Char]
show :: QueryDocumentResponse -> [Char]
$cshowList :: [QueryDocumentResponse] -> ShowS
showList :: [QueryDocumentResponse] -> ShowS
P.Show, QueryDocumentResponse -> QueryDocumentResponse -> Bool
(QueryDocumentResponse -> QueryDocumentResponse -> Bool)
-> (QueryDocumentResponse -> QueryDocumentResponse -> Bool)
-> Eq QueryDocumentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryDocumentResponse -> QueryDocumentResponse -> Bool
== :: QueryDocumentResponse -> QueryDocumentResponse -> Bool
$c/= :: QueryDocumentResponse -> QueryDocumentResponse -> Bool
/= :: QueryDocumentResponse -> QueryDocumentResponse -> Bool
P.Eq, P.Typeable)
instance A.FromJSON QueryDocumentResponse where
parseJSON :: Value -> Parser QueryDocumentResponse
parseJSON = [Char]
-> (Object -> Parser QueryDocumentResponse)
-> Value
-> Parser QueryDocumentResponse
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"QueryDocumentResponse" ((Object -> Parser QueryDocumentResponse)
-> Value -> Parser QueryDocumentResponse)
-> (Object -> Parser QueryDocumentResponse)
-> Value
-> Parser QueryDocumentResponse
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [RelevantChunk] -> QueryDocumentResponse
QueryDocumentResponse
(Maybe [RelevantChunk] -> QueryDocumentResponse)
-> Parser (Maybe [RelevantChunk]) -> Parser QueryDocumentResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [RelevantChunk])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"relevantChunks")
instance A.ToJSON QueryDocumentResponse where
toJSON :: QueryDocumentResponse -> Value
toJSON QueryDocumentResponse {Maybe [RelevantChunk]
queryDocumentResponseRelevantChunks :: QueryDocumentResponse -> Maybe [RelevantChunk]
queryDocumentResponseRelevantChunks :: Maybe [RelevantChunk]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"relevantChunks" Key -> Maybe [RelevantChunk] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [RelevantChunk]
queryDocumentResponseRelevantChunks
]
mkQueryDocumentResponse ::
QueryDocumentResponse
mkQueryDocumentResponse :: QueryDocumentResponse
mkQueryDocumentResponse =
QueryDocumentResponse
{ queryDocumentResponseRelevantChunks :: Maybe [RelevantChunk]
queryDocumentResponseRelevantChunks = Maybe [RelevantChunk]
forall a. Maybe a
Nothing
}
data RelevantChunk = RelevantChunk
{ RelevantChunk -> Maybe Chunk
relevantChunkChunk :: !(Maybe Chunk)
, RelevantChunk -> Maybe Float
relevantChunkChunkRelevanceScore :: !(Maybe Float)
}
deriving (Int -> RelevantChunk -> ShowS
[RelevantChunk] -> ShowS
RelevantChunk -> [Char]
(Int -> RelevantChunk -> ShowS)
-> (RelevantChunk -> [Char])
-> ([RelevantChunk] -> ShowS)
-> Show RelevantChunk
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RelevantChunk -> ShowS
showsPrec :: Int -> RelevantChunk -> ShowS
$cshow :: RelevantChunk -> [Char]
show :: RelevantChunk -> [Char]
$cshowList :: [RelevantChunk] -> ShowS
showList :: [RelevantChunk] -> ShowS
P.Show, RelevantChunk -> RelevantChunk -> Bool
(RelevantChunk -> RelevantChunk -> Bool)
-> (RelevantChunk -> RelevantChunk -> Bool) -> Eq RelevantChunk
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RelevantChunk -> RelevantChunk -> Bool
== :: RelevantChunk -> RelevantChunk -> Bool
$c/= :: RelevantChunk -> RelevantChunk -> Bool
/= :: RelevantChunk -> RelevantChunk -> Bool
P.Eq, P.Typeable)
instance A.FromJSON RelevantChunk where
parseJSON :: Value -> Parser RelevantChunk
parseJSON = [Char]
-> (Object -> Parser RelevantChunk)
-> Value
-> Parser RelevantChunk
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"RelevantChunk" ((Object -> Parser RelevantChunk) -> Value -> Parser RelevantChunk)
-> (Object -> Parser RelevantChunk)
-> Value
-> Parser RelevantChunk
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Chunk -> Maybe Float -> RelevantChunk
RelevantChunk
(Maybe Chunk -> Maybe Float -> RelevantChunk)
-> Parser (Maybe Chunk) -> Parser (Maybe Float -> RelevantChunk)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Chunk)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"chunk")
Parser (Maybe Float -> RelevantChunk)
-> Parser (Maybe Float) -> Parser RelevantChunk
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"chunkRelevanceScore")
instance A.ToJSON RelevantChunk where
toJSON :: RelevantChunk -> Value
toJSON RelevantChunk {Maybe Float
Maybe Chunk
relevantChunkChunk :: RelevantChunk -> Maybe Chunk
relevantChunkChunkRelevanceScore :: RelevantChunk -> Maybe Float
relevantChunkChunk :: Maybe Chunk
relevantChunkChunkRelevanceScore :: Maybe Float
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"chunk" Key -> Maybe Chunk -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Chunk
relevantChunkChunk
, Key
"chunkRelevanceScore" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
relevantChunkChunkRelevanceScore
]
mkRelevantChunk ::
RelevantChunk
mkRelevantChunk :: RelevantChunk
mkRelevantChunk =
RelevantChunk
{ relevantChunkChunk :: Maybe Chunk
relevantChunkChunk = Maybe Chunk
forall a. Maybe a
Nothing
, relevantChunkChunkRelevanceScore :: Maybe Float
relevantChunkChunkRelevanceScore = Maybe Float
forall a. Maybe a
Nothing
}
data RetrievalMetadata = RetrievalMetadata
{ RetrievalMetadata -> Maybe Float
retrievalMetadataGoogleSearchDynamicRetrievalScore :: !(Maybe Float)
}
deriving (Int -> RetrievalMetadata -> ShowS
[RetrievalMetadata] -> ShowS
RetrievalMetadata -> [Char]
(Int -> RetrievalMetadata -> ShowS)
-> (RetrievalMetadata -> [Char])
-> ([RetrievalMetadata] -> ShowS)
-> Show RetrievalMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RetrievalMetadata -> ShowS
showsPrec :: Int -> RetrievalMetadata -> ShowS
$cshow :: RetrievalMetadata -> [Char]
show :: RetrievalMetadata -> [Char]
$cshowList :: [RetrievalMetadata] -> ShowS
showList :: [RetrievalMetadata] -> ShowS
P.Show, RetrievalMetadata -> RetrievalMetadata -> Bool
(RetrievalMetadata -> RetrievalMetadata -> Bool)
-> (RetrievalMetadata -> RetrievalMetadata -> Bool)
-> Eq RetrievalMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RetrievalMetadata -> RetrievalMetadata -> Bool
== :: RetrievalMetadata -> RetrievalMetadata -> Bool
$c/= :: RetrievalMetadata -> RetrievalMetadata -> Bool
/= :: RetrievalMetadata -> RetrievalMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON RetrievalMetadata where
parseJSON :: Value -> Parser RetrievalMetadata
parseJSON = [Char]
-> (Object -> Parser RetrievalMetadata)
-> Value
-> Parser RetrievalMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"RetrievalMetadata" ((Object -> Parser RetrievalMetadata)
-> Value -> Parser RetrievalMetadata)
-> (Object -> Parser RetrievalMetadata)
-> Value
-> Parser RetrievalMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Float -> RetrievalMetadata
RetrievalMetadata
(Maybe Float -> RetrievalMetadata)
-> Parser (Maybe Float) -> Parser RetrievalMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"googleSearchDynamicRetrievalScore")
instance A.ToJSON RetrievalMetadata where
toJSON :: RetrievalMetadata -> Value
toJSON RetrievalMetadata {Maybe Float
retrievalMetadataGoogleSearchDynamicRetrievalScore :: RetrievalMetadata -> Maybe Float
retrievalMetadataGoogleSearchDynamicRetrievalScore :: Maybe Float
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"googleSearchDynamicRetrievalScore" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
retrievalMetadataGoogleSearchDynamicRetrievalScore
]
mkRetrievalMetadata ::
RetrievalMetadata
mkRetrievalMetadata :: RetrievalMetadata
mkRetrievalMetadata =
RetrievalMetadata
{ retrievalMetadataGoogleSearchDynamicRetrievalScore :: Maybe Float
retrievalMetadataGoogleSearchDynamicRetrievalScore = Maybe Float
forall a. Maybe a
Nothing
}
data SafetyFeedback = SafetyFeedback
{ SafetyFeedback -> Maybe SafetySetting
safetyFeedbackSetting :: !(Maybe SafetySetting)
, SafetyFeedback -> Maybe SafetyRating
safetyFeedbackRating :: !(Maybe SafetyRating)
}
deriving (Int -> SafetyFeedback -> ShowS
[SafetyFeedback] -> ShowS
SafetyFeedback -> [Char]
(Int -> SafetyFeedback -> ShowS)
-> (SafetyFeedback -> [Char])
-> ([SafetyFeedback] -> ShowS)
-> Show SafetyFeedback
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SafetyFeedback -> ShowS
showsPrec :: Int -> SafetyFeedback -> ShowS
$cshow :: SafetyFeedback -> [Char]
show :: SafetyFeedback -> [Char]
$cshowList :: [SafetyFeedback] -> ShowS
showList :: [SafetyFeedback] -> ShowS
P.Show, SafetyFeedback -> SafetyFeedback -> Bool
(SafetyFeedback -> SafetyFeedback -> Bool)
-> (SafetyFeedback -> SafetyFeedback -> Bool) -> Eq SafetyFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SafetyFeedback -> SafetyFeedback -> Bool
== :: SafetyFeedback -> SafetyFeedback -> Bool
$c/= :: SafetyFeedback -> SafetyFeedback -> Bool
/= :: SafetyFeedback -> SafetyFeedback -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SafetyFeedback where
parseJSON :: Value -> Parser SafetyFeedback
parseJSON = [Char]
-> (Object -> Parser SafetyFeedback)
-> Value
-> Parser SafetyFeedback
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SafetyFeedback" ((Object -> Parser SafetyFeedback)
-> Value -> Parser SafetyFeedback)
-> (Object -> Parser SafetyFeedback)
-> Value
-> Parser SafetyFeedback
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe SafetySetting -> Maybe SafetyRating -> SafetyFeedback
SafetyFeedback
(Maybe SafetySetting -> Maybe SafetyRating -> SafetyFeedback)
-> Parser (Maybe SafetySetting)
-> Parser (Maybe SafetyRating -> SafetyFeedback)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe SafetySetting)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"setting")
Parser (Maybe SafetyRating -> SafetyFeedback)
-> Parser (Maybe SafetyRating) -> Parser SafetyFeedback
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe SafetyRating)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"rating")
instance A.ToJSON SafetyFeedback where
toJSON :: SafetyFeedback -> Value
toJSON SafetyFeedback {Maybe SafetyRating
Maybe SafetySetting
safetyFeedbackSetting :: SafetyFeedback -> Maybe SafetySetting
safetyFeedbackRating :: SafetyFeedback -> Maybe SafetyRating
safetyFeedbackSetting :: Maybe SafetySetting
safetyFeedbackRating :: Maybe SafetyRating
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"setting" Key -> Maybe SafetySetting -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe SafetySetting
safetyFeedbackSetting
, Key
"rating" Key -> Maybe SafetyRating -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe SafetyRating
safetyFeedbackRating
]
mkSafetyFeedback ::
SafetyFeedback
mkSafetyFeedback :: SafetyFeedback
mkSafetyFeedback =
SafetyFeedback
{ safetyFeedbackSetting :: Maybe SafetySetting
safetyFeedbackSetting = Maybe SafetySetting
forall a. Maybe a
Nothing
, safetyFeedbackRating :: Maybe SafetyRating
safetyFeedbackRating = Maybe SafetyRating
forall a. Maybe a
Nothing
}
data SafetyRating = SafetyRating
{ SafetyRating -> HarmCategory
safetyRatingCategory :: !(HarmCategory)
, SafetyRating -> Maybe Bool
safetyRatingBlocked :: !(Maybe Bool)
, SafetyRating -> E'Probability
safetyRatingProbability :: !(E'Probability)
}
deriving (Int -> SafetyRating -> ShowS
[SafetyRating] -> ShowS
SafetyRating -> [Char]
(Int -> SafetyRating -> ShowS)
-> (SafetyRating -> [Char])
-> ([SafetyRating] -> ShowS)
-> Show SafetyRating
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SafetyRating -> ShowS
showsPrec :: Int -> SafetyRating -> ShowS
$cshow :: SafetyRating -> [Char]
show :: SafetyRating -> [Char]
$cshowList :: [SafetyRating] -> ShowS
showList :: [SafetyRating] -> ShowS
P.Show, SafetyRating -> SafetyRating -> Bool
(SafetyRating -> SafetyRating -> Bool)
-> (SafetyRating -> SafetyRating -> Bool) -> Eq SafetyRating
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SafetyRating -> SafetyRating -> Bool
== :: SafetyRating -> SafetyRating -> Bool
$c/= :: SafetyRating -> SafetyRating -> Bool
/= :: SafetyRating -> SafetyRating -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SafetyRating where
parseJSON :: Value -> Parser SafetyRating
parseJSON = [Char]
-> (Object -> Parser SafetyRating) -> Value -> Parser SafetyRating
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SafetyRating" ((Object -> Parser SafetyRating) -> Value -> Parser SafetyRating)
-> (Object -> Parser SafetyRating) -> Value -> Parser SafetyRating
forall a b. (a -> b) -> a -> b
$ \Object
o ->
HarmCategory -> Maybe Bool -> E'Probability -> SafetyRating
SafetyRating
(HarmCategory -> Maybe Bool -> E'Probability -> SafetyRating)
-> Parser HarmCategory
-> Parser (Maybe Bool -> E'Probability -> SafetyRating)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser HarmCategory
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"category")
Parser (Maybe Bool -> E'Probability -> SafetyRating)
-> Parser (Maybe Bool) -> Parser (E'Probability -> SafetyRating)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"blocked")
Parser (E'Probability -> SafetyRating)
-> Parser E'Probability -> Parser SafetyRating
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser E'Probability
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"probability")
instance A.ToJSON SafetyRating where
toJSON :: SafetyRating -> Value
toJSON SafetyRating {Maybe Bool
E'Probability
HarmCategory
safetyRatingCategory :: SafetyRating -> HarmCategory
safetyRatingBlocked :: SafetyRating -> Maybe Bool
safetyRatingProbability :: SafetyRating -> E'Probability
safetyRatingCategory :: HarmCategory
safetyRatingBlocked :: Maybe Bool
safetyRatingProbability :: E'Probability
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"category" Key -> HarmCategory -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= HarmCategory
safetyRatingCategory
, Key
"blocked" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
safetyRatingBlocked
, Key
"probability" Key -> E'Probability -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= E'Probability
safetyRatingProbability
]
mkSafetyRating ::
HarmCategory ->
E'Probability ->
SafetyRating
mkSafetyRating :: HarmCategory -> E'Probability -> SafetyRating
mkSafetyRating HarmCategory
safetyRatingCategory E'Probability
safetyRatingProbability =
SafetyRating
{ HarmCategory
safetyRatingCategory :: HarmCategory
safetyRatingCategory :: HarmCategory
safetyRatingCategory
, safetyRatingBlocked :: Maybe Bool
safetyRatingBlocked = Maybe Bool
forall a. Maybe a
Nothing
, E'Probability
safetyRatingProbability :: E'Probability
safetyRatingProbability :: E'Probability
safetyRatingProbability
}
data SafetySetting = SafetySetting
{ SafetySetting -> E'Threshold
safetySettingThreshold :: !(E'Threshold)
, SafetySetting -> HarmCategory
safetySettingCategory :: !(HarmCategory)
}
deriving (Int -> SafetySetting -> ShowS
[SafetySetting] -> ShowS
SafetySetting -> [Char]
(Int -> SafetySetting -> ShowS)
-> (SafetySetting -> [Char])
-> ([SafetySetting] -> ShowS)
-> Show SafetySetting
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SafetySetting -> ShowS
showsPrec :: Int -> SafetySetting -> ShowS
$cshow :: SafetySetting -> [Char]
show :: SafetySetting -> [Char]
$cshowList :: [SafetySetting] -> ShowS
showList :: [SafetySetting] -> ShowS
P.Show, SafetySetting -> SafetySetting -> Bool
(SafetySetting -> SafetySetting -> Bool)
-> (SafetySetting -> SafetySetting -> Bool) -> Eq SafetySetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SafetySetting -> SafetySetting -> Bool
== :: SafetySetting -> SafetySetting -> Bool
$c/= :: SafetySetting -> SafetySetting -> Bool
/= :: SafetySetting -> SafetySetting -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SafetySetting where
parseJSON :: Value -> Parser SafetySetting
parseJSON = [Char]
-> (Object -> Parser SafetySetting)
-> Value
-> Parser SafetySetting
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SafetySetting" ((Object -> Parser SafetySetting) -> Value -> Parser SafetySetting)
-> (Object -> Parser SafetySetting)
-> Value
-> Parser SafetySetting
forall a b. (a -> b) -> a -> b
$ \Object
o ->
E'Threshold -> HarmCategory -> SafetySetting
SafetySetting
(E'Threshold -> HarmCategory -> SafetySetting)
-> Parser E'Threshold -> Parser (HarmCategory -> SafetySetting)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser E'Threshold
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"threshold")
Parser (HarmCategory -> SafetySetting)
-> Parser HarmCategory -> Parser SafetySetting
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser HarmCategory
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"category")
instance A.ToJSON SafetySetting where
toJSON :: SafetySetting -> Value
toJSON SafetySetting {E'Threshold
HarmCategory
safetySettingThreshold :: SafetySetting -> E'Threshold
safetySettingCategory :: SafetySetting -> HarmCategory
safetySettingThreshold :: E'Threshold
safetySettingCategory :: HarmCategory
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"threshold" Key -> E'Threshold -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= E'Threshold
safetySettingThreshold
, Key
"category" Key -> HarmCategory -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= HarmCategory
safetySettingCategory
]
mkSafetySetting ::
E'Threshold ->
HarmCategory ->
SafetySetting
mkSafetySetting :: E'Threshold -> HarmCategory -> SafetySetting
mkSafetySetting E'Threshold
safetySettingThreshold HarmCategory
safetySettingCategory =
SafetySetting
{ E'Threshold
safetySettingThreshold :: E'Threshold
safetySettingThreshold :: E'Threshold
safetySettingThreshold
, HarmCategory
safetySettingCategory :: HarmCategory
safetySettingCategory :: HarmCategory
safetySettingCategory
}
data Schema = Schema
{ Schema -> Maybe Schema
schemaItems :: !(Maybe Schema)
, Schema -> Maybe [Schema]
schemaAnyOf :: !(Maybe [Schema])
, Schema -> Maybe Text
schemaMinLength :: !(Maybe Text)
, Schema -> Maybe Double
schemaMaximum :: !(Maybe Double)
, Schema -> Maybe [Text]
schemaPropertyOrdering :: !(Maybe [Text])
, Schema -> Maybe Bool
schemaNullable :: !(Maybe Bool)
, Schema -> Maybe [Text]
schemaRequired :: !(Maybe [Text])
, Schema -> Maybe Text
schemaMinProperties :: !(Maybe Text)
, Schema -> Maybe Text
schemaMaxItems :: !(Maybe Text)
, Schema -> Maybe [Char]
schemaExample :: !(Maybe String)
, Schema -> Maybe Text
schemaTitle :: !(Maybe Text)
, Schema -> Maybe Text
schemaMinItems :: !(Maybe Text)
, Schema -> Maybe Text
schemaDescription :: !(Maybe Text)
, Schema -> ModelType
schemaType :: !(ModelType)
, Schema -> Maybe [Char]
schemaDefault :: !(Maybe String)
, Schema -> Maybe Double
schemaMinimum :: !(Maybe Double)
, Schema -> Maybe Text
schemaPattern :: !(Maybe Text)
, Schema -> Maybe (Map [Char] Schema)
schemaProperties :: !(Maybe (Map.Map String Schema))
, Schema -> Maybe Text
schemaMaxProperties :: !(Maybe Text)
, Schema -> Maybe Text
schemaFormat :: !(Maybe Text)
, Schema -> Maybe [Text]
schemaEnum :: !(Maybe [Text])
, Schema -> Maybe Text
schemaMaxLength :: !(Maybe Text)
}
deriving (Int -> Schema -> ShowS
[Schema] -> ShowS
Schema -> [Char]
(Int -> Schema -> ShowS)
-> (Schema -> [Char]) -> ([Schema] -> ShowS) -> Show Schema
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Schema -> ShowS
showsPrec :: Int -> Schema -> ShowS
$cshow :: Schema -> [Char]
show :: Schema -> [Char]
$cshowList :: [Schema] -> ShowS
showList :: [Schema] -> ShowS
P.Show, Schema -> Schema -> Bool
(Schema -> Schema -> Bool)
-> (Schema -> Schema -> Bool) -> Eq Schema
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Schema -> Schema -> Bool
== :: Schema -> Schema -> Bool
$c/= :: Schema -> Schema -> Bool
/= :: Schema -> Schema -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Schema where
parseJSON :: Value -> Parser Schema
parseJSON = [Char] -> (Object -> Parser Schema) -> Value -> Parser Schema
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Schema" ((Object -> Parser Schema) -> Value -> Parser Schema)
-> (Object -> Parser Schema) -> Value -> Parser Schema
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Schema
-> Maybe [Schema]
-> Maybe Text
-> Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema
Schema
(Maybe Schema
-> Maybe [Schema]
-> Maybe Text
-> Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Schema)
-> Parser
(Maybe [Schema]
-> Maybe Text
-> Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Schema)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"items")
Parser
(Maybe [Schema]
-> Maybe Text
-> Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe [Schema])
-> Parser
(Maybe Text
-> Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Schema])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"anyOf")
Parser
(Maybe Text
-> Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Text)
-> Parser
(Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"minLength")
Parser
(Maybe Double
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Double)
-> Parser
(Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maximum")
Parser
(Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe [Text])
-> Parser
(Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"propertyOrdering")
Parser
(Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Bool)
-> Parser
(Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"nullable")
Parser
(Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"required")
Parser
(Maybe Text
-> Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"minProperties")
Parser
(Maybe Text
-> Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Text)
-> Parser
(Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxItems")
Parser
(Maybe [Char]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe [Char])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Char])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"example")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"title")
Parser
(Maybe Text
-> Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"minItems")
Parser
(Maybe Text
-> ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Text)
-> Parser
(ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description")
Parser
(ModelType
-> Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser ModelType
-> Parser
(Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser ModelType
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type")
Parser
(Maybe [Char]
-> Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe [Char])
-> Parser
(Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Char])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"default")
Parser
(Maybe Double
-> Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Double)
-> Parser
(Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"minimum")
Parser
(Maybe Text
-> Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe Text)
-> Parser
(Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"pattern")
Parser
(Maybe (Map [Char] Schema)
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Schema)
-> Parser (Maybe (Map [Char] Schema))
-> Parser
(Maybe Text -> Maybe Text -> Maybe [Text] -> Maybe Text -> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe (Map [Char] Schema))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"properties")
Parser
(Maybe Text -> Maybe Text -> Maybe [Text] -> Maybe Text -> Schema)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Text] -> Maybe Text -> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxProperties")
Parser (Maybe Text -> Maybe [Text] -> Maybe Text -> Schema)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"format")
Parser (Maybe [Text] -> Maybe Text -> Schema)
-> Parser (Maybe [Text]) -> Parser (Maybe Text -> Schema)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"enum")
Parser (Maybe Text -> Schema)
-> Parser (Maybe Text) -> Parser Schema
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxLength")
instance A.ToJSON Schema where
toJSON :: Schema -> Value
toJSON Schema {Maybe Bool
Maybe Double
Maybe [Char]
Maybe [Text]
Maybe [Schema]
Maybe Text
Maybe (Map [Char] Schema)
Maybe Schema
ModelType
schemaItems :: Schema -> Maybe Schema
schemaAnyOf :: Schema -> Maybe [Schema]
schemaMinLength :: Schema -> Maybe Text
schemaMaximum :: Schema -> Maybe Double
schemaPropertyOrdering :: Schema -> Maybe [Text]
schemaNullable :: Schema -> Maybe Bool
schemaRequired :: Schema -> Maybe [Text]
schemaMinProperties :: Schema -> Maybe Text
schemaMaxItems :: Schema -> Maybe Text
schemaExample :: Schema -> Maybe [Char]
schemaTitle :: Schema -> Maybe Text
schemaMinItems :: Schema -> Maybe Text
schemaDescription :: Schema -> Maybe Text
schemaType :: Schema -> ModelType
schemaDefault :: Schema -> Maybe [Char]
schemaMinimum :: Schema -> Maybe Double
schemaPattern :: Schema -> Maybe Text
schemaProperties :: Schema -> Maybe (Map [Char] Schema)
schemaMaxProperties :: Schema -> Maybe Text
schemaFormat :: Schema -> Maybe Text
schemaEnum :: Schema -> Maybe [Text]
schemaMaxLength :: Schema -> Maybe Text
schemaItems :: Maybe Schema
schemaAnyOf :: Maybe [Schema]
schemaMinLength :: Maybe Text
schemaMaximum :: Maybe Double
schemaPropertyOrdering :: Maybe [Text]
schemaNullable :: Maybe Bool
schemaRequired :: Maybe [Text]
schemaMinProperties :: Maybe Text
schemaMaxItems :: Maybe Text
schemaExample :: Maybe [Char]
schemaTitle :: Maybe Text
schemaMinItems :: Maybe Text
schemaDescription :: Maybe Text
schemaType :: ModelType
schemaDefault :: Maybe [Char]
schemaMinimum :: Maybe Double
schemaPattern :: Maybe Text
schemaProperties :: Maybe (Map [Char] Schema)
schemaMaxProperties :: Maybe Text
schemaFormat :: Maybe Text
schemaEnum :: Maybe [Text]
schemaMaxLength :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"items" Key -> Maybe Schema -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Schema
schemaItems
, Key
"anyOf" Key -> Maybe [Schema] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Schema]
schemaAnyOf
, Key
"minLength" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaMinLength
, Key
"maximum" Key -> Maybe Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Double
schemaMaximum
, Key
"propertyOrdering" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
schemaPropertyOrdering
, Key
"nullable" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
schemaNullable
, Key
"required" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
schemaRequired
, Key
"minProperties" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaMinProperties
, Key
"maxItems" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaMaxItems
, Key
"example" Key -> Maybe [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Char]
schemaExample
, Key
"title" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaTitle
, Key
"minItems" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaMinItems
, Key
"description" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaDescription
, Key
"type" Key -> ModelType -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ModelType
schemaType
, Key
"default" Key -> Maybe [Char] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Char]
schemaDefault
, Key
"minimum" Key -> Maybe Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Double
schemaMinimum
, Key
"pattern" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaPattern
, Key
"properties" Key -> Maybe (Map [Char] Schema) -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe (Map [Char] Schema)
schemaProperties
, Key
"maxProperties" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaMaxProperties
, Key
"format" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaFormat
, Key
"enum" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
schemaEnum
, Key
"maxLength" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
schemaMaxLength
]
mkSchema ::
ModelType ->
Schema
mkSchema :: ModelType -> Schema
mkSchema ModelType
schemaType =
Schema
{ schemaItems :: Maybe Schema
schemaItems = Maybe Schema
forall a. Maybe a
Nothing
, schemaAnyOf :: Maybe [Schema]
schemaAnyOf = Maybe [Schema]
forall a. Maybe a
Nothing
, schemaMinLength :: Maybe Text
schemaMinLength = Maybe Text
forall a. Maybe a
Nothing
, schemaMaximum :: Maybe Double
schemaMaximum = Maybe Double
forall a. Maybe a
Nothing
, schemaPropertyOrdering :: Maybe [Text]
schemaPropertyOrdering = Maybe [Text]
forall a. Maybe a
Nothing
, schemaNullable :: Maybe Bool
schemaNullable = Maybe Bool
forall a. Maybe a
Nothing
, schemaRequired :: Maybe [Text]
schemaRequired = Maybe [Text]
forall a. Maybe a
Nothing
, schemaMinProperties :: Maybe Text
schemaMinProperties = Maybe Text
forall a. Maybe a
Nothing
, schemaMaxItems :: Maybe Text
schemaMaxItems = Maybe Text
forall a. Maybe a
Nothing
, schemaExample :: Maybe [Char]
schemaExample = Maybe [Char]
forall a. Maybe a
Nothing
, schemaTitle :: Maybe Text
schemaTitle = Maybe Text
forall a. Maybe a
Nothing
, schemaMinItems :: Maybe Text
schemaMinItems = Maybe Text
forall a. Maybe a
Nothing
, schemaDescription :: Maybe Text
schemaDescription = Maybe Text
forall a. Maybe a
Nothing
, ModelType
schemaType :: ModelType
schemaType :: ModelType
schemaType
, schemaDefault :: Maybe [Char]
schemaDefault = Maybe [Char]
forall a. Maybe a
Nothing
, schemaMinimum :: Maybe Double
schemaMinimum = Maybe Double
forall a. Maybe a
Nothing
, schemaPattern :: Maybe Text
schemaPattern = Maybe Text
forall a. Maybe a
Nothing
, schemaProperties :: Maybe (Map [Char] Schema)
schemaProperties = Maybe (Map [Char] Schema)
forall a. Maybe a
Nothing
, schemaMaxProperties :: Maybe Text
schemaMaxProperties = Maybe Text
forall a. Maybe a
Nothing
, schemaFormat :: Maybe Text
schemaFormat = Maybe Text
forall a. Maybe a
Nothing
, schemaEnum :: Maybe [Text]
schemaEnum = Maybe [Text]
forall a. Maybe a
Nothing
, schemaMaxLength :: Maybe Text
schemaMaxLength = Maybe Text
forall a. Maybe a
Nothing
}
data SearchEntryPoint = SearchEntryPoint
{ SearchEntryPoint -> Maybe ByteArray
searchEntryPointSdkBlob :: !(Maybe ByteArray)
, SearchEntryPoint -> Maybe Text
searchEntryPointRenderedContent :: !(Maybe Text)
}
deriving (Int -> SearchEntryPoint -> ShowS
[SearchEntryPoint] -> ShowS
SearchEntryPoint -> [Char]
(Int -> SearchEntryPoint -> ShowS)
-> (SearchEntryPoint -> [Char])
-> ([SearchEntryPoint] -> ShowS)
-> Show SearchEntryPoint
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchEntryPoint -> ShowS
showsPrec :: Int -> SearchEntryPoint -> ShowS
$cshow :: SearchEntryPoint -> [Char]
show :: SearchEntryPoint -> [Char]
$cshowList :: [SearchEntryPoint] -> ShowS
showList :: [SearchEntryPoint] -> ShowS
P.Show, SearchEntryPoint -> SearchEntryPoint -> Bool
(SearchEntryPoint -> SearchEntryPoint -> Bool)
-> (SearchEntryPoint -> SearchEntryPoint -> Bool)
-> Eq SearchEntryPoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchEntryPoint -> SearchEntryPoint -> Bool
== :: SearchEntryPoint -> SearchEntryPoint -> Bool
$c/= :: SearchEntryPoint -> SearchEntryPoint -> Bool
/= :: SearchEntryPoint -> SearchEntryPoint -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SearchEntryPoint where
parseJSON :: Value -> Parser SearchEntryPoint
parseJSON = [Char]
-> (Object -> Parser SearchEntryPoint)
-> Value
-> Parser SearchEntryPoint
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SearchEntryPoint" ((Object -> Parser SearchEntryPoint)
-> Value -> Parser SearchEntryPoint)
-> (Object -> Parser SearchEntryPoint)
-> Value
-> Parser SearchEntryPoint
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe ByteArray -> Maybe Text -> SearchEntryPoint
SearchEntryPoint
(Maybe ByteArray -> Maybe Text -> SearchEntryPoint)
-> Parser (Maybe ByteArray)
-> Parser (Maybe Text -> SearchEntryPoint)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe ByteArray)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"sdkBlob")
Parser (Maybe Text -> SearchEntryPoint)
-> Parser (Maybe Text) -> Parser SearchEntryPoint
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"renderedContent")
instance A.ToJSON SearchEntryPoint where
toJSON :: SearchEntryPoint -> Value
toJSON SearchEntryPoint {Maybe Text
Maybe ByteArray
searchEntryPointSdkBlob :: SearchEntryPoint -> Maybe ByteArray
searchEntryPointRenderedContent :: SearchEntryPoint -> Maybe Text
searchEntryPointSdkBlob :: Maybe ByteArray
searchEntryPointRenderedContent :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"sdkBlob" Key -> Maybe ByteArray -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ByteArray
searchEntryPointSdkBlob
, Key
"renderedContent" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
searchEntryPointRenderedContent
]
mkSearchEntryPoint ::
SearchEntryPoint
mkSearchEntryPoint :: SearchEntryPoint
mkSearchEntryPoint =
SearchEntryPoint
{ searchEntryPointSdkBlob :: Maybe ByteArray
searchEntryPointSdkBlob = Maybe ByteArray
forall a. Maybe a
Nothing
, searchEntryPointRenderedContent :: Maybe Text
searchEntryPointRenderedContent = Maybe Text
forall a. Maybe a
Nothing
}
data Segment = Segment
{ Segment -> Maybe Int
segmentPartIndex :: !(Maybe Int)
, Segment -> Maybe Int
segmentStartIndex :: !(Maybe Int)
, Segment -> Maybe Text
segmentText :: !(Maybe Text)
, Segment -> Maybe Int
segmentEndIndex :: !(Maybe Int)
}
deriving (Int -> Segment -> ShowS
[Segment] -> ShowS
Segment -> [Char]
(Int -> Segment -> ShowS)
-> (Segment -> [Char]) -> ([Segment] -> ShowS) -> Show Segment
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Segment -> ShowS
showsPrec :: Int -> Segment -> ShowS
$cshow :: Segment -> [Char]
show :: Segment -> [Char]
$cshowList :: [Segment] -> ShowS
showList :: [Segment] -> ShowS
P.Show, Segment -> Segment -> Bool
(Segment -> Segment -> Bool)
-> (Segment -> Segment -> Bool) -> Eq Segment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Segment -> Segment -> Bool
== :: Segment -> Segment -> Bool
$c/= :: Segment -> Segment -> Bool
/= :: Segment -> Segment -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Segment where
parseJSON :: Value -> Parser Segment
parseJSON = [Char] -> (Object -> Parser Segment) -> Value -> Parser Segment
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Segment" ((Object -> Parser Segment) -> Value -> Parser Segment)
-> (Object -> Parser Segment) -> Value -> Parser Segment
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int -> Maybe Int -> Maybe Text -> Maybe Int -> Segment
Segment
(Maybe Int -> Maybe Int -> Maybe Text -> Maybe Int -> Segment)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Text -> Maybe Int -> Segment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"partIndex")
Parser (Maybe Int -> Maybe Text -> Maybe Int -> Segment)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Int -> Segment)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"startIndex")
Parser (Maybe Text -> Maybe Int -> Segment)
-> Parser (Maybe Text) -> Parser (Maybe Int -> Segment)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"text")
Parser (Maybe Int -> Segment)
-> Parser (Maybe Int) -> Parser Segment
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"endIndex")
instance A.ToJSON Segment where
toJSON :: Segment -> Value
toJSON Segment {Maybe Int
Maybe Text
segmentPartIndex :: Segment -> Maybe Int
segmentStartIndex :: Segment -> Maybe Int
segmentText :: Segment -> Maybe Text
segmentEndIndex :: Segment -> Maybe Int
segmentPartIndex :: Maybe Int
segmentStartIndex :: Maybe Int
segmentText :: Maybe Text
segmentEndIndex :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"partIndex" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
segmentPartIndex
, Key
"startIndex" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
segmentStartIndex
, Key
"text" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
segmentText
, Key
"endIndex" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
segmentEndIndex
]
mkSegment ::
Segment
mkSegment :: Segment
mkSegment =
Segment
{ segmentPartIndex :: Maybe Int
segmentPartIndex = Maybe Int
forall a. Maybe a
Nothing
, segmentStartIndex :: Maybe Int
segmentStartIndex = Maybe Int
forall a. Maybe a
Nothing
, segmentText :: Maybe Text
segmentText = Maybe Text
forall a. Maybe a
Nothing
, segmentEndIndex :: Maybe Int
segmentEndIndex = Maybe Int
forall a. Maybe a
Nothing
}
data SemanticRetrieverChunk = SemanticRetrieverChunk
{ SemanticRetrieverChunk -> Maybe Text
semanticRetrieverChunkChunk :: !(Maybe Text)
, SemanticRetrieverChunk -> Maybe Text
semanticRetrieverChunkSource :: !(Maybe Text)
}
deriving (Int -> SemanticRetrieverChunk -> ShowS
[SemanticRetrieverChunk] -> ShowS
SemanticRetrieverChunk -> [Char]
(Int -> SemanticRetrieverChunk -> ShowS)
-> (SemanticRetrieverChunk -> [Char])
-> ([SemanticRetrieverChunk] -> ShowS)
-> Show SemanticRetrieverChunk
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SemanticRetrieverChunk -> ShowS
showsPrec :: Int -> SemanticRetrieverChunk -> ShowS
$cshow :: SemanticRetrieverChunk -> [Char]
show :: SemanticRetrieverChunk -> [Char]
$cshowList :: [SemanticRetrieverChunk] -> ShowS
showList :: [SemanticRetrieverChunk] -> ShowS
P.Show, SemanticRetrieverChunk -> SemanticRetrieverChunk -> Bool
(SemanticRetrieverChunk -> SemanticRetrieverChunk -> Bool)
-> (SemanticRetrieverChunk -> SemanticRetrieverChunk -> Bool)
-> Eq SemanticRetrieverChunk
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SemanticRetrieverChunk -> SemanticRetrieverChunk -> Bool
== :: SemanticRetrieverChunk -> SemanticRetrieverChunk -> Bool
$c/= :: SemanticRetrieverChunk -> SemanticRetrieverChunk -> Bool
/= :: SemanticRetrieverChunk -> SemanticRetrieverChunk -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SemanticRetrieverChunk where
parseJSON :: Value -> Parser SemanticRetrieverChunk
parseJSON = [Char]
-> (Object -> Parser SemanticRetrieverChunk)
-> Value
-> Parser SemanticRetrieverChunk
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SemanticRetrieverChunk" ((Object -> Parser SemanticRetrieverChunk)
-> Value -> Parser SemanticRetrieverChunk)
-> (Object -> Parser SemanticRetrieverChunk)
-> Value
-> Parser SemanticRetrieverChunk
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe Text -> SemanticRetrieverChunk
SemanticRetrieverChunk
(Maybe Text -> Maybe Text -> SemanticRetrieverChunk)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SemanticRetrieverChunk)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"chunk")
Parser (Maybe Text -> SemanticRetrieverChunk)
-> Parser (Maybe Text) -> Parser SemanticRetrieverChunk
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"source")
instance A.ToJSON SemanticRetrieverChunk where
toJSON :: SemanticRetrieverChunk -> Value
toJSON SemanticRetrieverChunk {Maybe Text
semanticRetrieverChunkChunk :: SemanticRetrieverChunk -> Maybe Text
semanticRetrieverChunkSource :: SemanticRetrieverChunk -> Maybe Text
semanticRetrieverChunkChunk :: Maybe Text
semanticRetrieverChunkSource :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"chunk" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
semanticRetrieverChunkChunk
, Key
"source" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
semanticRetrieverChunkSource
]
mkSemanticRetrieverChunk ::
SemanticRetrieverChunk
mkSemanticRetrieverChunk :: SemanticRetrieverChunk
mkSemanticRetrieverChunk =
SemanticRetrieverChunk
{ semanticRetrieverChunkChunk :: Maybe Text
semanticRetrieverChunkChunk = Maybe Text
forall a. Maybe a
Nothing
, semanticRetrieverChunkSource :: Maybe Text
semanticRetrieverChunkSource = Maybe Text
forall a. Maybe a
Nothing
}
data SemanticRetrieverConfig = SemanticRetrieverConfig
{ SemanticRetrieverConfig -> Text
semanticRetrieverConfigSource :: !(Text)
, SemanticRetrieverConfig -> Content
semanticRetrieverConfigQuery :: !(Content)
, SemanticRetrieverConfig -> Maybe Int
semanticRetrieverConfigMaxChunksCount :: !(Maybe Int)
, SemanticRetrieverConfig -> Maybe [MetadataFilter]
semanticRetrieverConfigMetadataFilters :: !(Maybe [MetadataFilter])
, SemanticRetrieverConfig -> Maybe Float
semanticRetrieverConfigMinimumRelevanceScore :: !(Maybe Float)
}
deriving (Int -> SemanticRetrieverConfig -> ShowS
[SemanticRetrieverConfig] -> ShowS
SemanticRetrieverConfig -> [Char]
(Int -> SemanticRetrieverConfig -> ShowS)
-> (SemanticRetrieverConfig -> [Char])
-> ([SemanticRetrieverConfig] -> ShowS)
-> Show SemanticRetrieverConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SemanticRetrieverConfig -> ShowS
showsPrec :: Int -> SemanticRetrieverConfig -> ShowS
$cshow :: SemanticRetrieverConfig -> [Char]
show :: SemanticRetrieverConfig -> [Char]
$cshowList :: [SemanticRetrieverConfig] -> ShowS
showList :: [SemanticRetrieverConfig] -> ShowS
P.Show, SemanticRetrieverConfig -> SemanticRetrieverConfig -> Bool
(SemanticRetrieverConfig -> SemanticRetrieverConfig -> Bool)
-> (SemanticRetrieverConfig -> SemanticRetrieverConfig -> Bool)
-> Eq SemanticRetrieverConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SemanticRetrieverConfig -> SemanticRetrieverConfig -> Bool
== :: SemanticRetrieverConfig -> SemanticRetrieverConfig -> Bool
$c/= :: SemanticRetrieverConfig -> SemanticRetrieverConfig -> Bool
/= :: SemanticRetrieverConfig -> SemanticRetrieverConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SemanticRetrieverConfig where
parseJSON :: Value -> Parser SemanticRetrieverConfig
parseJSON = [Char]
-> (Object -> Parser SemanticRetrieverConfig)
-> Value
-> Parser SemanticRetrieverConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SemanticRetrieverConfig" ((Object -> Parser SemanticRetrieverConfig)
-> Value -> Parser SemanticRetrieverConfig)
-> (Object -> Parser SemanticRetrieverConfig)
-> Value
-> Parser SemanticRetrieverConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Text
-> Content
-> Maybe Int
-> Maybe [MetadataFilter]
-> Maybe Float
-> SemanticRetrieverConfig
SemanticRetrieverConfig
(Text
-> Content
-> Maybe Int
-> Maybe [MetadataFilter]
-> Maybe Float
-> SemanticRetrieverConfig)
-> Parser Text
-> Parser
(Content
-> Maybe Int
-> Maybe [MetadataFilter]
-> Maybe Float
-> SemanticRetrieverConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"source")
Parser
(Content
-> Maybe Int
-> Maybe [MetadataFilter]
-> Maybe Float
-> SemanticRetrieverConfig)
-> Parser Content
-> Parser
(Maybe Int
-> Maybe [MetadataFilter]
-> Maybe Float
-> SemanticRetrieverConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Content
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"query")
Parser
(Maybe Int
-> Maybe [MetadataFilter]
-> Maybe Float
-> SemanticRetrieverConfig)
-> Parser (Maybe Int)
-> Parser
(Maybe [MetadataFilter] -> Maybe Float -> SemanticRetrieverConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxChunksCount")
Parser
(Maybe [MetadataFilter] -> Maybe Float -> SemanticRetrieverConfig)
-> Parser (Maybe [MetadataFilter])
-> Parser (Maybe Float -> SemanticRetrieverConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [MetadataFilter])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"metadataFilters")
Parser (Maybe Float -> SemanticRetrieverConfig)
-> Parser (Maybe Float) -> Parser SemanticRetrieverConfig
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"minimumRelevanceScore")
instance A.ToJSON SemanticRetrieverConfig where
toJSON :: SemanticRetrieverConfig -> Value
toJSON SemanticRetrieverConfig {Maybe Float
Maybe Int
Maybe [MetadataFilter]
Text
Content
semanticRetrieverConfigSource :: SemanticRetrieverConfig -> Text
semanticRetrieverConfigQuery :: SemanticRetrieverConfig -> Content
semanticRetrieverConfigMaxChunksCount :: SemanticRetrieverConfig -> Maybe Int
semanticRetrieverConfigMetadataFilters :: SemanticRetrieverConfig -> Maybe [MetadataFilter]
semanticRetrieverConfigMinimumRelevanceScore :: SemanticRetrieverConfig -> Maybe Float
semanticRetrieverConfigSource :: Text
semanticRetrieverConfigQuery :: Content
semanticRetrieverConfigMaxChunksCount :: Maybe Int
semanticRetrieverConfigMetadataFilters :: Maybe [MetadataFilter]
semanticRetrieverConfigMinimumRelevanceScore :: Maybe Float
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"source" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
semanticRetrieverConfigSource
, Key
"query" Key -> Content -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Content
semanticRetrieverConfigQuery
, Key
"maxChunksCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
semanticRetrieverConfigMaxChunksCount
, Key
"metadataFilters" Key -> Maybe [MetadataFilter] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [MetadataFilter]
semanticRetrieverConfigMetadataFilters
, Key
"minimumRelevanceScore" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
semanticRetrieverConfigMinimumRelevanceScore
]
mkSemanticRetrieverConfig ::
Text ->
Content ->
SemanticRetrieverConfig
mkSemanticRetrieverConfig :: Text -> Content -> SemanticRetrieverConfig
mkSemanticRetrieverConfig Text
semanticRetrieverConfigSource Content
semanticRetrieverConfigQuery =
SemanticRetrieverConfig
{ Text
semanticRetrieverConfigSource :: Text
semanticRetrieverConfigSource :: Text
semanticRetrieverConfigSource
, Content
semanticRetrieverConfigQuery :: Content
semanticRetrieverConfigQuery :: Content
semanticRetrieverConfigQuery
, semanticRetrieverConfigMaxChunksCount :: Maybe Int
semanticRetrieverConfigMaxChunksCount = Maybe Int
forall a. Maybe a
Nothing
, semanticRetrieverConfigMetadataFilters :: Maybe [MetadataFilter]
semanticRetrieverConfigMetadataFilters = Maybe [MetadataFilter]
forall a. Maybe a
Nothing
, semanticRetrieverConfigMinimumRelevanceScore :: Maybe Float
semanticRetrieverConfigMinimumRelevanceScore = Maybe Float
forall a. Maybe a
Nothing
}
data SpeakerVoiceConfig = SpeakerVoiceConfig
{ SpeakerVoiceConfig -> VoiceConfig
speakerVoiceConfigVoiceConfig :: !(VoiceConfig)
, SpeakerVoiceConfig -> Text
speakerVoiceConfigSpeaker :: !(Text)
}
deriving (Int -> SpeakerVoiceConfig -> ShowS
[SpeakerVoiceConfig] -> ShowS
SpeakerVoiceConfig -> [Char]
(Int -> SpeakerVoiceConfig -> ShowS)
-> (SpeakerVoiceConfig -> [Char])
-> ([SpeakerVoiceConfig] -> ShowS)
-> Show SpeakerVoiceConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SpeakerVoiceConfig -> ShowS
showsPrec :: Int -> SpeakerVoiceConfig -> ShowS
$cshow :: SpeakerVoiceConfig -> [Char]
show :: SpeakerVoiceConfig -> [Char]
$cshowList :: [SpeakerVoiceConfig] -> ShowS
showList :: [SpeakerVoiceConfig] -> ShowS
P.Show, SpeakerVoiceConfig -> SpeakerVoiceConfig -> Bool
(SpeakerVoiceConfig -> SpeakerVoiceConfig -> Bool)
-> (SpeakerVoiceConfig -> SpeakerVoiceConfig -> Bool)
-> Eq SpeakerVoiceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SpeakerVoiceConfig -> SpeakerVoiceConfig -> Bool
== :: SpeakerVoiceConfig -> SpeakerVoiceConfig -> Bool
$c/= :: SpeakerVoiceConfig -> SpeakerVoiceConfig -> Bool
/= :: SpeakerVoiceConfig -> SpeakerVoiceConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SpeakerVoiceConfig where
parseJSON :: Value -> Parser SpeakerVoiceConfig
parseJSON = [Char]
-> (Object -> Parser SpeakerVoiceConfig)
-> Value
-> Parser SpeakerVoiceConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SpeakerVoiceConfig" ((Object -> Parser SpeakerVoiceConfig)
-> Value -> Parser SpeakerVoiceConfig)
-> (Object -> Parser SpeakerVoiceConfig)
-> Value
-> Parser SpeakerVoiceConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
VoiceConfig -> Text -> SpeakerVoiceConfig
SpeakerVoiceConfig
(VoiceConfig -> Text -> SpeakerVoiceConfig)
-> Parser VoiceConfig -> Parser (Text -> SpeakerVoiceConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser VoiceConfig
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"voiceConfig")
Parser (Text -> SpeakerVoiceConfig)
-> Parser Text -> Parser SpeakerVoiceConfig
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"speaker")
instance A.ToJSON SpeakerVoiceConfig where
toJSON :: SpeakerVoiceConfig -> Value
toJSON SpeakerVoiceConfig {Text
VoiceConfig
speakerVoiceConfigVoiceConfig :: SpeakerVoiceConfig -> VoiceConfig
speakerVoiceConfigSpeaker :: SpeakerVoiceConfig -> Text
speakerVoiceConfigVoiceConfig :: VoiceConfig
speakerVoiceConfigSpeaker :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"voiceConfig" Key -> VoiceConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= VoiceConfig
speakerVoiceConfigVoiceConfig
, Key
"speaker" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
speakerVoiceConfigSpeaker
]
mkSpeakerVoiceConfig ::
VoiceConfig ->
Text ->
SpeakerVoiceConfig
mkSpeakerVoiceConfig :: VoiceConfig -> Text -> SpeakerVoiceConfig
mkSpeakerVoiceConfig VoiceConfig
speakerVoiceConfigVoiceConfig Text
speakerVoiceConfigSpeaker =
SpeakerVoiceConfig
{ VoiceConfig
speakerVoiceConfigVoiceConfig :: VoiceConfig
speakerVoiceConfigVoiceConfig :: VoiceConfig
speakerVoiceConfigVoiceConfig
, Text
speakerVoiceConfigSpeaker :: Text
speakerVoiceConfigSpeaker :: Text
speakerVoiceConfigSpeaker
}
data SpeechConfig = SpeechConfig
{ SpeechConfig -> Maybe VoiceConfig
speechConfigVoiceConfig :: !(Maybe VoiceConfig)
, SpeechConfig -> Maybe Text
speechConfigLanguageCode :: !(Maybe Text)
, SpeechConfig -> Maybe MultiSpeakerVoiceConfig
speechConfigMultiSpeakerVoiceConfig :: !(Maybe MultiSpeakerVoiceConfig)
}
deriving (Int -> SpeechConfig -> ShowS
[SpeechConfig] -> ShowS
SpeechConfig -> [Char]
(Int -> SpeechConfig -> ShowS)
-> (SpeechConfig -> [Char])
-> ([SpeechConfig] -> ShowS)
-> Show SpeechConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SpeechConfig -> ShowS
showsPrec :: Int -> SpeechConfig -> ShowS
$cshow :: SpeechConfig -> [Char]
show :: SpeechConfig -> [Char]
$cshowList :: [SpeechConfig] -> ShowS
showList :: [SpeechConfig] -> ShowS
P.Show, SpeechConfig -> SpeechConfig -> Bool
(SpeechConfig -> SpeechConfig -> Bool)
-> (SpeechConfig -> SpeechConfig -> Bool) -> Eq SpeechConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SpeechConfig -> SpeechConfig -> Bool
== :: SpeechConfig -> SpeechConfig -> Bool
$c/= :: SpeechConfig -> SpeechConfig -> Bool
/= :: SpeechConfig -> SpeechConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON SpeechConfig where
parseJSON :: Value -> Parser SpeechConfig
parseJSON = [Char]
-> (Object -> Parser SpeechConfig) -> Value -> Parser SpeechConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"SpeechConfig" ((Object -> Parser SpeechConfig) -> Value -> Parser SpeechConfig)
-> (Object -> Parser SpeechConfig) -> Value -> Parser SpeechConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe VoiceConfig
-> Maybe Text -> Maybe MultiSpeakerVoiceConfig -> SpeechConfig
SpeechConfig
(Maybe VoiceConfig
-> Maybe Text -> Maybe MultiSpeakerVoiceConfig -> SpeechConfig)
-> Parser (Maybe VoiceConfig)
-> Parser
(Maybe Text -> Maybe MultiSpeakerVoiceConfig -> SpeechConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe VoiceConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"voiceConfig")
Parser
(Maybe Text -> Maybe MultiSpeakerVoiceConfig -> SpeechConfig)
-> Parser (Maybe Text)
-> Parser (Maybe MultiSpeakerVoiceConfig -> SpeechConfig)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"languageCode")
Parser (Maybe MultiSpeakerVoiceConfig -> SpeechConfig)
-> Parser (Maybe MultiSpeakerVoiceConfig) -> Parser SpeechConfig
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe MultiSpeakerVoiceConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"multiSpeakerVoiceConfig")
instance A.ToJSON SpeechConfig where
toJSON :: SpeechConfig -> Value
toJSON SpeechConfig {Maybe Text
Maybe MultiSpeakerVoiceConfig
Maybe VoiceConfig
speechConfigVoiceConfig :: SpeechConfig -> Maybe VoiceConfig
speechConfigLanguageCode :: SpeechConfig -> Maybe Text
speechConfigMultiSpeakerVoiceConfig :: SpeechConfig -> Maybe MultiSpeakerVoiceConfig
speechConfigVoiceConfig :: Maybe VoiceConfig
speechConfigLanguageCode :: Maybe Text
speechConfigMultiSpeakerVoiceConfig :: Maybe MultiSpeakerVoiceConfig
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"voiceConfig" Key -> Maybe VoiceConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe VoiceConfig
speechConfigVoiceConfig
, Key
"languageCode" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
speechConfigLanguageCode
, Key
"multiSpeakerVoiceConfig" Key -> Maybe MultiSpeakerVoiceConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe MultiSpeakerVoiceConfig
speechConfigMultiSpeakerVoiceConfig
]
mkSpeechConfig ::
SpeechConfig
mkSpeechConfig :: SpeechConfig
mkSpeechConfig =
SpeechConfig
{ speechConfigVoiceConfig :: Maybe VoiceConfig
speechConfigVoiceConfig = Maybe VoiceConfig
forall a. Maybe a
Nothing
, speechConfigLanguageCode :: Maybe Text
speechConfigLanguageCode = Maybe Text
forall a. Maybe a
Nothing
, speechConfigMultiSpeakerVoiceConfig :: Maybe MultiSpeakerVoiceConfig
speechConfigMultiSpeakerVoiceConfig = Maybe MultiSpeakerVoiceConfig
forall a. Maybe a
Nothing
}
data Status = Status
{ Status -> Maybe Int
statusCode :: !(Maybe Int)
, Status -> Maybe [Map [Char] [Char]]
statusDetails :: !(Maybe [(Map.Map String String)])
, Status -> Maybe Text
statusMessage :: !(Maybe Text)
}
deriving (Int -> Status -> ShowS
[Status] -> ShowS
Status -> [Char]
(Int -> Status -> ShowS)
-> (Status -> [Char]) -> ([Status] -> ShowS) -> Show Status
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Status -> ShowS
showsPrec :: Int -> Status -> ShowS
$cshow :: Status -> [Char]
show :: Status -> [Char]
$cshowList :: [Status] -> ShowS
showList :: [Status] -> ShowS
P.Show, Status -> Status -> Bool
(Status -> Status -> Bool)
-> (Status -> Status -> Bool) -> Eq Status
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Status -> Status -> Bool
== :: Status -> Status -> Bool
$c/= :: Status -> Status -> Bool
/= :: Status -> Status -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Status where
parseJSON :: Value -> Parser Status
parseJSON = [Char] -> (Object -> Parser Status) -> Value -> Parser Status
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Status" ((Object -> Parser Status) -> Value -> Parser Status)
-> (Object -> Parser Status) -> Value -> Parser Status
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int -> Maybe [Map [Char] [Char]] -> Maybe Text -> Status
Status
(Maybe Int -> Maybe [Map [Char] [Char]] -> Maybe Text -> Status)
-> Parser (Maybe Int)
-> Parser (Maybe [Map [Char] [Char]] -> Maybe Text -> Status)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"code")
Parser (Maybe [Map [Char] [Char]] -> Maybe Text -> Status)
-> Parser (Maybe [Map [Char] [Char]])
-> Parser (Maybe Text -> Status)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Map [Char] [Char]])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"details")
Parser (Maybe Text -> Status)
-> Parser (Maybe Text) -> Parser Status
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"message")
instance A.ToJSON Status where
toJSON :: Status -> Value
toJSON Status {Maybe Int
Maybe [Map [Char] [Char]]
Maybe Text
statusCode :: Status -> Maybe Int
statusDetails :: Status -> Maybe [Map [Char] [Char]]
statusMessage :: Status -> Maybe Text
statusCode :: Maybe Int
statusDetails :: Maybe [Map [Char] [Char]]
statusMessage :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"code" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
statusCode
, Key
"details" Key -> Maybe [Map [Char] [Char]] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Map [Char] [Char]]
statusDetails
, Key
"message" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
statusMessage
]
mkStatus ::
Status
mkStatus :: Status
mkStatus =
Status
{ statusCode :: Maybe Int
statusCode = Maybe Int
forall a. Maybe a
Nothing
, statusDetails :: Maybe [Map [Char] [Char]]
statusDetails = Maybe [Map [Char] [Char]]
forall a. Maybe a
Nothing
, statusMessage :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Nothing
}
data StringList = StringList
{ StringList -> Maybe [Text]
stringListValues :: !(Maybe [Text])
}
deriving (Int -> StringList -> ShowS
[StringList] -> ShowS
StringList -> [Char]
(Int -> StringList -> ShowS)
-> (StringList -> [Char])
-> ([StringList] -> ShowS)
-> Show StringList
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StringList -> ShowS
showsPrec :: Int -> StringList -> ShowS
$cshow :: StringList -> [Char]
show :: StringList -> [Char]
$cshowList :: [StringList] -> ShowS
showList :: [StringList] -> ShowS
P.Show, StringList -> StringList -> Bool
(StringList -> StringList -> Bool)
-> (StringList -> StringList -> Bool) -> Eq StringList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StringList -> StringList -> Bool
== :: StringList -> StringList -> Bool
$c/= :: StringList -> StringList -> Bool
/= :: StringList -> StringList -> Bool
P.Eq, P.Typeable)
instance A.FromJSON StringList where
parseJSON :: Value -> Parser StringList
parseJSON = [Char]
-> (Object -> Parser StringList) -> Value -> Parser StringList
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"StringList" ((Object -> Parser StringList) -> Value -> Parser StringList)
-> (Object -> Parser StringList) -> Value -> Parser StringList
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [Text] -> StringList
StringList
(Maybe [Text] -> StringList)
-> Parser (Maybe [Text]) -> Parser StringList
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"values")
instance A.ToJSON StringList where
toJSON :: StringList -> Value
toJSON StringList {Maybe [Text]
stringListValues :: StringList -> Maybe [Text]
stringListValues :: Maybe [Text]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"values" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
stringListValues
]
mkStringList ::
StringList
mkStringList :: StringList
mkStringList =
StringList
{ stringListValues :: Maybe [Text]
stringListValues = Maybe [Text]
forall a. Maybe a
Nothing
}
data TextCompletion = TextCompletion
{ TextCompletion -> Maybe [SafetyRating]
textCompletionSafetyRatings :: !(Maybe [SafetyRating])
, TextCompletion -> Maybe Text
textCompletionOutput :: !(Maybe Text)
, TextCompletion -> Maybe CitationMetadata
textCompletionCitationMetadata :: !(Maybe CitationMetadata)
}
deriving (Int -> TextCompletion -> ShowS
[TextCompletion] -> ShowS
TextCompletion -> [Char]
(Int -> TextCompletion -> ShowS)
-> (TextCompletion -> [Char])
-> ([TextCompletion] -> ShowS)
-> Show TextCompletion
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TextCompletion -> ShowS
showsPrec :: Int -> TextCompletion -> ShowS
$cshow :: TextCompletion -> [Char]
show :: TextCompletion -> [Char]
$cshowList :: [TextCompletion] -> ShowS
showList :: [TextCompletion] -> ShowS
P.Show, TextCompletion -> TextCompletion -> Bool
(TextCompletion -> TextCompletion -> Bool)
-> (TextCompletion -> TextCompletion -> Bool) -> Eq TextCompletion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextCompletion -> TextCompletion -> Bool
== :: TextCompletion -> TextCompletion -> Bool
$c/= :: TextCompletion -> TextCompletion -> Bool
/= :: TextCompletion -> TextCompletion -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TextCompletion where
parseJSON :: Value -> Parser TextCompletion
parseJSON = [Char]
-> (Object -> Parser TextCompletion)
-> Value
-> Parser TextCompletion
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TextCompletion" ((Object -> Parser TextCompletion)
-> Value -> Parser TextCompletion)
-> (Object -> Parser TextCompletion)
-> Value
-> Parser TextCompletion
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [SafetyRating]
-> Maybe Text -> Maybe CitationMetadata -> TextCompletion
TextCompletion
(Maybe [SafetyRating]
-> Maybe Text -> Maybe CitationMetadata -> TextCompletion)
-> Parser (Maybe [SafetyRating])
-> Parser (Maybe Text -> Maybe CitationMetadata -> TextCompletion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [SafetyRating])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"safetyRatings")
Parser (Maybe Text -> Maybe CitationMetadata -> TextCompletion)
-> Parser (Maybe Text)
-> Parser (Maybe CitationMetadata -> TextCompletion)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"output")
Parser (Maybe CitationMetadata -> TextCompletion)
-> Parser (Maybe CitationMetadata) -> Parser TextCompletion
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe CitationMetadata)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"citationMetadata")
instance A.ToJSON TextCompletion where
toJSON :: TextCompletion -> Value
toJSON TextCompletion {Maybe [SafetyRating]
Maybe Text
Maybe CitationMetadata
textCompletionSafetyRatings :: TextCompletion -> Maybe [SafetyRating]
textCompletionOutput :: TextCompletion -> Maybe Text
textCompletionCitationMetadata :: TextCompletion -> Maybe CitationMetadata
textCompletionSafetyRatings :: Maybe [SafetyRating]
textCompletionOutput :: Maybe Text
textCompletionCitationMetadata :: Maybe CitationMetadata
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"safetyRatings" Key -> Maybe [SafetyRating] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [SafetyRating]
textCompletionSafetyRatings
, Key
"output" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
textCompletionOutput
, Key
"citationMetadata" Key -> Maybe CitationMetadata -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe CitationMetadata
textCompletionCitationMetadata
]
mkTextCompletion ::
TextCompletion
mkTextCompletion :: TextCompletion
mkTextCompletion =
TextCompletion
{ textCompletionSafetyRatings :: Maybe [SafetyRating]
textCompletionSafetyRatings = Maybe [SafetyRating]
forall a. Maybe a
Nothing
, textCompletionOutput :: Maybe Text
textCompletionOutput = Maybe Text
forall a. Maybe a
Nothing
, textCompletionCitationMetadata :: Maybe CitationMetadata
textCompletionCitationMetadata = Maybe CitationMetadata
forall a. Maybe a
Nothing
}
data TextPrompt = TextPrompt
{ TextPrompt -> Text
textPromptText :: !(Text)
}
deriving (Int -> TextPrompt -> ShowS
[TextPrompt] -> ShowS
TextPrompt -> [Char]
(Int -> TextPrompt -> ShowS)
-> (TextPrompt -> [Char])
-> ([TextPrompt] -> ShowS)
-> Show TextPrompt
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TextPrompt -> ShowS
showsPrec :: Int -> TextPrompt -> ShowS
$cshow :: TextPrompt -> [Char]
show :: TextPrompt -> [Char]
$cshowList :: [TextPrompt] -> ShowS
showList :: [TextPrompt] -> ShowS
P.Show, TextPrompt -> TextPrompt -> Bool
(TextPrompt -> TextPrompt -> Bool)
-> (TextPrompt -> TextPrompt -> Bool) -> Eq TextPrompt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextPrompt -> TextPrompt -> Bool
== :: TextPrompt -> TextPrompt -> Bool
$c/= :: TextPrompt -> TextPrompt -> Bool
/= :: TextPrompt -> TextPrompt -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TextPrompt where
parseJSON :: Value -> Parser TextPrompt
parseJSON = [Char]
-> (Object -> Parser TextPrompt) -> Value -> Parser TextPrompt
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TextPrompt" ((Object -> Parser TextPrompt) -> Value -> Parser TextPrompt)
-> (Object -> Parser TextPrompt) -> Value -> Parser TextPrompt
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Text -> TextPrompt
TextPrompt
(Text -> TextPrompt) -> Parser Text -> Parser TextPrompt
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"text")
instance A.ToJSON TextPrompt where
toJSON :: TextPrompt -> Value
toJSON TextPrompt {Text
textPromptText :: TextPrompt -> Text
textPromptText :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"text" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
textPromptText
]
mkTextPrompt ::
Text ->
TextPrompt
mkTextPrompt :: Text -> TextPrompt
mkTextPrompt Text
textPromptText =
TextPrompt
{ Text
textPromptText :: Text
textPromptText :: Text
textPromptText
}
data ThinkingConfig = ThinkingConfig
{ ThinkingConfig -> Maybe Int
thinkingConfigThinkingBudget :: !(Maybe Int)
, ThinkingConfig -> Maybe Bool
thinkingConfigIncludeThoughts :: !(Maybe Bool)
}
deriving (Int -> ThinkingConfig -> ShowS
[ThinkingConfig] -> ShowS
ThinkingConfig -> [Char]
(Int -> ThinkingConfig -> ShowS)
-> (ThinkingConfig -> [Char])
-> ([ThinkingConfig] -> ShowS)
-> Show ThinkingConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThinkingConfig -> ShowS
showsPrec :: Int -> ThinkingConfig -> ShowS
$cshow :: ThinkingConfig -> [Char]
show :: ThinkingConfig -> [Char]
$cshowList :: [ThinkingConfig] -> ShowS
showList :: [ThinkingConfig] -> ShowS
P.Show, ThinkingConfig -> ThinkingConfig -> Bool
(ThinkingConfig -> ThinkingConfig -> Bool)
-> (ThinkingConfig -> ThinkingConfig -> Bool) -> Eq ThinkingConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThinkingConfig -> ThinkingConfig -> Bool
== :: ThinkingConfig -> ThinkingConfig -> Bool
$c/= :: ThinkingConfig -> ThinkingConfig -> Bool
/= :: ThinkingConfig -> ThinkingConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ThinkingConfig where
parseJSON :: Value -> Parser ThinkingConfig
parseJSON = [Char]
-> (Object -> Parser ThinkingConfig)
-> Value
-> Parser ThinkingConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ThinkingConfig" ((Object -> Parser ThinkingConfig)
-> Value -> Parser ThinkingConfig)
-> (Object -> Parser ThinkingConfig)
-> Value
-> Parser ThinkingConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Int -> Maybe Bool -> ThinkingConfig
ThinkingConfig
(Maybe Int -> Maybe Bool -> ThinkingConfig)
-> Parser (Maybe Int) -> Parser (Maybe Bool -> ThinkingConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"thinkingBudget")
Parser (Maybe Bool -> ThinkingConfig)
-> Parser (Maybe Bool) -> Parser ThinkingConfig
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"includeThoughts")
instance A.ToJSON ThinkingConfig where
toJSON :: ThinkingConfig -> Value
toJSON ThinkingConfig {Maybe Bool
Maybe Int
thinkingConfigThinkingBudget :: ThinkingConfig -> Maybe Int
thinkingConfigIncludeThoughts :: ThinkingConfig -> Maybe Bool
thinkingConfigThinkingBudget :: Maybe Int
thinkingConfigIncludeThoughts :: Maybe Bool
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"thinkingBudget" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
thinkingConfigThinkingBudget
, Key
"includeThoughts" Key -> Maybe Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
thinkingConfigIncludeThoughts
]
mkThinkingConfig ::
ThinkingConfig
mkThinkingConfig :: ThinkingConfig
mkThinkingConfig =
ThinkingConfig
{ thinkingConfigThinkingBudget :: Maybe Int
thinkingConfigThinkingBudget = Maybe Int
forall a. Maybe a
Nothing
, thinkingConfigIncludeThoughts :: Maybe Bool
thinkingConfigIncludeThoughts = Maybe Bool
forall a. Maybe a
Nothing
}
data Tool = Tool
{ Tool -> Maybe [FunctionDeclaration]
toolFunctionDeclarations :: !(Maybe [FunctionDeclaration])
, Tool -> Maybe GoogleSearchRetrieval
toolGoogleSearchRetrieval :: !(Maybe GoogleSearchRetrieval)
, Tool -> Maybe GoogleSearch
toolGoogleSearch :: !(Maybe GoogleSearch)
, Tool -> Maybe Value
toolCodeExecution :: !(Maybe A.Value)
, Tool -> Maybe Value
toolUrlContext :: !(Maybe A.Value)
}
deriving (Int -> Tool -> ShowS
[Tool] -> ShowS
Tool -> [Char]
(Int -> Tool -> ShowS)
-> (Tool -> [Char]) -> ([Tool] -> ShowS) -> Show Tool
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Tool -> ShowS
showsPrec :: Int -> Tool -> ShowS
$cshow :: Tool -> [Char]
show :: Tool -> [Char]
$cshowList :: [Tool] -> ShowS
showList :: [Tool] -> ShowS
P.Show, Tool -> Tool -> Bool
(Tool -> Tool -> Bool) -> (Tool -> Tool -> Bool) -> Eq Tool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Tool -> Tool -> Bool
== :: Tool -> Tool -> Bool
$c/= :: Tool -> Tool -> Bool
/= :: Tool -> Tool -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Tool where
parseJSON :: Value -> Parser Tool
parseJSON = [Char] -> (Object -> Parser Tool) -> Value -> Parser Tool
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Tool" ((Object -> Parser Tool) -> Value -> Parser Tool)
-> (Object -> Parser Tool) -> Value -> Parser Tool
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [FunctionDeclaration]
-> Maybe GoogleSearchRetrieval
-> Maybe GoogleSearch
-> Maybe Value
-> Maybe Value
-> Tool
Tool
(Maybe [FunctionDeclaration]
-> Maybe GoogleSearchRetrieval
-> Maybe GoogleSearch
-> Maybe Value
-> Maybe Value
-> Tool)
-> Parser (Maybe [FunctionDeclaration])
-> Parser
(Maybe GoogleSearchRetrieval
-> Maybe GoogleSearch -> Maybe Value -> Maybe Value -> Tool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [FunctionDeclaration])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"functionDeclarations")
Parser
(Maybe GoogleSearchRetrieval
-> Maybe GoogleSearch -> Maybe Value -> Maybe Value -> Tool)
-> Parser (Maybe GoogleSearchRetrieval)
-> Parser
(Maybe GoogleSearch -> Maybe Value -> Maybe Value -> Tool)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe GoogleSearchRetrieval)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"googleSearchRetrieval")
Parser (Maybe GoogleSearch -> Maybe Value -> Maybe Value -> Tool)
-> Parser (Maybe GoogleSearch)
-> Parser (Maybe Value -> Maybe Value -> Tool)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe GoogleSearch)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"googleSearch")
Parser (Maybe Value -> Maybe Value -> Tool)
-> Parser (Maybe Value) -> Parser (Maybe Value -> Tool)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"codeExecution")
Parser (Maybe Value -> Tool) -> Parser (Maybe Value) -> Parser Tool
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"urlContext")
instance A.ToJSON Tool where
toJSON :: Tool -> Value
toJSON Tool {Maybe [FunctionDeclaration]
Maybe Value
Maybe GoogleSearch
Maybe GoogleSearchRetrieval
toolFunctionDeclarations :: Tool -> Maybe [FunctionDeclaration]
toolGoogleSearchRetrieval :: Tool -> Maybe GoogleSearchRetrieval
toolGoogleSearch :: Tool -> Maybe GoogleSearch
toolCodeExecution :: Tool -> Maybe Value
toolUrlContext :: Tool -> Maybe Value
toolFunctionDeclarations :: Maybe [FunctionDeclaration]
toolGoogleSearchRetrieval :: Maybe GoogleSearchRetrieval
toolGoogleSearch :: Maybe GoogleSearch
toolCodeExecution :: Maybe Value
toolUrlContext :: Maybe Value
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"functionDeclarations" Key -> Maybe [FunctionDeclaration] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [FunctionDeclaration]
toolFunctionDeclarations
, Key
"googleSearchRetrieval" Key -> Maybe GoogleSearchRetrieval -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GoogleSearchRetrieval
toolGoogleSearchRetrieval
, Key
"googleSearch" Key -> Maybe GoogleSearch -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe GoogleSearch
toolGoogleSearch
, Key
"codeExecution" Key -> Maybe Value -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Value
toolCodeExecution
, Key
"urlContext" Key -> Maybe Value -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Value
toolUrlContext
]
mkTool ::
Tool
mkTool :: Tool
mkTool =
Tool
{ toolFunctionDeclarations :: Maybe [FunctionDeclaration]
toolFunctionDeclarations = Maybe [FunctionDeclaration]
forall a. Maybe a
Nothing
, toolGoogleSearchRetrieval :: Maybe GoogleSearchRetrieval
toolGoogleSearchRetrieval = Maybe GoogleSearchRetrieval
forall a. Maybe a
Nothing
, toolGoogleSearch :: Maybe GoogleSearch
toolGoogleSearch = Maybe GoogleSearch
forall a. Maybe a
Nothing
, toolCodeExecution :: Maybe Value
toolCodeExecution = Maybe Value
forall a. Maybe a
Nothing
, toolUrlContext :: Maybe Value
toolUrlContext = Maybe Value
forall a. Maybe a
Nothing
}
data ToolConfig = ToolConfig
{ ToolConfig -> Maybe FunctionCallingConfig
toolConfigFunctionCallingConfig :: !(Maybe FunctionCallingConfig)
}
deriving (Int -> ToolConfig -> ShowS
[ToolConfig] -> ShowS
ToolConfig -> [Char]
(Int -> ToolConfig -> ShowS)
-> (ToolConfig -> [Char])
-> ([ToolConfig] -> ShowS)
-> Show ToolConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToolConfig -> ShowS
showsPrec :: Int -> ToolConfig -> ShowS
$cshow :: ToolConfig -> [Char]
show :: ToolConfig -> [Char]
$cshowList :: [ToolConfig] -> ShowS
showList :: [ToolConfig] -> ShowS
P.Show, ToolConfig -> ToolConfig -> Bool
(ToolConfig -> ToolConfig -> Bool)
-> (ToolConfig -> ToolConfig -> Bool) -> Eq ToolConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToolConfig -> ToolConfig -> Bool
== :: ToolConfig -> ToolConfig -> Bool
$c/= :: ToolConfig -> ToolConfig -> Bool
/= :: ToolConfig -> ToolConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON ToolConfig where
parseJSON :: Value -> Parser ToolConfig
parseJSON = [Char]
-> (Object -> Parser ToolConfig) -> Value -> Parser ToolConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"ToolConfig" ((Object -> Parser ToolConfig) -> Value -> Parser ToolConfig)
-> (Object -> Parser ToolConfig) -> Value -> Parser ToolConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe FunctionCallingConfig -> ToolConfig
ToolConfig
(Maybe FunctionCallingConfig -> ToolConfig)
-> Parser (Maybe FunctionCallingConfig) -> Parser ToolConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe FunctionCallingConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"functionCallingConfig")
instance A.ToJSON ToolConfig where
toJSON :: ToolConfig -> Value
toJSON ToolConfig {Maybe FunctionCallingConfig
toolConfigFunctionCallingConfig :: ToolConfig -> Maybe FunctionCallingConfig
toolConfigFunctionCallingConfig :: Maybe FunctionCallingConfig
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"functionCallingConfig" Key -> Maybe FunctionCallingConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe FunctionCallingConfig
toolConfigFunctionCallingConfig
]
mkToolConfig ::
ToolConfig
mkToolConfig :: ToolConfig
mkToolConfig =
ToolConfig
{ toolConfigFunctionCallingConfig :: Maybe FunctionCallingConfig
toolConfigFunctionCallingConfig = Maybe FunctionCallingConfig
forall a. Maybe a
Nothing
}
data TopCandidates = TopCandidates
{ TopCandidates -> Maybe [LogprobsResultCandidate]
topCandidatesCandidates :: !(Maybe [LogprobsResultCandidate])
}
deriving (Int -> TopCandidates -> ShowS
[TopCandidates] -> ShowS
TopCandidates -> [Char]
(Int -> TopCandidates -> ShowS)
-> (TopCandidates -> [Char])
-> ([TopCandidates] -> ShowS)
-> Show TopCandidates
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TopCandidates -> ShowS
showsPrec :: Int -> TopCandidates -> ShowS
$cshow :: TopCandidates -> [Char]
show :: TopCandidates -> [Char]
$cshowList :: [TopCandidates] -> ShowS
showList :: [TopCandidates] -> ShowS
P.Show, TopCandidates -> TopCandidates -> Bool
(TopCandidates -> TopCandidates -> Bool)
-> (TopCandidates -> TopCandidates -> Bool) -> Eq TopCandidates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TopCandidates -> TopCandidates -> Bool
== :: TopCandidates -> TopCandidates -> Bool
$c/= :: TopCandidates -> TopCandidates -> Bool
/= :: TopCandidates -> TopCandidates -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TopCandidates where
parseJSON :: Value -> Parser TopCandidates
parseJSON = [Char]
-> (Object -> Parser TopCandidates)
-> Value
-> Parser TopCandidates
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TopCandidates" ((Object -> Parser TopCandidates) -> Value -> Parser TopCandidates)
-> (Object -> Parser TopCandidates)
-> Value
-> Parser TopCandidates
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [LogprobsResultCandidate] -> TopCandidates
TopCandidates
(Maybe [LogprobsResultCandidate] -> TopCandidates)
-> Parser (Maybe [LogprobsResultCandidate]) -> Parser TopCandidates
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [LogprobsResultCandidate])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidates")
instance A.ToJSON TopCandidates where
toJSON :: TopCandidates -> Value
toJSON TopCandidates {Maybe [LogprobsResultCandidate]
topCandidatesCandidates :: TopCandidates -> Maybe [LogprobsResultCandidate]
topCandidatesCandidates :: Maybe [LogprobsResultCandidate]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"candidates" Key -> Maybe [LogprobsResultCandidate] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [LogprobsResultCandidate]
topCandidatesCandidates
]
mkTopCandidates ::
TopCandidates
mkTopCandidates :: TopCandidates
mkTopCandidates =
TopCandidates
{ topCandidatesCandidates :: Maybe [LogprobsResultCandidate]
topCandidatesCandidates = Maybe [LogprobsResultCandidate]
forall a. Maybe a
Nothing
}
data TransferOwnershipRequest = TransferOwnershipRequest
{ TransferOwnershipRequest -> Text
transferOwnershipRequestEmailAddress :: !(Text)
}
deriving (Int -> TransferOwnershipRequest -> ShowS
[TransferOwnershipRequest] -> ShowS
TransferOwnershipRequest -> [Char]
(Int -> TransferOwnershipRequest -> ShowS)
-> (TransferOwnershipRequest -> [Char])
-> ([TransferOwnershipRequest] -> ShowS)
-> Show TransferOwnershipRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransferOwnershipRequest -> ShowS
showsPrec :: Int -> TransferOwnershipRequest -> ShowS
$cshow :: TransferOwnershipRequest -> [Char]
show :: TransferOwnershipRequest -> [Char]
$cshowList :: [TransferOwnershipRequest] -> ShowS
showList :: [TransferOwnershipRequest] -> ShowS
P.Show, TransferOwnershipRequest -> TransferOwnershipRequest -> Bool
(TransferOwnershipRequest -> TransferOwnershipRequest -> Bool)
-> (TransferOwnershipRequest -> TransferOwnershipRequest -> Bool)
-> Eq TransferOwnershipRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TransferOwnershipRequest -> TransferOwnershipRequest -> Bool
== :: TransferOwnershipRequest -> TransferOwnershipRequest -> Bool
$c/= :: TransferOwnershipRequest -> TransferOwnershipRequest -> Bool
/= :: TransferOwnershipRequest -> TransferOwnershipRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TransferOwnershipRequest where
parseJSON :: Value -> Parser TransferOwnershipRequest
parseJSON = [Char]
-> (Object -> Parser TransferOwnershipRequest)
-> Value
-> Parser TransferOwnershipRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TransferOwnershipRequest" ((Object -> Parser TransferOwnershipRequest)
-> Value -> Parser TransferOwnershipRequest)
-> (Object -> Parser TransferOwnershipRequest)
-> Value
-> Parser TransferOwnershipRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Text -> TransferOwnershipRequest
TransferOwnershipRequest
(Text -> TransferOwnershipRequest)
-> Parser Text -> Parser TransferOwnershipRequest
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"emailAddress")
instance A.ToJSON TransferOwnershipRequest where
toJSON :: TransferOwnershipRequest -> Value
toJSON TransferOwnershipRequest {Text
transferOwnershipRequestEmailAddress :: TransferOwnershipRequest -> Text
transferOwnershipRequestEmailAddress :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"emailAddress" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
transferOwnershipRequestEmailAddress
]
mkTransferOwnershipRequest ::
Text ->
TransferOwnershipRequest
mkTransferOwnershipRequest :: Text -> TransferOwnershipRequest
mkTransferOwnershipRequest Text
transferOwnershipRequestEmailAddress =
TransferOwnershipRequest
{ Text
transferOwnershipRequestEmailAddress :: Text
transferOwnershipRequestEmailAddress :: Text
transferOwnershipRequestEmailAddress
}
data TunedModel = TunedModel
{ TunedModel -> Maybe DateTime
tunedModelUpdateTime :: !(Maybe DateTime)
, TunedModel -> Maybe Text
tunedModelName :: !(Maybe Text)
, TunedModel -> Maybe DateTime
tunedModelCreateTime :: !(Maybe DateTime)
, TunedModel -> TuningTask
tunedModelTuningTask :: !(TuningTask)
, TunedModel -> Maybe TunedModelSource
tunedModelTunedModelSource :: !(Maybe TunedModelSource)
, TunedModel -> Maybe Text
tunedModelBaseModel :: !(Maybe Text)
, TunedModel -> Maybe [Text]
tunedModelReaderProjectNumbers :: !(Maybe [Text])
, TunedModel -> Maybe Text
tunedModelDisplayName :: !(Maybe Text)
, TunedModel -> Maybe Float
tunedModelTemperature :: !(Maybe Float)
, TunedModel -> Maybe Text
tunedModelDescription :: !(Maybe Text)
, TunedModel -> Maybe Float
tunedModelTopP :: !(Maybe Float)
, TunedModel -> Maybe Int
tunedModelTopK :: !(Maybe Int)
, TunedModel -> Maybe E'State3
tunedModelState :: !(Maybe E'State3)
}
deriving (Int -> TunedModel -> ShowS
[TunedModel] -> ShowS
TunedModel -> [Char]
(Int -> TunedModel -> ShowS)
-> (TunedModel -> [Char])
-> ([TunedModel] -> ShowS)
-> Show TunedModel
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TunedModel -> ShowS
showsPrec :: Int -> TunedModel -> ShowS
$cshow :: TunedModel -> [Char]
show :: TunedModel -> [Char]
$cshowList :: [TunedModel] -> ShowS
showList :: [TunedModel] -> ShowS
P.Show, TunedModel -> TunedModel -> Bool
(TunedModel -> TunedModel -> Bool)
-> (TunedModel -> TunedModel -> Bool) -> Eq TunedModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TunedModel -> TunedModel -> Bool
== :: TunedModel -> TunedModel -> Bool
$c/= :: TunedModel -> TunedModel -> Bool
/= :: TunedModel -> TunedModel -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TunedModel where
parseJSON :: Value -> Parser TunedModel
parseJSON = [Char]
-> (Object -> Parser TunedModel) -> Value -> Parser TunedModel
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TunedModel" ((Object -> Parser TunedModel) -> Value -> Parser TunedModel)
-> (Object -> Parser TunedModel) -> Value -> Parser TunedModel
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel
TunedModel
(Maybe DateTime
-> Maybe Text
-> Maybe DateTime
-> TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe DateTime)
-> Parser
(Maybe Text
-> Maybe DateTime
-> TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"updateTime")
Parser
(Maybe Text
-> Maybe DateTime
-> TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe Text)
-> Parser
(Maybe DateTime
-> TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"name")
Parser
(Maybe DateTime
-> TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe DateTime)
-> Parser
(TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"createTime")
Parser
(TuningTask
-> Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser TuningTask
-> Parser
(Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser TuningTask
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"tuningTask")
Parser
(Maybe TunedModelSource
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe TunedModelSource)
-> Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe TunedModelSource)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tunedModelSource")
Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"baseModel")
Parser
(Maybe [Text]
-> Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"readerProjectNumbers")
Parser
(Maybe Text
-> Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe Text)
-> Parser
(Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"displayName")
Parser
(Maybe Float
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe E'State3
-> TunedModel)
-> Parser (Maybe Float)
-> Parser
(Maybe Text
-> Maybe Float -> Maybe Int -> Maybe E'State3 -> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"temperature")
Parser
(Maybe Text
-> Maybe Float -> Maybe Int -> Maybe E'State3 -> TunedModel)
-> Parser (Maybe Text)
-> Parser
(Maybe Float -> Maybe Int -> Maybe E'State3 -> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description")
Parser (Maybe Float -> Maybe Int -> Maybe E'State3 -> TunedModel)
-> Parser (Maybe Float)
-> Parser (Maybe Int -> Maybe E'State3 -> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topP")
Parser (Maybe Int -> Maybe E'State3 -> TunedModel)
-> Parser (Maybe Int) -> Parser (Maybe E'State3 -> TunedModel)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"topK")
Parser (Maybe E'State3 -> TunedModel)
-> Parser (Maybe E'State3) -> Parser TunedModel
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'State3)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"state")
instance A.ToJSON TunedModel where
toJSON :: TunedModel -> Value
toJSON TunedModel {Maybe Float
Maybe Int
Maybe [Text]
Maybe Text
Maybe DateTime
Maybe E'State3
Maybe TunedModelSource
TuningTask
tunedModelUpdateTime :: TunedModel -> Maybe DateTime
tunedModelName :: TunedModel -> Maybe Text
tunedModelCreateTime :: TunedModel -> Maybe DateTime
tunedModelTuningTask :: TunedModel -> TuningTask
tunedModelTunedModelSource :: TunedModel -> Maybe TunedModelSource
tunedModelBaseModel :: TunedModel -> Maybe Text
tunedModelReaderProjectNumbers :: TunedModel -> Maybe [Text]
tunedModelDisplayName :: TunedModel -> Maybe Text
tunedModelTemperature :: TunedModel -> Maybe Float
tunedModelDescription :: TunedModel -> Maybe Text
tunedModelTopP :: TunedModel -> Maybe Float
tunedModelTopK :: TunedModel -> Maybe Int
tunedModelState :: TunedModel -> Maybe E'State3
tunedModelUpdateTime :: Maybe DateTime
tunedModelName :: Maybe Text
tunedModelCreateTime :: Maybe DateTime
tunedModelTuningTask :: TuningTask
tunedModelTunedModelSource :: Maybe TunedModelSource
tunedModelBaseModel :: Maybe Text
tunedModelReaderProjectNumbers :: Maybe [Text]
tunedModelDisplayName :: Maybe Text
tunedModelTemperature :: Maybe Float
tunedModelDescription :: Maybe Text
tunedModelTopP :: Maybe Float
tunedModelTopK :: Maybe Int
tunedModelState :: Maybe E'State3
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"updateTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
tunedModelUpdateTime
, Key
"name" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
tunedModelName
, Key
"createTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
tunedModelCreateTime
, Key
"tuningTask" Key -> TuningTask -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TuningTask
tunedModelTuningTask
, Key
"tunedModelSource" Key -> Maybe TunedModelSource -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe TunedModelSource
tunedModelTunedModelSource
, Key
"baseModel" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
tunedModelBaseModel
, Key
"readerProjectNumbers" Key -> Maybe [Text] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [Text]
tunedModelReaderProjectNumbers
, Key
"displayName" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
tunedModelDisplayName
, Key
"temperature" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
tunedModelTemperature
, Key
"description" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
tunedModelDescription
, Key
"topP" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
tunedModelTopP
, Key
"topK" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
tunedModelTopK
, Key
"state" Key -> Maybe E'State3 -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'State3
tunedModelState
]
mkTunedModel ::
TuningTask ->
TunedModel
mkTunedModel :: TuningTask -> TunedModel
mkTunedModel TuningTask
tunedModelTuningTask =
TunedModel
{ tunedModelUpdateTime :: Maybe DateTime
tunedModelUpdateTime = Maybe DateTime
forall a. Maybe a
Nothing
, tunedModelName :: Maybe Text
tunedModelName = Maybe Text
forall a. Maybe a
Nothing
, tunedModelCreateTime :: Maybe DateTime
tunedModelCreateTime = Maybe DateTime
forall a. Maybe a
Nothing
, TuningTask
tunedModelTuningTask :: TuningTask
tunedModelTuningTask :: TuningTask
tunedModelTuningTask
, tunedModelTunedModelSource :: Maybe TunedModelSource
tunedModelTunedModelSource = Maybe TunedModelSource
forall a. Maybe a
Nothing
, tunedModelBaseModel :: Maybe Text
tunedModelBaseModel = Maybe Text
forall a. Maybe a
Nothing
, tunedModelReaderProjectNumbers :: Maybe [Text]
tunedModelReaderProjectNumbers = Maybe [Text]
forall a. Maybe a
Nothing
, tunedModelDisplayName :: Maybe Text
tunedModelDisplayName = Maybe Text
forall a. Maybe a
Nothing
, tunedModelTemperature :: Maybe Float
tunedModelTemperature = Maybe Float
forall a. Maybe a
Nothing
, tunedModelDescription :: Maybe Text
tunedModelDescription = Maybe Text
forall a. Maybe a
Nothing
, tunedModelTopP :: Maybe Float
tunedModelTopP = Maybe Float
forall a. Maybe a
Nothing
, tunedModelTopK :: Maybe Int
tunedModelTopK = Maybe Int
forall a. Maybe a
Nothing
, tunedModelState :: Maybe E'State3
tunedModelState = Maybe E'State3
forall a. Maybe a
Nothing
}
data TunedModelSource = TunedModelSource
{ TunedModelSource -> Maybe Text
tunedModelSourceTunedModel :: !(Maybe Text)
, TunedModelSource -> Maybe Text
tunedModelSourceBaseModel :: !(Maybe Text)
}
deriving (Int -> TunedModelSource -> ShowS
[TunedModelSource] -> ShowS
TunedModelSource -> [Char]
(Int -> TunedModelSource -> ShowS)
-> (TunedModelSource -> [Char])
-> ([TunedModelSource] -> ShowS)
-> Show TunedModelSource
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TunedModelSource -> ShowS
showsPrec :: Int -> TunedModelSource -> ShowS
$cshow :: TunedModelSource -> [Char]
show :: TunedModelSource -> [Char]
$cshowList :: [TunedModelSource] -> ShowS
showList :: [TunedModelSource] -> ShowS
P.Show, TunedModelSource -> TunedModelSource -> Bool
(TunedModelSource -> TunedModelSource -> Bool)
-> (TunedModelSource -> TunedModelSource -> Bool)
-> Eq TunedModelSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TunedModelSource -> TunedModelSource -> Bool
== :: TunedModelSource -> TunedModelSource -> Bool
$c/= :: TunedModelSource -> TunedModelSource -> Bool
/= :: TunedModelSource -> TunedModelSource -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TunedModelSource where
parseJSON :: Value -> Parser TunedModelSource
parseJSON = [Char]
-> (Object -> Parser TunedModelSource)
-> Value
-> Parser TunedModelSource
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TunedModelSource" ((Object -> Parser TunedModelSource)
-> Value -> Parser TunedModelSource)
-> (Object -> Parser TunedModelSource)
-> Value
-> Parser TunedModelSource
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe Text -> TunedModelSource
TunedModelSource
(Maybe Text -> Maybe Text -> TunedModelSource)
-> Parser (Maybe Text) -> Parser (Maybe Text -> TunedModelSource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tunedModel")
Parser (Maybe Text -> TunedModelSource)
-> Parser (Maybe Text) -> Parser TunedModelSource
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"baseModel")
instance A.ToJSON TunedModelSource where
toJSON :: TunedModelSource -> Value
toJSON TunedModelSource {Maybe Text
tunedModelSourceTunedModel :: TunedModelSource -> Maybe Text
tunedModelSourceBaseModel :: TunedModelSource -> Maybe Text
tunedModelSourceTunedModel :: Maybe Text
tunedModelSourceBaseModel :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"tunedModel" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
tunedModelSourceTunedModel
, Key
"baseModel" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
tunedModelSourceBaseModel
]
mkTunedModelSource ::
TunedModelSource
mkTunedModelSource :: TunedModelSource
mkTunedModelSource =
TunedModelSource
{ tunedModelSourceTunedModel :: Maybe Text
tunedModelSourceTunedModel = Maybe Text
forall a. Maybe a
Nothing
, tunedModelSourceBaseModel :: Maybe Text
tunedModelSourceBaseModel = Maybe Text
forall a. Maybe a
Nothing
}
data TuningExample = TuningExample
{ TuningExample -> Maybe Text
tuningExampleTextInput :: !(Maybe Text)
, TuningExample -> Text
tuningExampleOutput :: !(Text)
}
deriving (Int -> TuningExample -> ShowS
[TuningExample] -> ShowS
TuningExample -> [Char]
(Int -> TuningExample -> ShowS)
-> (TuningExample -> [Char])
-> ([TuningExample] -> ShowS)
-> Show TuningExample
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TuningExample -> ShowS
showsPrec :: Int -> TuningExample -> ShowS
$cshow :: TuningExample -> [Char]
show :: TuningExample -> [Char]
$cshowList :: [TuningExample] -> ShowS
showList :: [TuningExample] -> ShowS
P.Show, TuningExample -> TuningExample -> Bool
(TuningExample -> TuningExample -> Bool)
-> (TuningExample -> TuningExample -> Bool) -> Eq TuningExample
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TuningExample -> TuningExample -> Bool
== :: TuningExample -> TuningExample -> Bool
$c/= :: TuningExample -> TuningExample -> Bool
/= :: TuningExample -> TuningExample -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TuningExample where
parseJSON :: Value -> Parser TuningExample
parseJSON = [Char]
-> (Object -> Parser TuningExample)
-> Value
-> Parser TuningExample
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TuningExample" ((Object -> Parser TuningExample) -> Value -> Parser TuningExample)
-> (Object -> Parser TuningExample)
-> Value
-> Parser TuningExample
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Text -> TuningExample
TuningExample
(Maybe Text -> Text -> TuningExample)
-> Parser (Maybe Text) -> Parser (Text -> TuningExample)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"textInput")
Parser (Text -> TuningExample)
-> Parser Text -> Parser TuningExample
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"output")
instance A.ToJSON TuningExample where
toJSON :: TuningExample -> Value
toJSON TuningExample {Maybe Text
Text
tuningExampleTextInput :: TuningExample -> Maybe Text
tuningExampleOutput :: TuningExample -> Text
tuningExampleTextInput :: Maybe Text
tuningExampleOutput :: Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"textInput" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
tuningExampleTextInput
, Key
"output" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
tuningExampleOutput
]
mkTuningExample ::
Text ->
TuningExample
mkTuningExample :: Text -> TuningExample
mkTuningExample Text
tuningExampleOutput =
TuningExample
{ tuningExampleTextInput :: Maybe Text
tuningExampleTextInput = Maybe Text
forall a. Maybe a
Nothing
, Text
tuningExampleOutput :: Text
tuningExampleOutput :: Text
tuningExampleOutput
}
data TuningExamples = TuningExamples
{ TuningExamples -> Maybe [TuningExample]
tuningExamplesExamples :: !(Maybe [TuningExample])
}
deriving (Int -> TuningExamples -> ShowS
[TuningExamples] -> ShowS
TuningExamples -> [Char]
(Int -> TuningExamples -> ShowS)
-> (TuningExamples -> [Char])
-> ([TuningExamples] -> ShowS)
-> Show TuningExamples
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TuningExamples -> ShowS
showsPrec :: Int -> TuningExamples -> ShowS
$cshow :: TuningExamples -> [Char]
show :: TuningExamples -> [Char]
$cshowList :: [TuningExamples] -> ShowS
showList :: [TuningExamples] -> ShowS
P.Show, TuningExamples -> TuningExamples -> Bool
(TuningExamples -> TuningExamples -> Bool)
-> (TuningExamples -> TuningExamples -> Bool) -> Eq TuningExamples
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TuningExamples -> TuningExamples -> Bool
== :: TuningExamples -> TuningExamples -> Bool
$c/= :: TuningExamples -> TuningExamples -> Bool
/= :: TuningExamples -> TuningExamples -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TuningExamples where
parseJSON :: Value -> Parser TuningExamples
parseJSON = [Char]
-> (Object -> Parser TuningExamples)
-> Value
-> Parser TuningExamples
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TuningExamples" ((Object -> Parser TuningExamples)
-> Value -> Parser TuningExamples)
-> (Object -> Parser TuningExamples)
-> Value
-> Parser TuningExamples
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [TuningExample] -> TuningExamples
TuningExamples
(Maybe [TuningExample] -> TuningExamples)
-> Parser (Maybe [TuningExample]) -> Parser TuningExamples
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [TuningExample])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"examples")
instance A.ToJSON TuningExamples where
toJSON :: TuningExamples -> Value
toJSON TuningExamples {Maybe [TuningExample]
tuningExamplesExamples :: TuningExamples -> Maybe [TuningExample]
tuningExamplesExamples :: Maybe [TuningExample]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"examples" Key -> Maybe [TuningExample] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [TuningExample]
tuningExamplesExamples
]
mkTuningExamples ::
TuningExamples
mkTuningExamples :: TuningExamples
mkTuningExamples =
TuningExamples
{ tuningExamplesExamples :: Maybe [TuningExample]
tuningExamplesExamples = Maybe [TuningExample]
forall a. Maybe a
Nothing
}
data TuningSnapshot = TuningSnapshot
{ TuningSnapshot -> Maybe Float
tuningSnapshotMeanLoss :: !(Maybe Float)
, TuningSnapshot -> Maybe DateTime
tuningSnapshotComputeTime :: !(Maybe DateTime)
, TuningSnapshot -> Maybe Int
tuningSnapshotStep :: !(Maybe Int)
, TuningSnapshot -> Maybe Int
tuningSnapshotEpoch :: !(Maybe Int)
}
deriving (Int -> TuningSnapshot -> ShowS
[TuningSnapshot] -> ShowS
TuningSnapshot -> [Char]
(Int -> TuningSnapshot -> ShowS)
-> (TuningSnapshot -> [Char])
-> ([TuningSnapshot] -> ShowS)
-> Show TuningSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TuningSnapshot -> ShowS
showsPrec :: Int -> TuningSnapshot -> ShowS
$cshow :: TuningSnapshot -> [Char]
show :: TuningSnapshot -> [Char]
$cshowList :: [TuningSnapshot] -> ShowS
showList :: [TuningSnapshot] -> ShowS
P.Show, TuningSnapshot -> TuningSnapshot -> Bool
(TuningSnapshot -> TuningSnapshot -> Bool)
-> (TuningSnapshot -> TuningSnapshot -> Bool) -> Eq TuningSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TuningSnapshot -> TuningSnapshot -> Bool
== :: TuningSnapshot -> TuningSnapshot -> Bool
$c/= :: TuningSnapshot -> TuningSnapshot -> Bool
/= :: TuningSnapshot -> TuningSnapshot -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TuningSnapshot where
parseJSON :: Value -> Parser TuningSnapshot
parseJSON = [Char]
-> (Object -> Parser TuningSnapshot)
-> Value
-> Parser TuningSnapshot
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TuningSnapshot" ((Object -> Parser TuningSnapshot)
-> Value -> Parser TuningSnapshot)
-> (Object -> Parser TuningSnapshot)
-> Value
-> Parser TuningSnapshot
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Float
-> Maybe DateTime -> Maybe Int -> Maybe Int -> TuningSnapshot
TuningSnapshot
(Maybe Float
-> Maybe DateTime -> Maybe Int -> Maybe Int -> TuningSnapshot)
-> Parser (Maybe Float)
-> Parser
(Maybe DateTime -> Maybe Int -> Maybe Int -> TuningSnapshot)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"meanLoss")
Parser (Maybe DateTime -> Maybe Int -> Maybe Int -> TuningSnapshot)
-> Parser (Maybe DateTime)
-> Parser (Maybe Int -> Maybe Int -> TuningSnapshot)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"computeTime")
Parser (Maybe Int -> Maybe Int -> TuningSnapshot)
-> Parser (Maybe Int) -> Parser (Maybe Int -> TuningSnapshot)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"step")
Parser (Maybe Int -> TuningSnapshot)
-> Parser (Maybe Int) -> Parser TuningSnapshot
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"epoch")
instance A.ToJSON TuningSnapshot where
toJSON :: TuningSnapshot -> Value
toJSON TuningSnapshot {Maybe Float
Maybe Int
Maybe DateTime
tuningSnapshotMeanLoss :: TuningSnapshot -> Maybe Float
tuningSnapshotComputeTime :: TuningSnapshot -> Maybe DateTime
tuningSnapshotStep :: TuningSnapshot -> Maybe Int
tuningSnapshotEpoch :: TuningSnapshot -> Maybe Int
tuningSnapshotMeanLoss :: Maybe Float
tuningSnapshotComputeTime :: Maybe DateTime
tuningSnapshotStep :: Maybe Int
tuningSnapshotEpoch :: Maybe Int
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"meanLoss" Key -> Maybe Float -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Float
tuningSnapshotMeanLoss
, Key
"computeTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
tuningSnapshotComputeTime
, Key
"step" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
tuningSnapshotStep
, Key
"epoch" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
tuningSnapshotEpoch
]
mkTuningSnapshot ::
TuningSnapshot
mkTuningSnapshot :: TuningSnapshot
mkTuningSnapshot =
TuningSnapshot
{ tuningSnapshotMeanLoss :: Maybe Float
tuningSnapshotMeanLoss = Maybe Float
forall a. Maybe a
Nothing
, tuningSnapshotComputeTime :: Maybe DateTime
tuningSnapshotComputeTime = Maybe DateTime
forall a. Maybe a
Nothing
, tuningSnapshotStep :: Maybe Int
tuningSnapshotStep = Maybe Int
forall a. Maybe a
Nothing
, tuningSnapshotEpoch :: Maybe Int
tuningSnapshotEpoch = Maybe Int
forall a. Maybe a
Nothing
}
data TuningTask = TuningTask
{ TuningTask -> Maybe DateTime
tuningTaskStartTime :: !(Maybe DateTime)
, TuningTask -> Dataset
tuningTaskTrainingData :: !(Dataset)
, TuningTask -> Maybe Hyperparameters
tuningTaskHyperparameters :: !(Maybe Hyperparameters)
, TuningTask -> Maybe DateTime
tuningTaskCompleteTime :: !(Maybe DateTime)
, TuningTask -> Maybe [TuningSnapshot]
tuningTaskSnapshots :: !(Maybe [TuningSnapshot])
}
deriving (Int -> TuningTask -> ShowS
[TuningTask] -> ShowS
TuningTask -> [Char]
(Int -> TuningTask -> ShowS)
-> (TuningTask -> [Char])
-> ([TuningTask] -> ShowS)
-> Show TuningTask
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TuningTask -> ShowS
showsPrec :: Int -> TuningTask -> ShowS
$cshow :: TuningTask -> [Char]
show :: TuningTask -> [Char]
$cshowList :: [TuningTask] -> ShowS
showList :: [TuningTask] -> ShowS
P.Show, TuningTask -> TuningTask -> Bool
(TuningTask -> TuningTask -> Bool)
-> (TuningTask -> TuningTask -> Bool) -> Eq TuningTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TuningTask -> TuningTask -> Bool
== :: TuningTask -> TuningTask -> Bool
$c/= :: TuningTask -> TuningTask -> Bool
/= :: TuningTask -> TuningTask -> Bool
P.Eq, P.Typeable)
instance A.FromJSON TuningTask where
parseJSON :: Value -> Parser TuningTask
parseJSON = [Char]
-> (Object -> Parser TuningTask) -> Value -> Parser TuningTask
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"TuningTask" ((Object -> Parser TuningTask) -> Value -> Parser TuningTask)
-> (Object -> Parser TuningTask) -> Value -> Parser TuningTask
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe DateTime
-> Dataset
-> Maybe Hyperparameters
-> Maybe DateTime
-> Maybe [TuningSnapshot]
-> TuningTask
TuningTask
(Maybe DateTime
-> Dataset
-> Maybe Hyperparameters
-> Maybe DateTime
-> Maybe [TuningSnapshot]
-> TuningTask)
-> Parser (Maybe DateTime)
-> Parser
(Dataset
-> Maybe Hyperparameters
-> Maybe DateTime
-> Maybe [TuningSnapshot]
-> TuningTask)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"startTime")
Parser
(Dataset
-> Maybe Hyperparameters
-> Maybe DateTime
-> Maybe [TuningSnapshot]
-> TuningTask)
-> Parser Dataset
-> Parser
(Maybe Hyperparameters
-> Maybe DateTime -> Maybe [TuningSnapshot] -> TuningTask)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Dataset
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"trainingData")
Parser
(Maybe Hyperparameters
-> Maybe DateTime -> Maybe [TuningSnapshot] -> TuningTask)
-> Parser (Maybe Hyperparameters)
-> Parser (Maybe DateTime -> Maybe [TuningSnapshot] -> TuningTask)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Hyperparameters)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"hyperparameters")
Parser (Maybe DateTime -> Maybe [TuningSnapshot] -> TuningTask)
-> Parser (Maybe DateTime)
-> Parser (Maybe [TuningSnapshot] -> TuningTask)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe DateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"completeTime")
Parser (Maybe [TuningSnapshot] -> TuningTask)
-> Parser (Maybe [TuningSnapshot]) -> Parser TuningTask
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [TuningSnapshot])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"snapshots")
instance A.ToJSON TuningTask where
toJSON :: TuningTask -> Value
toJSON TuningTask {Maybe [TuningSnapshot]
Maybe DateTime
Maybe Hyperparameters
Dataset
tuningTaskStartTime :: TuningTask -> Maybe DateTime
tuningTaskTrainingData :: TuningTask -> Dataset
tuningTaskHyperparameters :: TuningTask -> Maybe Hyperparameters
tuningTaskCompleteTime :: TuningTask -> Maybe DateTime
tuningTaskSnapshots :: TuningTask -> Maybe [TuningSnapshot]
tuningTaskStartTime :: Maybe DateTime
tuningTaskTrainingData :: Dataset
tuningTaskHyperparameters :: Maybe Hyperparameters
tuningTaskCompleteTime :: Maybe DateTime
tuningTaskSnapshots :: Maybe [TuningSnapshot]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"startTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
tuningTaskStartTime
, Key
"trainingData" Key -> Dataset -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Dataset
tuningTaskTrainingData
, Key
"hyperparameters" Key -> Maybe Hyperparameters -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Hyperparameters
tuningTaskHyperparameters
, Key
"completeTime" Key -> Maybe DateTime -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe DateTime
tuningTaskCompleteTime
, Key
"snapshots" Key -> Maybe [TuningSnapshot] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [TuningSnapshot]
tuningTaskSnapshots
]
mkTuningTask ::
Dataset ->
TuningTask
mkTuningTask :: Dataset -> TuningTask
mkTuningTask Dataset
tuningTaskTrainingData =
TuningTask
{ tuningTaskStartTime :: Maybe DateTime
tuningTaskStartTime = Maybe DateTime
forall a. Maybe a
Nothing
, Dataset
tuningTaskTrainingData :: Dataset
tuningTaskTrainingData :: Dataset
tuningTaskTrainingData
, tuningTaskHyperparameters :: Maybe Hyperparameters
tuningTaskHyperparameters = Maybe Hyperparameters
forall a. Maybe a
Nothing
, tuningTaskCompleteTime :: Maybe DateTime
tuningTaskCompleteTime = Maybe DateTime
forall a. Maybe a
Nothing
, tuningTaskSnapshots :: Maybe [TuningSnapshot]
tuningTaskSnapshots = Maybe [TuningSnapshot]
forall a. Maybe a
Nothing
}
data UpdateChunkRequest = UpdateChunkRequest
{ UpdateChunkRequest -> Text
updateChunkRequestUpdateMask :: !(Text)
, UpdateChunkRequest -> Chunk
updateChunkRequestChunk :: !(Chunk)
}
deriving (Int -> UpdateChunkRequest -> ShowS
[UpdateChunkRequest] -> ShowS
UpdateChunkRequest -> [Char]
(Int -> UpdateChunkRequest -> ShowS)
-> (UpdateChunkRequest -> [Char])
-> ([UpdateChunkRequest] -> ShowS)
-> Show UpdateChunkRequest
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UpdateChunkRequest -> ShowS
showsPrec :: Int -> UpdateChunkRequest -> ShowS
$cshow :: UpdateChunkRequest -> [Char]
show :: UpdateChunkRequest -> [Char]
$cshowList :: [UpdateChunkRequest] -> ShowS
showList :: [UpdateChunkRequest] -> ShowS
P.Show, UpdateChunkRequest -> UpdateChunkRequest -> Bool
(UpdateChunkRequest -> UpdateChunkRequest -> Bool)
-> (UpdateChunkRequest -> UpdateChunkRequest -> Bool)
-> Eq UpdateChunkRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UpdateChunkRequest -> UpdateChunkRequest -> Bool
== :: UpdateChunkRequest -> UpdateChunkRequest -> Bool
$c/= :: UpdateChunkRequest -> UpdateChunkRequest -> Bool
/= :: UpdateChunkRequest -> UpdateChunkRequest -> Bool
P.Eq, P.Typeable)
instance A.FromJSON UpdateChunkRequest where
parseJSON :: Value -> Parser UpdateChunkRequest
parseJSON = [Char]
-> (Object -> Parser UpdateChunkRequest)
-> Value
-> Parser UpdateChunkRequest
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"UpdateChunkRequest" ((Object -> Parser UpdateChunkRequest)
-> Value -> Parser UpdateChunkRequest)
-> (Object -> Parser UpdateChunkRequest)
-> Value
-> Parser UpdateChunkRequest
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Text -> Chunk -> UpdateChunkRequest
UpdateChunkRequest
(Text -> Chunk -> UpdateChunkRequest)
-> Parser Text -> Parser (Chunk -> UpdateChunkRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"updateMask")
Parser (Chunk -> UpdateChunkRequest)
-> Parser Chunk -> Parser UpdateChunkRequest
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser Chunk
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chunk")
instance A.ToJSON UpdateChunkRequest where
toJSON :: UpdateChunkRequest -> Value
toJSON UpdateChunkRequest {Text
Chunk
updateChunkRequestUpdateMask :: UpdateChunkRequest -> Text
updateChunkRequestChunk :: UpdateChunkRequest -> Chunk
updateChunkRequestUpdateMask :: Text
updateChunkRequestChunk :: Chunk
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"updateMask" Key -> Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
updateChunkRequestUpdateMask
, Key
"chunk" Key -> Chunk -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Chunk
updateChunkRequestChunk
]
mkUpdateChunkRequest ::
Text ->
Chunk ->
UpdateChunkRequest
mkUpdateChunkRequest :: Text -> Chunk -> UpdateChunkRequest
mkUpdateChunkRequest Text
updateChunkRequestUpdateMask Chunk
updateChunkRequestChunk =
UpdateChunkRequest
{ Text
updateChunkRequestUpdateMask :: Text
updateChunkRequestUpdateMask :: Text
updateChunkRequestUpdateMask
, Chunk
updateChunkRequestChunk :: Chunk
updateChunkRequestChunk :: Chunk
updateChunkRequestChunk
}
data UrlContextMetadata = UrlContextMetadata
{ UrlContextMetadata -> Maybe [UrlMetadata]
urlContextMetadataUrlMetadata :: !(Maybe [UrlMetadata])
}
deriving (Int -> UrlContextMetadata -> ShowS
[UrlContextMetadata] -> ShowS
UrlContextMetadata -> [Char]
(Int -> UrlContextMetadata -> ShowS)
-> (UrlContextMetadata -> [Char])
-> ([UrlContextMetadata] -> ShowS)
-> Show UrlContextMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UrlContextMetadata -> ShowS
showsPrec :: Int -> UrlContextMetadata -> ShowS
$cshow :: UrlContextMetadata -> [Char]
show :: UrlContextMetadata -> [Char]
$cshowList :: [UrlContextMetadata] -> ShowS
showList :: [UrlContextMetadata] -> ShowS
P.Show, UrlContextMetadata -> UrlContextMetadata -> Bool
(UrlContextMetadata -> UrlContextMetadata -> Bool)
-> (UrlContextMetadata -> UrlContextMetadata -> Bool)
-> Eq UrlContextMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UrlContextMetadata -> UrlContextMetadata -> Bool
== :: UrlContextMetadata -> UrlContextMetadata -> Bool
$c/= :: UrlContextMetadata -> UrlContextMetadata -> Bool
/= :: UrlContextMetadata -> UrlContextMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON UrlContextMetadata where
parseJSON :: Value -> Parser UrlContextMetadata
parseJSON = [Char]
-> (Object -> Parser UrlContextMetadata)
-> Value
-> Parser UrlContextMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"UrlContextMetadata" ((Object -> Parser UrlContextMetadata)
-> Value -> Parser UrlContextMetadata)
-> (Object -> Parser UrlContextMetadata)
-> Value
-> Parser UrlContextMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [UrlMetadata] -> UrlContextMetadata
UrlContextMetadata
(Maybe [UrlMetadata] -> UrlContextMetadata)
-> Parser (Maybe [UrlMetadata]) -> Parser UrlContextMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [UrlMetadata])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"urlMetadata")
instance A.ToJSON UrlContextMetadata where
toJSON :: UrlContextMetadata -> Value
toJSON UrlContextMetadata {Maybe [UrlMetadata]
urlContextMetadataUrlMetadata :: UrlContextMetadata -> Maybe [UrlMetadata]
urlContextMetadataUrlMetadata :: Maybe [UrlMetadata]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"urlMetadata" Key -> Maybe [UrlMetadata] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [UrlMetadata]
urlContextMetadataUrlMetadata
]
mkUrlContextMetadata ::
UrlContextMetadata
mkUrlContextMetadata :: UrlContextMetadata
mkUrlContextMetadata =
UrlContextMetadata
{ urlContextMetadataUrlMetadata :: Maybe [UrlMetadata]
urlContextMetadataUrlMetadata = Maybe [UrlMetadata]
forall a. Maybe a
Nothing
}
data UrlMetadata = UrlMetadata
{ UrlMetadata -> Maybe Text
urlMetadataRetrievedUrl :: !(Maybe Text)
, UrlMetadata -> Maybe E'UrlRetrievalStatus
urlMetadataUrlRetrievalStatus :: !(Maybe E'UrlRetrievalStatus)
}
deriving (Int -> UrlMetadata -> ShowS
[UrlMetadata] -> ShowS
UrlMetadata -> [Char]
(Int -> UrlMetadata -> ShowS)
-> (UrlMetadata -> [Char])
-> ([UrlMetadata] -> ShowS)
-> Show UrlMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UrlMetadata -> ShowS
showsPrec :: Int -> UrlMetadata -> ShowS
$cshow :: UrlMetadata -> [Char]
show :: UrlMetadata -> [Char]
$cshowList :: [UrlMetadata] -> ShowS
showList :: [UrlMetadata] -> ShowS
P.Show, UrlMetadata -> UrlMetadata -> Bool
(UrlMetadata -> UrlMetadata -> Bool)
-> (UrlMetadata -> UrlMetadata -> Bool) -> Eq UrlMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UrlMetadata -> UrlMetadata -> Bool
== :: UrlMetadata -> UrlMetadata -> Bool
$c/= :: UrlMetadata -> UrlMetadata -> Bool
/= :: UrlMetadata -> UrlMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON UrlMetadata where
parseJSON :: Value -> Parser UrlMetadata
parseJSON = [Char]
-> (Object -> Parser UrlMetadata) -> Value -> Parser UrlMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"UrlMetadata" ((Object -> Parser UrlMetadata) -> Value -> Parser UrlMetadata)
-> (Object -> Parser UrlMetadata) -> Value -> Parser UrlMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe E'UrlRetrievalStatus -> UrlMetadata
UrlMetadata
(Maybe Text -> Maybe E'UrlRetrievalStatus -> UrlMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe E'UrlRetrievalStatus -> UrlMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"retrievedUrl")
Parser (Maybe E'UrlRetrievalStatus -> UrlMetadata)
-> Parser (Maybe E'UrlRetrievalStatus) -> Parser UrlMetadata
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe E'UrlRetrievalStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"urlRetrievalStatus")
instance A.ToJSON UrlMetadata where
toJSON :: UrlMetadata -> Value
toJSON UrlMetadata {Maybe Text
Maybe E'UrlRetrievalStatus
urlMetadataRetrievedUrl :: UrlMetadata -> Maybe Text
urlMetadataUrlRetrievalStatus :: UrlMetadata -> Maybe E'UrlRetrievalStatus
urlMetadataRetrievedUrl :: Maybe Text
urlMetadataUrlRetrievalStatus :: Maybe E'UrlRetrievalStatus
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"retrievedUrl" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
urlMetadataRetrievedUrl
, Key
"urlRetrievalStatus" Key -> Maybe E'UrlRetrievalStatus -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe E'UrlRetrievalStatus
urlMetadataUrlRetrievalStatus
]
mkUrlMetadata ::
UrlMetadata
mkUrlMetadata :: UrlMetadata
mkUrlMetadata =
UrlMetadata
{ urlMetadataRetrievedUrl :: Maybe Text
urlMetadataRetrievedUrl = Maybe Text
forall a. Maybe a
Nothing
, urlMetadataUrlRetrievalStatus :: Maybe E'UrlRetrievalStatus
urlMetadataUrlRetrievalStatus = Maybe E'UrlRetrievalStatus
forall a. Maybe a
Nothing
}
data UsageMetadata = UsageMetadata
{ UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataCandidatesTokensDetails :: !(Maybe [ModalityTokenCount])
, UsageMetadata -> Maybe Int
usageMetadataThoughtsTokenCount :: !(Maybe Int)
, UsageMetadata -> Maybe Int
usageMetadataToolUsePromptTokenCount :: !(Maybe Int)
, UsageMetadata -> Maybe Int
usageMetadataCachedContentTokenCount :: !(Maybe Int)
, UsageMetadata -> Maybe Int
usageMetadataPromptTokenCount :: !(Maybe Int)
, UsageMetadata -> Maybe Int
usageMetadataCandidatesTokenCount :: !(Maybe Int)
, UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataPromptTokensDetails :: !(Maybe [ModalityTokenCount])
, UsageMetadata -> Maybe Int
usageMetadataTotalTokenCount :: !(Maybe Int)
, UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataCacheTokensDetails :: !(Maybe [ModalityTokenCount])
, UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataToolUsePromptTokensDetails :: !(Maybe [ModalityTokenCount])
}
deriving (Int -> UsageMetadata -> ShowS
[UsageMetadata] -> ShowS
UsageMetadata -> [Char]
(Int -> UsageMetadata -> ShowS)
-> (UsageMetadata -> [Char])
-> ([UsageMetadata] -> ShowS)
-> Show UsageMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UsageMetadata -> ShowS
showsPrec :: Int -> UsageMetadata -> ShowS
$cshow :: UsageMetadata -> [Char]
show :: UsageMetadata -> [Char]
$cshowList :: [UsageMetadata] -> ShowS
showList :: [UsageMetadata] -> ShowS
P.Show, UsageMetadata -> UsageMetadata -> Bool
(UsageMetadata -> UsageMetadata -> Bool)
-> (UsageMetadata -> UsageMetadata -> Bool) -> Eq UsageMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UsageMetadata -> UsageMetadata -> Bool
== :: UsageMetadata -> UsageMetadata -> Bool
$c/= :: UsageMetadata -> UsageMetadata -> Bool
/= :: UsageMetadata -> UsageMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON UsageMetadata where
parseJSON :: Value -> Parser UsageMetadata
parseJSON = [Char]
-> (Object -> Parser UsageMetadata)
-> Value
-> Parser UsageMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"UsageMetadata" ((Object -> Parser UsageMetadata) -> Value -> Parser UsageMetadata)
-> (Object -> Parser UsageMetadata)
-> Value
-> Parser UsageMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata
UsageMetadata
(Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe [ModalityTokenCount])
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe [ModalityTokenCount])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidatesTokensDetails")
Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"thoughtsTokenCount")
Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"toolUsePromptTokenCount")
Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"cachedContentTokenCount")
Parser
(Maybe Int
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"promptTokenCount")
Parser
(Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"candidatesTokenCount")
Parser
(Maybe [ModalityTokenCount]
-> Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe [ModalityTokenCount])
-> Parser
(Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [ModalityTokenCount])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"promptTokensDetails")
Parser
(Maybe Int
-> Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount]
-> UsageMetadata)
-> Parser (Maybe Int)
-> Parser
(Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount] -> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"totalTokenCount")
Parser
(Maybe [ModalityTokenCount]
-> Maybe [ModalityTokenCount] -> UsageMetadata)
-> Parser (Maybe [ModalityTokenCount])
-> Parser (Maybe [ModalityTokenCount] -> UsageMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [ModalityTokenCount])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"cacheTokensDetails")
Parser (Maybe [ModalityTokenCount] -> UsageMetadata)
-> Parser (Maybe [ModalityTokenCount]) -> Parser UsageMetadata
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe [ModalityTokenCount])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"toolUsePromptTokensDetails")
instance A.ToJSON UsageMetadata where
toJSON :: UsageMetadata -> Value
toJSON UsageMetadata {Maybe Int
Maybe [ModalityTokenCount]
usageMetadataCandidatesTokensDetails :: UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataThoughtsTokenCount :: UsageMetadata -> Maybe Int
usageMetadataToolUsePromptTokenCount :: UsageMetadata -> Maybe Int
usageMetadataCachedContentTokenCount :: UsageMetadata -> Maybe Int
usageMetadataPromptTokenCount :: UsageMetadata -> Maybe Int
usageMetadataCandidatesTokenCount :: UsageMetadata -> Maybe Int
usageMetadataPromptTokensDetails :: UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataTotalTokenCount :: UsageMetadata -> Maybe Int
usageMetadataCacheTokensDetails :: UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataToolUsePromptTokensDetails :: UsageMetadata -> Maybe [ModalityTokenCount]
usageMetadataCandidatesTokensDetails :: Maybe [ModalityTokenCount]
usageMetadataThoughtsTokenCount :: Maybe Int
usageMetadataToolUsePromptTokenCount :: Maybe Int
usageMetadataCachedContentTokenCount :: Maybe Int
usageMetadataPromptTokenCount :: Maybe Int
usageMetadataCandidatesTokenCount :: Maybe Int
usageMetadataPromptTokensDetails :: Maybe [ModalityTokenCount]
usageMetadataTotalTokenCount :: Maybe Int
usageMetadataCacheTokensDetails :: Maybe [ModalityTokenCount]
usageMetadataToolUsePromptTokensDetails :: Maybe [ModalityTokenCount]
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"candidatesTokensDetails" Key -> Maybe [ModalityTokenCount] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ModalityTokenCount]
usageMetadataCandidatesTokensDetails
, Key
"thoughtsTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
usageMetadataThoughtsTokenCount
, Key
"toolUsePromptTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
usageMetadataToolUsePromptTokenCount
, Key
"cachedContentTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
usageMetadataCachedContentTokenCount
, Key
"promptTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
usageMetadataPromptTokenCount
, Key
"candidatesTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
usageMetadataCandidatesTokenCount
, Key
"promptTokensDetails" Key -> Maybe [ModalityTokenCount] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ModalityTokenCount]
usageMetadataPromptTokensDetails
, Key
"totalTokenCount" Key -> Maybe Int -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Int
usageMetadataTotalTokenCount
, Key
"cacheTokensDetails" Key -> Maybe [ModalityTokenCount] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ModalityTokenCount]
usageMetadataCacheTokensDetails
, Key
"toolUsePromptTokensDetails" Key -> Maybe [ModalityTokenCount] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe [ModalityTokenCount]
usageMetadataToolUsePromptTokensDetails
]
mkUsageMetadata ::
UsageMetadata
mkUsageMetadata :: UsageMetadata
mkUsageMetadata =
UsageMetadata
{ usageMetadataCandidatesTokensDetails :: Maybe [ModalityTokenCount]
usageMetadataCandidatesTokensDetails = Maybe [ModalityTokenCount]
forall a. Maybe a
Nothing
, usageMetadataThoughtsTokenCount :: Maybe Int
usageMetadataThoughtsTokenCount = Maybe Int
forall a. Maybe a
Nothing
, usageMetadataToolUsePromptTokenCount :: Maybe Int
usageMetadataToolUsePromptTokenCount = Maybe Int
forall a. Maybe a
Nothing
, usageMetadataCachedContentTokenCount :: Maybe Int
usageMetadataCachedContentTokenCount = Maybe Int
forall a. Maybe a
Nothing
, usageMetadataPromptTokenCount :: Maybe Int
usageMetadataPromptTokenCount = Maybe Int
forall a. Maybe a
Nothing
, usageMetadataCandidatesTokenCount :: Maybe Int
usageMetadataCandidatesTokenCount = Maybe Int
forall a. Maybe a
Nothing
, usageMetadataPromptTokensDetails :: Maybe [ModalityTokenCount]
usageMetadataPromptTokensDetails = Maybe [ModalityTokenCount]
forall a. Maybe a
Nothing
, usageMetadataTotalTokenCount :: Maybe Int
usageMetadataTotalTokenCount = Maybe Int
forall a. Maybe a
Nothing
, usageMetadataCacheTokensDetails :: Maybe [ModalityTokenCount]
usageMetadataCacheTokensDetails = Maybe [ModalityTokenCount]
forall a. Maybe a
Nothing
, usageMetadataToolUsePromptTokensDetails :: Maybe [ModalityTokenCount]
usageMetadataToolUsePromptTokensDetails = Maybe [ModalityTokenCount]
forall a. Maybe a
Nothing
}
data Video = Video
{ Video -> Maybe ByteArray
videoVideo :: !(Maybe ByteArray)
, Video -> Maybe Text
videoUri :: !(Maybe Text)
}
deriving (Int -> Video -> ShowS
[Video] -> ShowS
Video -> [Char]
(Int -> Video -> ShowS)
-> (Video -> [Char]) -> ([Video] -> ShowS) -> Show Video
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Video -> ShowS
showsPrec :: Int -> Video -> ShowS
$cshow :: Video -> [Char]
show :: Video -> [Char]
$cshowList :: [Video] -> ShowS
showList :: [Video] -> ShowS
P.Show, Video -> Video -> Bool
(Video -> Video -> Bool) -> (Video -> Video -> Bool) -> Eq Video
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Video -> Video -> Bool
== :: Video -> Video -> Bool
$c/= :: Video -> Video -> Bool
/= :: Video -> Video -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Video where
parseJSON :: Value -> Parser Video
parseJSON = [Char] -> (Object -> Parser Video) -> Value -> Parser Video
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Video" ((Object -> Parser Video) -> Value -> Parser Video)
-> (Object -> Parser Video) -> Value -> Parser Video
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe ByteArray -> Maybe Text -> Video
Video
(Maybe ByteArray -> Maybe Text -> Video)
-> Parser (Maybe ByteArray) -> Parser (Maybe Text -> Video)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe ByteArray)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"video")
Parser (Maybe Text -> Video) -> Parser (Maybe Text) -> Parser Video
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"uri")
instance A.ToJSON Video where
toJSON :: Video -> Value
toJSON Video {Maybe Text
Maybe ByteArray
videoVideo :: Video -> Maybe ByteArray
videoUri :: Video -> Maybe Text
videoVideo :: Maybe ByteArray
videoUri :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"video" Key -> Maybe ByteArray -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe ByteArray
videoVideo
, Key
"uri" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
videoUri
]
mkVideo ::
Video
mkVideo :: Video
mkVideo =
Video
{ videoVideo :: Maybe ByteArray
videoVideo = Maybe ByteArray
forall a. Maybe a
Nothing
, videoUri :: Maybe Text
videoUri = Maybe Text
forall a. Maybe a
Nothing
}
data VideoFileMetadata = VideoFileMetadata
{ VideoFileMetadata -> Maybe Text
videoFileMetadataVideoDuration :: !(Maybe Text)
}
deriving (Int -> VideoFileMetadata -> ShowS
[VideoFileMetadata] -> ShowS
VideoFileMetadata -> [Char]
(Int -> VideoFileMetadata -> ShowS)
-> (VideoFileMetadata -> [Char])
-> ([VideoFileMetadata] -> ShowS)
-> Show VideoFileMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VideoFileMetadata -> ShowS
showsPrec :: Int -> VideoFileMetadata -> ShowS
$cshow :: VideoFileMetadata -> [Char]
show :: VideoFileMetadata -> [Char]
$cshowList :: [VideoFileMetadata] -> ShowS
showList :: [VideoFileMetadata] -> ShowS
P.Show, VideoFileMetadata -> VideoFileMetadata -> Bool
(VideoFileMetadata -> VideoFileMetadata -> Bool)
-> (VideoFileMetadata -> VideoFileMetadata -> Bool)
-> Eq VideoFileMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VideoFileMetadata -> VideoFileMetadata -> Bool
== :: VideoFileMetadata -> VideoFileMetadata -> Bool
$c/= :: VideoFileMetadata -> VideoFileMetadata -> Bool
/= :: VideoFileMetadata -> VideoFileMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON VideoFileMetadata where
parseJSON :: Value -> Parser VideoFileMetadata
parseJSON = [Char]
-> (Object -> Parser VideoFileMetadata)
-> Value
-> Parser VideoFileMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"VideoFileMetadata" ((Object -> Parser VideoFileMetadata)
-> Value -> Parser VideoFileMetadata)
-> (Object -> Parser VideoFileMetadata)
-> Value
-> Parser VideoFileMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> VideoFileMetadata
VideoFileMetadata
(Maybe Text -> VideoFileMetadata)
-> Parser (Maybe Text) -> Parser VideoFileMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"videoDuration")
instance A.ToJSON VideoFileMetadata where
toJSON :: VideoFileMetadata -> Value
toJSON VideoFileMetadata {Maybe Text
videoFileMetadataVideoDuration :: VideoFileMetadata -> Maybe Text
videoFileMetadataVideoDuration :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"videoDuration" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
videoFileMetadataVideoDuration
]
mkVideoFileMetadata ::
VideoFileMetadata
mkVideoFileMetadata :: VideoFileMetadata
mkVideoFileMetadata =
VideoFileMetadata
{ videoFileMetadataVideoDuration :: Maybe Text
videoFileMetadataVideoDuration = Maybe Text
forall a. Maybe a
Nothing
}
data VideoMetadata = VideoMetadata
{ VideoMetadata -> Maybe Text
videoMetadataEndOffset :: !(Maybe Text)
, VideoMetadata -> Maybe Text
videoMetadataStartOffset :: !(Maybe Text)
, VideoMetadata -> Maybe Double
videoMetadataFps :: !(Maybe Double)
}
deriving (Int -> VideoMetadata -> ShowS
[VideoMetadata] -> ShowS
VideoMetadata -> [Char]
(Int -> VideoMetadata -> ShowS)
-> (VideoMetadata -> [Char])
-> ([VideoMetadata] -> ShowS)
-> Show VideoMetadata
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VideoMetadata -> ShowS
showsPrec :: Int -> VideoMetadata -> ShowS
$cshow :: VideoMetadata -> [Char]
show :: VideoMetadata -> [Char]
$cshowList :: [VideoMetadata] -> ShowS
showList :: [VideoMetadata] -> ShowS
P.Show, VideoMetadata -> VideoMetadata -> Bool
(VideoMetadata -> VideoMetadata -> Bool)
-> (VideoMetadata -> VideoMetadata -> Bool) -> Eq VideoMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VideoMetadata -> VideoMetadata -> Bool
== :: VideoMetadata -> VideoMetadata -> Bool
$c/= :: VideoMetadata -> VideoMetadata -> Bool
/= :: VideoMetadata -> VideoMetadata -> Bool
P.Eq, P.Typeable)
instance A.FromJSON VideoMetadata where
parseJSON :: Value -> Parser VideoMetadata
parseJSON = [Char]
-> (Object -> Parser VideoMetadata)
-> Value
-> Parser VideoMetadata
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"VideoMetadata" ((Object -> Parser VideoMetadata) -> Value -> Parser VideoMetadata)
-> (Object -> Parser VideoMetadata)
-> Value
-> Parser VideoMetadata
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe Text -> Maybe Double -> VideoMetadata
VideoMetadata
(Maybe Text -> Maybe Text -> Maybe Double -> VideoMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Double -> VideoMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"endOffset")
Parser (Maybe Text -> Maybe Double -> VideoMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Double -> VideoMetadata)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"startOffset")
Parser (Maybe Double -> VideoMetadata)
-> Parser (Maybe Double) -> Parser VideoMetadata
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"fps")
instance A.ToJSON VideoMetadata where
toJSON :: VideoMetadata -> Value
toJSON VideoMetadata {Maybe Double
Maybe Text
videoMetadataEndOffset :: VideoMetadata -> Maybe Text
videoMetadataStartOffset :: VideoMetadata -> Maybe Text
videoMetadataFps :: VideoMetadata -> Maybe Double
videoMetadataEndOffset :: Maybe Text
videoMetadataStartOffset :: Maybe Text
videoMetadataFps :: Maybe Double
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"endOffset" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
videoMetadataEndOffset
, Key
"startOffset" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
videoMetadataStartOffset
, Key
"fps" Key -> Maybe Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Double
videoMetadataFps
]
mkVideoMetadata ::
VideoMetadata
mkVideoMetadata :: VideoMetadata
mkVideoMetadata =
VideoMetadata
{ videoMetadataEndOffset :: Maybe Text
videoMetadataEndOffset = Maybe Text
forall a. Maybe a
Nothing
, videoMetadataStartOffset :: Maybe Text
videoMetadataStartOffset = Maybe Text
forall a. Maybe a
Nothing
, videoMetadataFps :: Maybe Double
videoMetadataFps = Maybe Double
forall a. Maybe a
Nothing
}
data VoiceConfig = VoiceConfig
{ VoiceConfig -> Maybe PrebuiltVoiceConfig
voiceConfigPrebuiltVoiceConfig :: !(Maybe PrebuiltVoiceConfig)
}
deriving (Int -> VoiceConfig -> ShowS
[VoiceConfig] -> ShowS
VoiceConfig -> [Char]
(Int -> VoiceConfig -> ShowS)
-> (VoiceConfig -> [Char])
-> ([VoiceConfig] -> ShowS)
-> Show VoiceConfig
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VoiceConfig -> ShowS
showsPrec :: Int -> VoiceConfig -> ShowS
$cshow :: VoiceConfig -> [Char]
show :: VoiceConfig -> [Char]
$cshowList :: [VoiceConfig] -> ShowS
showList :: [VoiceConfig] -> ShowS
P.Show, VoiceConfig -> VoiceConfig -> Bool
(VoiceConfig -> VoiceConfig -> Bool)
-> (VoiceConfig -> VoiceConfig -> Bool) -> Eq VoiceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VoiceConfig -> VoiceConfig -> Bool
== :: VoiceConfig -> VoiceConfig -> Bool
$c/= :: VoiceConfig -> VoiceConfig -> Bool
/= :: VoiceConfig -> VoiceConfig -> Bool
P.Eq, P.Typeable)
instance A.FromJSON VoiceConfig where
parseJSON :: Value -> Parser VoiceConfig
parseJSON = [Char]
-> (Object -> Parser VoiceConfig) -> Value -> Parser VoiceConfig
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"VoiceConfig" ((Object -> Parser VoiceConfig) -> Value -> Parser VoiceConfig)
-> (Object -> Parser VoiceConfig) -> Value -> Parser VoiceConfig
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe PrebuiltVoiceConfig -> VoiceConfig
VoiceConfig
(Maybe PrebuiltVoiceConfig -> VoiceConfig)
-> Parser (Maybe PrebuiltVoiceConfig) -> Parser VoiceConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe PrebuiltVoiceConfig)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"prebuiltVoiceConfig")
instance A.ToJSON VoiceConfig where
toJSON :: VoiceConfig -> Value
toJSON VoiceConfig {Maybe PrebuiltVoiceConfig
voiceConfigPrebuiltVoiceConfig :: VoiceConfig -> Maybe PrebuiltVoiceConfig
voiceConfigPrebuiltVoiceConfig :: Maybe PrebuiltVoiceConfig
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"prebuiltVoiceConfig" Key -> Maybe PrebuiltVoiceConfig -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe PrebuiltVoiceConfig
voiceConfigPrebuiltVoiceConfig
]
mkVoiceConfig ::
VoiceConfig
mkVoiceConfig :: VoiceConfig
mkVoiceConfig =
VoiceConfig
{ voiceConfigPrebuiltVoiceConfig :: Maybe PrebuiltVoiceConfig
voiceConfigPrebuiltVoiceConfig = Maybe PrebuiltVoiceConfig
forall a. Maybe a
Nothing
}
data Web = Web
{ Web -> Maybe Text
webTitle :: !(Maybe Text)
, Web -> Maybe Text
webUri :: !(Maybe Text)
}
deriving (Int -> Web -> ShowS
[Web] -> ShowS
Web -> [Char]
(Int -> Web -> ShowS)
-> (Web -> [Char]) -> ([Web] -> ShowS) -> Show Web
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Web -> ShowS
showsPrec :: Int -> Web -> ShowS
$cshow :: Web -> [Char]
show :: Web -> [Char]
$cshowList :: [Web] -> ShowS
showList :: [Web] -> ShowS
P.Show, Web -> Web -> Bool
(Web -> Web -> Bool) -> (Web -> Web -> Bool) -> Eq Web
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Web -> Web -> Bool
== :: Web -> Web -> Bool
$c/= :: Web -> Web -> Bool
/= :: Web -> Web -> Bool
P.Eq, P.Typeable)
instance A.FromJSON Web where
parseJSON :: Value -> Parser Web
parseJSON = [Char] -> (Object -> Parser Web) -> Value -> Parser Web
forall a. [Char] -> (Object -> Parser a) -> Value -> Parser a
A.withObject [Char]
"Web" ((Object -> Parser Web) -> Value -> Parser Web)
-> (Object -> Parser Web) -> Value -> Parser Web
forall a b. (a -> b) -> a -> b
$ \Object
o ->
Maybe Text -> Maybe Text -> Web
Web
(Maybe Text -> Maybe Text -> Web)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Web)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"title")
Parser (Maybe Text -> Web) -> Parser (Maybe Text) -> Parser Web
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"uri")
instance A.ToJSON Web where
toJSON :: Web -> Value
toJSON Web {Maybe Text
webTitle :: Web -> Maybe Text
webUri :: Web -> Maybe Text
webTitle :: Maybe Text
webUri :: Maybe Text
..} =
[(Key, Value)] -> Value
_omitNulls
[ Key
"title" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
webTitle
, Key
"uri" Key -> Maybe Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
webUri
]
mkWeb ::
Web
mkWeb :: Web
mkWeb =
Web
{ webTitle :: Maybe Text
webTitle = Maybe Text
forall a. Maybe a
Nothing
, webUri :: Maybe Text
webUri = Maybe Text
forall a. Maybe a
Nothing
}
data E'Alt
=
E'Alt'Json
|
E'Alt'Media
|
E'Alt'Proto
deriving (Int -> E'Alt -> ShowS
[E'Alt] -> ShowS
E'Alt -> [Char]
(Int -> E'Alt -> ShowS)
-> (E'Alt -> [Char]) -> ([E'Alt] -> ShowS) -> Show E'Alt
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Alt -> ShowS
showsPrec :: Int -> E'Alt -> ShowS
$cshow :: E'Alt -> [Char]
show :: E'Alt -> [Char]
$cshowList :: [E'Alt] -> ShowS
showList :: [E'Alt] -> ShowS
P.Show, E'Alt -> E'Alt -> Bool
(E'Alt -> E'Alt -> Bool) -> (E'Alt -> E'Alt -> Bool) -> Eq E'Alt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Alt -> E'Alt -> Bool
== :: E'Alt -> E'Alt -> Bool
$c/= :: E'Alt -> E'Alt -> Bool
/= :: E'Alt -> E'Alt -> Bool
P.Eq, P.Typeable, Eq E'Alt
Eq E'Alt =>
(E'Alt -> E'Alt -> Ordering)
-> (E'Alt -> E'Alt -> Bool)
-> (E'Alt -> E'Alt -> Bool)
-> (E'Alt -> E'Alt -> Bool)
-> (E'Alt -> E'Alt -> Bool)
-> (E'Alt -> E'Alt -> E'Alt)
-> (E'Alt -> E'Alt -> E'Alt)
-> Ord E'Alt
E'Alt -> E'Alt -> Bool
E'Alt -> E'Alt -> Ordering
E'Alt -> E'Alt -> E'Alt
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
$ccompare :: E'Alt -> E'Alt -> Ordering
compare :: E'Alt -> E'Alt -> Ordering
$c< :: E'Alt -> E'Alt -> Bool
< :: E'Alt -> E'Alt -> Bool
$c<= :: E'Alt -> E'Alt -> Bool
<= :: E'Alt -> E'Alt -> Bool
$c> :: E'Alt -> E'Alt -> Bool
> :: E'Alt -> E'Alt -> Bool
$c>= :: E'Alt -> E'Alt -> Bool
>= :: E'Alt -> E'Alt -> Bool
$cmax :: E'Alt -> E'Alt -> E'Alt
max :: E'Alt -> E'Alt -> E'Alt
$cmin :: E'Alt -> E'Alt -> E'Alt
min :: E'Alt -> E'Alt -> E'Alt
P.Ord, E'Alt
E'Alt -> E'Alt -> Bounded E'Alt
forall a. a -> a -> Bounded a
$cminBound :: E'Alt
minBound :: E'Alt
$cmaxBound :: E'Alt
maxBound :: E'Alt
P.Bounded, Int -> E'Alt
E'Alt -> Int
E'Alt -> [E'Alt]
E'Alt -> E'Alt
E'Alt -> E'Alt -> [E'Alt]
E'Alt -> E'Alt -> E'Alt -> [E'Alt]
(E'Alt -> E'Alt)
-> (E'Alt -> E'Alt)
-> (Int -> E'Alt)
-> (E'Alt -> Int)
-> (E'Alt -> [E'Alt])
-> (E'Alt -> E'Alt -> [E'Alt])
-> (E'Alt -> E'Alt -> [E'Alt])
-> (E'Alt -> E'Alt -> E'Alt -> [E'Alt])
-> Enum E'Alt
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Alt -> E'Alt
succ :: E'Alt -> E'Alt
$cpred :: E'Alt -> E'Alt
pred :: E'Alt -> E'Alt
$ctoEnum :: Int -> E'Alt
toEnum :: Int -> E'Alt
$cfromEnum :: E'Alt -> Int
fromEnum :: E'Alt -> Int
$cenumFrom :: E'Alt -> [E'Alt]
enumFrom :: E'Alt -> [E'Alt]
$cenumFromThen :: E'Alt -> E'Alt -> [E'Alt]
enumFromThen :: E'Alt -> E'Alt -> [E'Alt]
$cenumFromTo :: E'Alt -> E'Alt -> [E'Alt]
enumFromTo :: E'Alt -> E'Alt -> [E'Alt]
$cenumFromThenTo :: E'Alt -> E'Alt -> E'Alt -> [E'Alt]
enumFromThenTo :: E'Alt -> E'Alt -> E'Alt -> [E'Alt]
P.Enum)
instance A.ToJSON E'Alt where toJSON :: E'Alt -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Alt -> Text) -> E'Alt -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Alt -> Text
fromE'Alt
instance A.FromJSON E'Alt where parseJSON :: Value -> Parser E'Alt
parseJSON Value
o = ([Char] -> Parser E'Alt)
-> (E'Alt -> Parser E'Alt) -> Either [Char] E'Alt -> Parser E'Alt
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Alt
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Alt -> Parser E'Alt
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Alt -> Parser E'Alt)
-> (E'Alt -> E'Alt) -> E'Alt -> Parser E'Alt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Alt -> E'Alt
forall a. a -> a
P.id) (Either [Char] E'Alt -> Parser E'Alt)
-> (Text -> Either [Char] E'Alt) -> Text -> Parser E'Alt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Alt
toE'Alt (Text -> Parser E'Alt) -> Parser Text -> Parser E'Alt
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Alt where toQueryParam :: E'Alt -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Alt -> Text) -> E'Alt -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Alt -> Text
fromE'Alt
instance WH.FromHttpApiData E'Alt where parseQueryParam :: Text -> Either Text E'Alt
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Alt) -> Either Text E'Alt
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'Alt -> Either Text E'Alt
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Alt -> Either Text E'Alt)
-> (Text -> Either [Char] E'Alt) -> Text -> Either Text E'Alt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Alt
toE'Alt
instance MimeRender MimeMultipartFormData E'Alt where mimeRender :: Proxy MimeMultipartFormData -> E'Alt -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Alt -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Alt :: E'Alt -> Text
fromE'Alt :: E'Alt -> Text
fromE'Alt = \case
E'Alt
E'Alt'Json -> Text
"json"
E'Alt
E'Alt'Media -> Text
"media"
E'Alt
E'Alt'Proto -> Text
"proto"
toE'Alt :: Text -> P.Either String E'Alt
toE'Alt :: Text -> Either [Char] E'Alt
toE'Alt = \case
Text
"json" -> E'Alt -> Either [Char] E'Alt
forall a b. b -> Either a b
P.Right E'Alt
E'Alt'Json
Text
"media" -> E'Alt -> Either [Char] E'Alt
forall a b. b -> Either a b
P.Right E'Alt
E'Alt'Media
Text
"proto" -> E'Alt -> Either [Char] E'Alt
forall a b. b -> Either a b
P.Right E'Alt
E'Alt'Proto
Text
s -> [Char] -> Either [Char] E'Alt
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Alt) -> [Char] -> Either [Char] E'Alt
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Alt: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'AnswerStyle
=
E'AnswerStyle'ANSWER_STYLE_UNSPECIFIED
|
E'AnswerStyle'ABSTRACTIVE
|
|
E'AnswerStyle'VERBOSE
deriving (Int -> E'AnswerStyle -> ShowS
[E'AnswerStyle] -> ShowS
E'AnswerStyle -> [Char]
(Int -> E'AnswerStyle -> ShowS)
-> (E'AnswerStyle -> [Char])
-> ([E'AnswerStyle] -> ShowS)
-> Show E'AnswerStyle
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'AnswerStyle -> ShowS
showsPrec :: Int -> E'AnswerStyle -> ShowS
$cshow :: E'AnswerStyle -> [Char]
show :: E'AnswerStyle -> [Char]
$cshowList :: [E'AnswerStyle] -> ShowS
showList :: [E'AnswerStyle] -> ShowS
P.Show, E'AnswerStyle -> E'AnswerStyle -> Bool
(E'AnswerStyle -> E'AnswerStyle -> Bool)
-> (E'AnswerStyle -> E'AnswerStyle -> Bool) -> Eq E'AnswerStyle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'AnswerStyle -> E'AnswerStyle -> Bool
== :: E'AnswerStyle -> E'AnswerStyle -> Bool
$c/= :: E'AnswerStyle -> E'AnswerStyle -> Bool
/= :: E'AnswerStyle -> E'AnswerStyle -> Bool
P.Eq, P.Typeable, Eq E'AnswerStyle
Eq E'AnswerStyle =>
(E'AnswerStyle -> E'AnswerStyle -> Ordering)
-> (E'AnswerStyle -> E'AnswerStyle -> Bool)
-> (E'AnswerStyle -> E'AnswerStyle -> Bool)
-> (E'AnswerStyle -> E'AnswerStyle -> Bool)
-> (E'AnswerStyle -> E'AnswerStyle -> Bool)
-> (E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle)
-> (E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle)
-> Ord E'AnswerStyle
E'AnswerStyle -> E'AnswerStyle -> Bool
E'AnswerStyle -> E'AnswerStyle -> Ordering
E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle
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
$ccompare :: E'AnswerStyle -> E'AnswerStyle -> Ordering
compare :: E'AnswerStyle -> E'AnswerStyle -> Ordering
$c< :: E'AnswerStyle -> E'AnswerStyle -> Bool
< :: E'AnswerStyle -> E'AnswerStyle -> Bool
$c<= :: E'AnswerStyle -> E'AnswerStyle -> Bool
<= :: E'AnswerStyle -> E'AnswerStyle -> Bool
$c> :: E'AnswerStyle -> E'AnswerStyle -> Bool
> :: E'AnswerStyle -> E'AnswerStyle -> Bool
$c>= :: E'AnswerStyle -> E'AnswerStyle -> Bool
>= :: E'AnswerStyle -> E'AnswerStyle -> Bool
$cmax :: E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle
max :: E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle
$cmin :: E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle
min :: E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle
P.Ord, E'AnswerStyle
E'AnswerStyle -> E'AnswerStyle -> Bounded E'AnswerStyle
forall a. a -> a -> Bounded a
$cminBound :: E'AnswerStyle
minBound :: E'AnswerStyle
$cmaxBound :: E'AnswerStyle
maxBound :: E'AnswerStyle
P.Bounded, Int -> E'AnswerStyle
E'AnswerStyle -> Int
E'AnswerStyle -> [E'AnswerStyle]
E'AnswerStyle -> E'AnswerStyle
E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
(E'AnswerStyle -> E'AnswerStyle)
-> (E'AnswerStyle -> E'AnswerStyle)
-> (Int -> E'AnswerStyle)
-> (E'AnswerStyle -> Int)
-> (E'AnswerStyle -> [E'AnswerStyle])
-> (E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle])
-> (E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle])
-> (E'AnswerStyle
-> E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle])
-> Enum E'AnswerStyle
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'AnswerStyle -> E'AnswerStyle
succ :: E'AnswerStyle -> E'AnswerStyle
$cpred :: E'AnswerStyle -> E'AnswerStyle
pred :: E'AnswerStyle -> E'AnswerStyle
$ctoEnum :: Int -> E'AnswerStyle
toEnum :: Int -> E'AnswerStyle
$cfromEnum :: E'AnswerStyle -> Int
fromEnum :: E'AnswerStyle -> Int
$cenumFrom :: E'AnswerStyle -> [E'AnswerStyle]
enumFrom :: E'AnswerStyle -> [E'AnswerStyle]
$cenumFromThen :: E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
enumFromThen :: E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
$cenumFromTo :: E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
enumFromTo :: E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
$cenumFromThenTo :: E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
enumFromThenTo :: E'AnswerStyle -> E'AnswerStyle -> E'AnswerStyle -> [E'AnswerStyle]
P.Enum)
instance A.ToJSON E'AnswerStyle where toJSON :: E'AnswerStyle -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'AnswerStyle -> Text) -> E'AnswerStyle -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'AnswerStyle -> Text
fromE'AnswerStyle
instance A.FromJSON E'AnswerStyle where parseJSON :: Value -> Parser E'AnswerStyle
parseJSON Value
o = ([Char] -> Parser E'AnswerStyle)
-> (E'AnswerStyle -> Parser E'AnswerStyle)
-> Either [Char] E'AnswerStyle
-> Parser E'AnswerStyle
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'AnswerStyle
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'AnswerStyle -> Parser E'AnswerStyle
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'AnswerStyle -> Parser E'AnswerStyle)
-> (E'AnswerStyle -> E'AnswerStyle)
-> E'AnswerStyle
-> Parser E'AnswerStyle
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'AnswerStyle -> E'AnswerStyle
forall a. a -> a
P.id) (Either [Char] E'AnswerStyle -> Parser E'AnswerStyle)
-> (Text -> Either [Char] E'AnswerStyle)
-> Text
-> Parser E'AnswerStyle
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'AnswerStyle
toE'AnswerStyle (Text -> Parser E'AnswerStyle)
-> Parser Text -> Parser E'AnswerStyle
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'AnswerStyle where toQueryParam :: E'AnswerStyle -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'AnswerStyle -> Text) -> E'AnswerStyle -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'AnswerStyle -> Text
fromE'AnswerStyle
instance WH.FromHttpApiData E'AnswerStyle where parseQueryParam :: Text -> Either Text E'AnswerStyle
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'AnswerStyle) -> Either Text E'AnswerStyle
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'AnswerStyle -> Either Text E'AnswerStyle
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'AnswerStyle -> Either Text E'AnswerStyle)
-> (Text -> Either [Char] E'AnswerStyle)
-> Text
-> Either Text E'AnswerStyle
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'AnswerStyle
toE'AnswerStyle
instance MimeRender MimeMultipartFormData E'AnswerStyle where mimeRender :: Proxy MimeMultipartFormData -> E'AnswerStyle -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'AnswerStyle -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'AnswerStyle :: E'AnswerStyle -> Text
fromE'AnswerStyle :: E'AnswerStyle -> Text
fromE'AnswerStyle = \case
E'AnswerStyle
E'AnswerStyle'ANSWER_STYLE_UNSPECIFIED -> Text
"ANSWER_STYLE_UNSPECIFIED"
E'AnswerStyle
E'AnswerStyle'ABSTRACTIVE -> Text
"ABSTRACTIVE"
E'AnswerStyle
E'AnswerStyle'EXTRACTIVE -> Text
"EXTRACTIVE"
E'AnswerStyle
E'AnswerStyle'VERBOSE -> Text
"VERBOSE"
toE'AnswerStyle :: Text -> P.Either String E'AnswerStyle
toE'AnswerStyle :: Text -> Either [Char] E'AnswerStyle
toE'AnswerStyle = \case
Text
"ANSWER_STYLE_UNSPECIFIED" -> E'AnswerStyle -> Either [Char] E'AnswerStyle
forall a b. b -> Either a b
P.Right E'AnswerStyle
E'AnswerStyle'ANSWER_STYLE_UNSPECIFIED
Text
"ABSTRACTIVE" -> E'AnswerStyle -> Either [Char] E'AnswerStyle
forall a b. b -> Either a b
P.Right E'AnswerStyle
E'AnswerStyle'ABSTRACTIVE
Text
"EXTRACTIVE" -> E'AnswerStyle -> Either [Char] E'AnswerStyle
forall a b. b -> Either a b
P.Right E'AnswerStyle
E'AnswerStyle'EXTRACTIVE
Text
"VERBOSE" -> E'AnswerStyle -> Either [Char] E'AnswerStyle
forall a b. b -> Either a b
P.Right E'AnswerStyle
E'AnswerStyle'VERBOSE
Text
s -> [Char] -> Either [Char] E'AnswerStyle
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'AnswerStyle)
-> [Char] -> Either [Char] E'AnswerStyle
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'AnswerStyle: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Behavior
=
E'Behavior'UNSPECIFIED
|
E'Behavior'BLOCKING
|
E'Behavior'NON_BLOCKING
deriving (Int -> E'Behavior -> ShowS
[E'Behavior] -> ShowS
E'Behavior -> [Char]
(Int -> E'Behavior -> ShowS)
-> (E'Behavior -> [Char])
-> ([E'Behavior] -> ShowS)
-> Show E'Behavior
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Behavior -> ShowS
showsPrec :: Int -> E'Behavior -> ShowS
$cshow :: E'Behavior -> [Char]
show :: E'Behavior -> [Char]
$cshowList :: [E'Behavior] -> ShowS
showList :: [E'Behavior] -> ShowS
P.Show, E'Behavior -> E'Behavior -> Bool
(E'Behavior -> E'Behavior -> Bool)
-> (E'Behavior -> E'Behavior -> Bool) -> Eq E'Behavior
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Behavior -> E'Behavior -> Bool
== :: E'Behavior -> E'Behavior -> Bool
$c/= :: E'Behavior -> E'Behavior -> Bool
/= :: E'Behavior -> E'Behavior -> Bool
P.Eq, P.Typeable, Eq E'Behavior
Eq E'Behavior =>
(E'Behavior -> E'Behavior -> Ordering)
-> (E'Behavior -> E'Behavior -> Bool)
-> (E'Behavior -> E'Behavior -> Bool)
-> (E'Behavior -> E'Behavior -> Bool)
-> (E'Behavior -> E'Behavior -> Bool)
-> (E'Behavior -> E'Behavior -> E'Behavior)
-> (E'Behavior -> E'Behavior -> E'Behavior)
-> Ord E'Behavior
E'Behavior -> E'Behavior -> Bool
E'Behavior -> E'Behavior -> Ordering
E'Behavior -> E'Behavior -> E'Behavior
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
$ccompare :: E'Behavior -> E'Behavior -> Ordering
compare :: E'Behavior -> E'Behavior -> Ordering
$c< :: E'Behavior -> E'Behavior -> Bool
< :: E'Behavior -> E'Behavior -> Bool
$c<= :: E'Behavior -> E'Behavior -> Bool
<= :: E'Behavior -> E'Behavior -> Bool
$c> :: E'Behavior -> E'Behavior -> Bool
> :: E'Behavior -> E'Behavior -> Bool
$c>= :: E'Behavior -> E'Behavior -> Bool
>= :: E'Behavior -> E'Behavior -> Bool
$cmax :: E'Behavior -> E'Behavior -> E'Behavior
max :: E'Behavior -> E'Behavior -> E'Behavior
$cmin :: E'Behavior -> E'Behavior -> E'Behavior
min :: E'Behavior -> E'Behavior -> E'Behavior
P.Ord, E'Behavior
E'Behavior -> E'Behavior -> Bounded E'Behavior
forall a. a -> a -> Bounded a
$cminBound :: E'Behavior
minBound :: E'Behavior
$cmaxBound :: E'Behavior
maxBound :: E'Behavior
P.Bounded, Int -> E'Behavior
E'Behavior -> Int
E'Behavior -> [E'Behavior]
E'Behavior -> E'Behavior
E'Behavior -> E'Behavior -> [E'Behavior]
E'Behavior -> E'Behavior -> E'Behavior -> [E'Behavior]
(E'Behavior -> E'Behavior)
-> (E'Behavior -> E'Behavior)
-> (Int -> E'Behavior)
-> (E'Behavior -> Int)
-> (E'Behavior -> [E'Behavior])
-> (E'Behavior -> E'Behavior -> [E'Behavior])
-> (E'Behavior -> E'Behavior -> [E'Behavior])
-> (E'Behavior -> E'Behavior -> E'Behavior -> [E'Behavior])
-> Enum E'Behavior
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Behavior -> E'Behavior
succ :: E'Behavior -> E'Behavior
$cpred :: E'Behavior -> E'Behavior
pred :: E'Behavior -> E'Behavior
$ctoEnum :: Int -> E'Behavior
toEnum :: Int -> E'Behavior
$cfromEnum :: E'Behavior -> Int
fromEnum :: E'Behavior -> Int
$cenumFrom :: E'Behavior -> [E'Behavior]
enumFrom :: E'Behavior -> [E'Behavior]
$cenumFromThen :: E'Behavior -> E'Behavior -> [E'Behavior]
enumFromThen :: E'Behavior -> E'Behavior -> [E'Behavior]
$cenumFromTo :: E'Behavior -> E'Behavior -> [E'Behavior]
enumFromTo :: E'Behavior -> E'Behavior -> [E'Behavior]
$cenumFromThenTo :: E'Behavior -> E'Behavior -> E'Behavior -> [E'Behavior]
enumFromThenTo :: E'Behavior -> E'Behavior -> E'Behavior -> [E'Behavior]
P.Enum)
instance A.ToJSON E'Behavior where toJSON :: E'Behavior -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Behavior -> Text) -> E'Behavior -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Behavior -> Text
fromE'Behavior
instance A.FromJSON E'Behavior where parseJSON :: Value -> Parser E'Behavior
parseJSON Value
o = ([Char] -> Parser E'Behavior)
-> (E'Behavior -> Parser E'Behavior)
-> Either [Char] E'Behavior
-> Parser E'Behavior
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Behavior
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Behavior -> Parser E'Behavior
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Behavior -> Parser E'Behavior)
-> (E'Behavior -> E'Behavior) -> E'Behavior -> Parser E'Behavior
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Behavior -> E'Behavior
forall a. a -> a
P.id) (Either [Char] E'Behavior -> Parser E'Behavior)
-> (Text -> Either [Char] E'Behavior) -> Text -> Parser E'Behavior
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Behavior
toE'Behavior (Text -> Parser E'Behavior) -> Parser Text -> Parser E'Behavior
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Behavior where toQueryParam :: E'Behavior -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Behavior -> Text) -> E'Behavior -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Behavior -> Text
fromE'Behavior
instance WH.FromHttpApiData E'Behavior where parseQueryParam :: Text -> Either Text E'Behavior
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Behavior) -> Either Text E'Behavior
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'Behavior -> Either Text E'Behavior
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Behavior -> Either Text E'Behavior)
-> (Text -> Either [Char] E'Behavior)
-> Text
-> Either Text E'Behavior
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Behavior
toE'Behavior
instance MimeRender MimeMultipartFormData E'Behavior where mimeRender :: Proxy MimeMultipartFormData -> E'Behavior -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Behavior -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Behavior :: E'Behavior -> Text
fromE'Behavior :: E'Behavior -> Text
fromE'Behavior = \case
E'Behavior
E'Behavior'UNSPECIFIED -> Text
"UNSPECIFIED"
E'Behavior
E'Behavior'BLOCKING -> Text
"BLOCKING"
E'Behavior
E'Behavior'NON_BLOCKING -> Text
"NON_BLOCKING"
toE'Behavior :: Text -> P.Either String E'Behavior
toE'Behavior :: Text -> Either [Char] E'Behavior
toE'Behavior = \case
Text
"UNSPECIFIED" -> E'Behavior -> Either [Char] E'Behavior
forall a b. b -> Either a b
P.Right E'Behavior
E'Behavior'UNSPECIFIED
Text
"BLOCKING" -> E'Behavior -> Either [Char] E'Behavior
forall a b. b -> Either a b
P.Right E'Behavior
E'Behavior'BLOCKING
Text
"NON_BLOCKING" -> E'Behavior -> Either [Char] E'Behavior
forall a b. b -> Either a b
P.Right E'Behavior
E'Behavior'NON_BLOCKING
Text
s -> [Char] -> Either [Char] E'Behavior
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Behavior)
-> [Char] -> Either [Char] E'Behavior
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Behavior: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'BlockReason
=
E'BlockReason'BLOCK_REASON_UNSPECIFIED
|
E'BlockReason'SAFETY
|
E'BlockReason'OTHER
|
E'BlockReason'BLOCKLIST
|
E'BlockReason'PROHIBITED_CONTENT
|
E'BlockReason'IMAGE_SAFETY
deriving (Int -> E'BlockReason -> ShowS
[E'BlockReason] -> ShowS
E'BlockReason -> [Char]
(Int -> E'BlockReason -> ShowS)
-> (E'BlockReason -> [Char])
-> ([E'BlockReason] -> ShowS)
-> Show E'BlockReason
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'BlockReason -> ShowS
showsPrec :: Int -> E'BlockReason -> ShowS
$cshow :: E'BlockReason -> [Char]
show :: E'BlockReason -> [Char]
$cshowList :: [E'BlockReason] -> ShowS
showList :: [E'BlockReason] -> ShowS
P.Show, E'BlockReason -> E'BlockReason -> Bool
(E'BlockReason -> E'BlockReason -> Bool)
-> (E'BlockReason -> E'BlockReason -> Bool) -> Eq E'BlockReason
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'BlockReason -> E'BlockReason -> Bool
== :: E'BlockReason -> E'BlockReason -> Bool
$c/= :: E'BlockReason -> E'BlockReason -> Bool
/= :: E'BlockReason -> E'BlockReason -> Bool
P.Eq, P.Typeable, Eq E'BlockReason
Eq E'BlockReason =>
(E'BlockReason -> E'BlockReason -> Ordering)
-> (E'BlockReason -> E'BlockReason -> Bool)
-> (E'BlockReason -> E'BlockReason -> Bool)
-> (E'BlockReason -> E'BlockReason -> Bool)
-> (E'BlockReason -> E'BlockReason -> Bool)
-> (E'BlockReason -> E'BlockReason -> E'BlockReason)
-> (E'BlockReason -> E'BlockReason -> E'BlockReason)
-> Ord E'BlockReason
E'BlockReason -> E'BlockReason -> Bool
E'BlockReason -> E'BlockReason -> Ordering
E'BlockReason -> E'BlockReason -> E'BlockReason
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
$ccompare :: E'BlockReason -> E'BlockReason -> Ordering
compare :: E'BlockReason -> E'BlockReason -> Ordering
$c< :: E'BlockReason -> E'BlockReason -> Bool
< :: E'BlockReason -> E'BlockReason -> Bool
$c<= :: E'BlockReason -> E'BlockReason -> Bool
<= :: E'BlockReason -> E'BlockReason -> Bool
$c> :: E'BlockReason -> E'BlockReason -> Bool
> :: E'BlockReason -> E'BlockReason -> Bool
$c>= :: E'BlockReason -> E'BlockReason -> Bool
>= :: E'BlockReason -> E'BlockReason -> Bool
$cmax :: E'BlockReason -> E'BlockReason -> E'BlockReason
max :: E'BlockReason -> E'BlockReason -> E'BlockReason
$cmin :: E'BlockReason -> E'BlockReason -> E'BlockReason
min :: E'BlockReason -> E'BlockReason -> E'BlockReason
P.Ord, E'BlockReason
E'BlockReason -> E'BlockReason -> Bounded E'BlockReason
forall a. a -> a -> Bounded a
$cminBound :: E'BlockReason
minBound :: E'BlockReason
$cmaxBound :: E'BlockReason
maxBound :: E'BlockReason
P.Bounded, Int -> E'BlockReason
E'BlockReason -> Int
E'BlockReason -> [E'BlockReason]
E'BlockReason -> E'BlockReason
E'BlockReason -> E'BlockReason -> [E'BlockReason]
E'BlockReason -> E'BlockReason -> E'BlockReason -> [E'BlockReason]
(E'BlockReason -> E'BlockReason)
-> (E'BlockReason -> E'BlockReason)
-> (Int -> E'BlockReason)
-> (E'BlockReason -> Int)
-> (E'BlockReason -> [E'BlockReason])
-> (E'BlockReason -> E'BlockReason -> [E'BlockReason])
-> (E'BlockReason -> E'BlockReason -> [E'BlockReason])
-> (E'BlockReason
-> E'BlockReason -> E'BlockReason -> [E'BlockReason])
-> Enum E'BlockReason
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'BlockReason -> E'BlockReason
succ :: E'BlockReason -> E'BlockReason
$cpred :: E'BlockReason -> E'BlockReason
pred :: E'BlockReason -> E'BlockReason
$ctoEnum :: Int -> E'BlockReason
toEnum :: Int -> E'BlockReason
$cfromEnum :: E'BlockReason -> Int
fromEnum :: E'BlockReason -> Int
$cenumFrom :: E'BlockReason -> [E'BlockReason]
enumFrom :: E'BlockReason -> [E'BlockReason]
$cenumFromThen :: E'BlockReason -> E'BlockReason -> [E'BlockReason]
enumFromThen :: E'BlockReason -> E'BlockReason -> [E'BlockReason]
$cenumFromTo :: E'BlockReason -> E'BlockReason -> [E'BlockReason]
enumFromTo :: E'BlockReason -> E'BlockReason -> [E'BlockReason]
$cenumFromThenTo :: E'BlockReason -> E'BlockReason -> E'BlockReason -> [E'BlockReason]
enumFromThenTo :: E'BlockReason -> E'BlockReason -> E'BlockReason -> [E'BlockReason]
P.Enum)
instance A.ToJSON E'BlockReason where toJSON :: E'BlockReason -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'BlockReason -> Text) -> E'BlockReason -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'BlockReason -> Text
fromE'BlockReason
instance A.FromJSON E'BlockReason where parseJSON :: Value -> Parser E'BlockReason
parseJSON Value
o = ([Char] -> Parser E'BlockReason)
-> (E'BlockReason -> Parser E'BlockReason)
-> Either [Char] E'BlockReason
-> Parser E'BlockReason
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'BlockReason
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'BlockReason -> Parser E'BlockReason
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'BlockReason -> Parser E'BlockReason)
-> (E'BlockReason -> E'BlockReason)
-> E'BlockReason
-> Parser E'BlockReason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'BlockReason -> E'BlockReason
forall a. a -> a
P.id) (Either [Char] E'BlockReason -> Parser E'BlockReason)
-> (Text -> Either [Char] E'BlockReason)
-> Text
-> Parser E'BlockReason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'BlockReason
toE'BlockReason (Text -> Parser E'BlockReason)
-> Parser Text -> Parser E'BlockReason
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'BlockReason where toQueryParam :: E'BlockReason -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'BlockReason -> Text) -> E'BlockReason -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'BlockReason -> Text
fromE'BlockReason
instance WH.FromHttpApiData E'BlockReason where parseQueryParam :: Text -> Either Text E'BlockReason
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'BlockReason) -> Either Text E'BlockReason
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'BlockReason -> Either Text E'BlockReason
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'BlockReason -> Either Text E'BlockReason)
-> (Text -> Either [Char] E'BlockReason)
-> Text
-> Either Text E'BlockReason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'BlockReason
toE'BlockReason
instance MimeRender MimeMultipartFormData E'BlockReason where mimeRender :: Proxy MimeMultipartFormData -> E'BlockReason -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'BlockReason -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'BlockReason :: E'BlockReason -> Text
fromE'BlockReason :: E'BlockReason -> Text
fromE'BlockReason = \case
E'BlockReason
E'BlockReason'BLOCK_REASON_UNSPECIFIED -> Text
"BLOCK_REASON_UNSPECIFIED"
E'BlockReason
E'BlockReason'SAFETY -> Text
"SAFETY"
E'BlockReason
E'BlockReason'OTHER -> Text
"OTHER"
E'BlockReason
E'BlockReason'BLOCKLIST -> Text
"BLOCKLIST"
E'BlockReason
E'BlockReason'PROHIBITED_CONTENT -> Text
"PROHIBITED_CONTENT"
E'BlockReason
E'BlockReason'IMAGE_SAFETY -> Text
"IMAGE_SAFETY"
toE'BlockReason :: Text -> P.Either String E'BlockReason
toE'BlockReason :: Text -> Either [Char] E'BlockReason
toE'BlockReason = \case
Text
"BLOCK_REASON_UNSPECIFIED" -> E'BlockReason -> Either [Char] E'BlockReason
forall a b. b -> Either a b
P.Right E'BlockReason
E'BlockReason'BLOCK_REASON_UNSPECIFIED
Text
"SAFETY" -> E'BlockReason -> Either [Char] E'BlockReason
forall a b. b -> Either a b
P.Right E'BlockReason
E'BlockReason'SAFETY
Text
"OTHER" -> E'BlockReason -> Either [Char] E'BlockReason
forall a b. b -> Either a b
P.Right E'BlockReason
E'BlockReason'OTHER
Text
"BLOCKLIST" -> E'BlockReason -> Either [Char] E'BlockReason
forall a b. b -> Either a b
P.Right E'BlockReason
E'BlockReason'BLOCKLIST
Text
"PROHIBITED_CONTENT" -> E'BlockReason -> Either [Char] E'BlockReason
forall a b. b -> Either a b
P.Right E'BlockReason
E'BlockReason'PROHIBITED_CONTENT
Text
"IMAGE_SAFETY" -> E'BlockReason -> Either [Char] E'BlockReason
forall a b. b -> Either a b
P.Right E'BlockReason
E'BlockReason'IMAGE_SAFETY
Text
s -> [Char] -> Either [Char] E'BlockReason
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'BlockReason)
-> [Char] -> Either [Char] E'BlockReason
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'BlockReason: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'BlockReason2
=
E'BlockReason2'BLOCK_REASON_UNSPECIFIED
|
E'BlockReason2'SAFETY
|
E'BlockReason2'OTHER
deriving (Int -> E'BlockReason2 -> ShowS
[E'BlockReason2] -> ShowS
E'BlockReason2 -> [Char]
(Int -> E'BlockReason2 -> ShowS)
-> (E'BlockReason2 -> [Char])
-> ([E'BlockReason2] -> ShowS)
-> Show E'BlockReason2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'BlockReason2 -> ShowS
showsPrec :: Int -> E'BlockReason2 -> ShowS
$cshow :: E'BlockReason2 -> [Char]
show :: E'BlockReason2 -> [Char]
$cshowList :: [E'BlockReason2] -> ShowS
showList :: [E'BlockReason2] -> ShowS
P.Show, E'BlockReason2 -> E'BlockReason2 -> Bool
(E'BlockReason2 -> E'BlockReason2 -> Bool)
-> (E'BlockReason2 -> E'BlockReason2 -> Bool) -> Eq E'BlockReason2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'BlockReason2 -> E'BlockReason2 -> Bool
== :: E'BlockReason2 -> E'BlockReason2 -> Bool
$c/= :: E'BlockReason2 -> E'BlockReason2 -> Bool
/= :: E'BlockReason2 -> E'BlockReason2 -> Bool
P.Eq, P.Typeable, Eq E'BlockReason2
Eq E'BlockReason2 =>
(E'BlockReason2 -> E'BlockReason2 -> Ordering)
-> (E'BlockReason2 -> E'BlockReason2 -> Bool)
-> (E'BlockReason2 -> E'BlockReason2 -> Bool)
-> (E'BlockReason2 -> E'BlockReason2 -> Bool)
-> (E'BlockReason2 -> E'BlockReason2 -> Bool)
-> (E'BlockReason2 -> E'BlockReason2 -> E'BlockReason2)
-> (E'BlockReason2 -> E'BlockReason2 -> E'BlockReason2)
-> Ord E'BlockReason2
E'BlockReason2 -> E'BlockReason2 -> Bool
E'BlockReason2 -> E'BlockReason2 -> Ordering
E'BlockReason2 -> E'BlockReason2 -> E'BlockReason2
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
$ccompare :: E'BlockReason2 -> E'BlockReason2 -> Ordering
compare :: E'BlockReason2 -> E'BlockReason2 -> Ordering
$c< :: E'BlockReason2 -> E'BlockReason2 -> Bool
< :: E'BlockReason2 -> E'BlockReason2 -> Bool
$c<= :: E'BlockReason2 -> E'BlockReason2 -> Bool
<= :: E'BlockReason2 -> E'BlockReason2 -> Bool
$c> :: E'BlockReason2 -> E'BlockReason2 -> Bool
> :: E'BlockReason2 -> E'BlockReason2 -> Bool
$c>= :: E'BlockReason2 -> E'BlockReason2 -> Bool
>= :: E'BlockReason2 -> E'BlockReason2 -> Bool
$cmax :: E'BlockReason2 -> E'BlockReason2 -> E'BlockReason2
max :: E'BlockReason2 -> E'BlockReason2 -> E'BlockReason2
$cmin :: E'BlockReason2 -> E'BlockReason2 -> E'BlockReason2
min :: E'BlockReason2 -> E'BlockReason2 -> E'BlockReason2
P.Ord, E'BlockReason2
E'BlockReason2 -> E'BlockReason2 -> Bounded E'BlockReason2
forall a. a -> a -> Bounded a
$cminBound :: E'BlockReason2
minBound :: E'BlockReason2
$cmaxBound :: E'BlockReason2
maxBound :: E'BlockReason2
P.Bounded, Int -> E'BlockReason2
E'BlockReason2 -> Int
E'BlockReason2 -> [E'BlockReason2]
E'BlockReason2 -> E'BlockReason2
E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
E'BlockReason2
-> E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
(E'BlockReason2 -> E'BlockReason2)
-> (E'BlockReason2 -> E'BlockReason2)
-> (Int -> E'BlockReason2)
-> (E'BlockReason2 -> Int)
-> (E'BlockReason2 -> [E'BlockReason2])
-> (E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2])
-> (E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2])
-> (E'BlockReason2
-> E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2])
-> Enum E'BlockReason2
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'BlockReason2 -> E'BlockReason2
succ :: E'BlockReason2 -> E'BlockReason2
$cpred :: E'BlockReason2 -> E'BlockReason2
pred :: E'BlockReason2 -> E'BlockReason2
$ctoEnum :: Int -> E'BlockReason2
toEnum :: Int -> E'BlockReason2
$cfromEnum :: E'BlockReason2 -> Int
fromEnum :: E'BlockReason2 -> Int
$cenumFrom :: E'BlockReason2 -> [E'BlockReason2]
enumFrom :: E'BlockReason2 -> [E'BlockReason2]
$cenumFromThen :: E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
enumFromThen :: E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
$cenumFromTo :: E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
enumFromTo :: E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
$cenumFromThenTo :: E'BlockReason2
-> E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
enumFromThenTo :: E'BlockReason2
-> E'BlockReason2 -> E'BlockReason2 -> [E'BlockReason2]
P.Enum)
instance A.ToJSON E'BlockReason2 where toJSON :: E'BlockReason2 -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'BlockReason2 -> Text) -> E'BlockReason2 -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'BlockReason2 -> Text
fromE'BlockReason2
instance A.FromJSON E'BlockReason2 where parseJSON :: Value -> Parser E'BlockReason2
parseJSON Value
o = ([Char] -> Parser E'BlockReason2)
-> (E'BlockReason2 -> Parser E'BlockReason2)
-> Either [Char] E'BlockReason2
-> Parser E'BlockReason2
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'BlockReason2
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'BlockReason2 -> Parser E'BlockReason2
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'BlockReason2 -> Parser E'BlockReason2)
-> (E'BlockReason2 -> E'BlockReason2)
-> E'BlockReason2
-> Parser E'BlockReason2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'BlockReason2 -> E'BlockReason2
forall a. a -> a
P.id) (Either [Char] E'BlockReason2 -> Parser E'BlockReason2)
-> (Text -> Either [Char] E'BlockReason2)
-> Text
-> Parser E'BlockReason2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'BlockReason2
toE'BlockReason2 (Text -> Parser E'BlockReason2)
-> Parser Text -> Parser E'BlockReason2
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'BlockReason2 where toQueryParam :: E'BlockReason2 -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text)
-> (E'BlockReason2 -> Text) -> E'BlockReason2 -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'BlockReason2 -> Text
fromE'BlockReason2
instance WH.FromHttpApiData E'BlockReason2 where parseQueryParam :: Text -> Either Text E'BlockReason2
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'BlockReason2)
-> Either Text E'BlockReason2
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'BlockReason2 -> Either Text E'BlockReason2
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'BlockReason2 -> Either Text E'BlockReason2)
-> (Text -> Either [Char] E'BlockReason2)
-> Text
-> Either Text E'BlockReason2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'BlockReason2
toE'BlockReason2
instance MimeRender MimeMultipartFormData E'BlockReason2 where mimeRender :: Proxy MimeMultipartFormData -> E'BlockReason2 -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'BlockReason2 -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'BlockReason2 :: E'BlockReason2 -> Text
fromE'BlockReason2 :: E'BlockReason2 -> Text
fromE'BlockReason2 = \case
E'BlockReason2
E'BlockReason2'BLOCK_REASON_UNSPECIFIED -> Text
"BLOCK_REASON_UNSPECIFIED"
E'BlockReason2
E'BlockReason2'SAFETY -> Text
"SAFETY"
E'BlockReason2
E'BlockReason2'OTHER -> Text
"OTHER"
toE'BlockReason2 :: Text -> P.Either String E'BlockReason2
toE'BlockReason2 :: Text -> Either [Char] E'BlockReason2
toE'BlockReason2 = \case
Text
"BLOCK_REASON_UNSPECIFIED" -> E'BlockReason2 -> Either [Char] E'BlockReason2
forall a b. b -> Either a b
P.Right E'BlockReason2
E'BlockReason2'BLOCK_REASON_UNSPECIFIED
Text
"SAFETY" -> E'BlockReason2 -> Either [Char] E'BlockReason2
forall a b. b -> Either a b
P.Right E'BlockReason2
E'BlockReason2'SAFETY
Text
"OTHER" -> E'BlockReason2 -> Either [Char] E'BlockReason2
forall a b. b -> Either a b
P.Right E'BlockReason2
E'BlockReason2'OTHER
Text
s -> [Char] -> Either [Char] E'BlockReason2
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'BlockReason2)
-> [Char] -> Either [Char] E'BlockReason2
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'BlockReason2: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'FinishReason
=
E'FinishReason'FINISH_REASON_UNSPECIFIED
|
E'FinishReason'STOP
|
E'FinishReason'MAX_TOKENS
|
E'FinishReason'SAFETY
|
E'FinishReason'RECITATION
|
E'FinishReason'LANGUAGE
|
E'FinishReason'OTHER
|
E'FinishReason'BLOCKLIST
|
E'FinishReason'PROHIBITED_CONTENT
|
E'FinishReason'SPII
|
E'FinishReason'MALFORMED_FUNCTION_CALL
|
E'FinishReason'IMAGE_SAFETY
deriving (Int -> E'FinishReason -> ShowS
[E'FinishReason] -> ShowS
E'FinishReason -> [Char]
(Int -> E'FinishReason -> ShowS)
-> (E'FinishReason -> [Char])
-> ([E'FinishReason] -> ShowS)
-> Show E'FinishReason
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'FinishReason -> ShowS
showsPrec :: Int -> E'FinishReason -> ShowS
$cshow :: E'FinishReason -> [Char]
show :: E'FinishReason -> [Char]
$cshowList :: [E'FinishReason] -> ShowS
showList :: [E'FinishReason] -> ShowS
P.Show, E'FinishReason -> E'FinishReason -> Bool
(E'FinishReason -> E'FinishReason -> Bool)
-> (E'FinishReason -> E'FinishReason -> Bool) -> Eq E'FinishReason
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'FinishReason -> E'FinishReason -> Bool
== :: E'FinishReason -> E'FinishReason -> Bool
$c/= :: E'FinishReason -> E'FinishReason -> Bool
/= :: E'FinishReason -> E'FinishReason -> Bool
P.Eq, P.Typeable, Eq E'FinishReason
Eq E'FinishReason =>
(E'FinishReason -> E'FinishReason -> Ordering)
-> (E'FinishReason -> E'FinishReason -> Bool)
-> (E'FinishReason -> E'FinishReason -> Bool)
-> (E'FinishReason -> E'FinishReason -> Bool)
-> (E'FinishReason -> E'FinishReason -> Bool)
-> (E'FinishReason -> E'FinishReason -> E'FinishReason)
-> (E'FinishReason -> E'FinishReason -> E'FinishReason)
-> Ord E'FinishReason
E'FinishReason -> E'FinishReason -> Bool
E'FinishReason -> E'FinishReason -> Ordering
E'FinishReason -> E'FinishReason -> E'FinishReason
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
$ccompare :: E'FinishReason -> E'FinishReason -> Ordering
compare :: E'FinishReason -> E'FinishReason -> Ordering
$c< :: E'FinishReason -> E'FinishReason -> Bool
< :: E'FinishReason -> E'FinishReason -> Bool
$c<= :: E'FinishReason -> E'FinishReason -> Bool
<= :: E'FinishReason -> E'FinishReason -> Bool
$c> :: E'FinishReason -> E'FinishReason -> Bool
> :: E'FinishReason -> E'FinishReason -> Bool
$c>= :: E'FinishReason -> E'FinishReason -> Bool
>= :: E'FinishReason -> E'FinishReason -> Bool
$cmax :: E'FinishReason -> E'FinishReason -> E'FinishReason
max :: E'FinishReason -> E'FinishReason -> E'FinishReason
$cmin :: E'FinishReason -> E'FinishReason -> E'FinishReason
min :: E'FinishReason -> E'FinishReason -> E'FinishReason
P.Ord, E'FinishReason
E'FinishReason -> E'FinishReason -> Bounded E'FinishReason
forall a. a -> a -> Bounded a
$cminBound :: E'FinishReason
minBound :: E'FinishReason
$cmaxBound :: E'FinishReason
maxBound :: E'FinishReason
P.Bounded, Int -> E'FinishReason
E'FinishReason -> Int
E'FinishReason -> [E'FinishReason]
E'FinishReason -> E'FinishReason
E'FinishReason -> E'FinishReason -> [E'FinishReason]
E'FinishReason
-> E'FinishReason -> E'FinishReason -> [E'FinishReason]
(E'FinishReason -> E'FinishReason)
-> (E'FinishReason -> E'FinishReason)
-> (Int -> E'FinishReason)
-> (E'FinishReason -> Int)
-> (E'FinishReason -> [E'FinishReason])
-> (E'FinishReason -> E'FinishReason -> [E'FinishReason])
-> (E'FinishReason -> E'FinishReason -> [E'FinishReason])
-> (E'FinishReason
-> E'FinishReason -> E'FinishReason -> [E'FinishReason])
-> Enum E'FinishReason
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'FinishReason -> E'FinishReason
succ :: E'FinishReason -> E'FinishReason
$cpred :: E'FinishReason -> E'FinishReason
pred :: E'FinishReason -> E'FinishReason
$ctoEnum :: Int -> E'FinishReason
toEnum :: Int -> E'FinishReason
$cfromEnum :: E'FinishReason -> Int
fromEnum :: E'FinishReason -> Int
$cenumFrom :: E'FinishReason -> [E'FinishReason]
enumFrom :: E'FinishReason -> [E'FinishReason]
$cenumFromThen :: E'FinishReason -> E'FinishReason -> [E'FinishReason]
enumFromThen :: E'FinishReason -> E'FinishReason -> [E'FinishReason]
$cenumFromTo :: E'FinishReason -> E'FinishReason -> [E'FinishReason]
enumFromTo :: E'FinishReason -> E'FinishReason -> [E'FinishReason]
$cenumFromThenTo :: E'FinishReason
-> E'FinishReason -> E'FinishReason -> [E'FinishReason]
enumFromThenTo :: E'FinishReason
-> E'FinishReason -> E'FinishReason -> [E'FinishReason]
P.Enum)
instance A.ToJSON E'FinishReason where toJSON :: E'FinishReason -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'FinishReason -> Text) -> E'FinishReason -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'FinishReason -> Text
fromE'FinishReason
instance A.FromJSON E'FinishReason where parseJSON :: Value -> Parser E'FinishReason
parseJSON Value
o = ([Char] -> Parser E'FinishReason)
-> (E'FinishReason -> Parser E'FinishReason)
-> Either [Char] E'FinishReason
-> Parser E'FinishReason
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'FinishReason
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'FinishReason -> Parser E'FinishReason
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'FinishReason -> Parser E'FinishReason)
-> (E'FinishReason -> E'FinishReason)
-> E'FinishReason
-> Parser E'FinishReason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'FinishReason -> E'FinishReason
forall a. a -> a
P.id) (Either [Char] E'FinishReason -> Parser E'FinishReason)
-> (Text -> Either [Char] E'FinishReason)
-> Text
-> Parser E'FinishReason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'FinishReason
toE'FinishReason (Text -> Parser E'FinishReason)
-> Parser Text -> Parser E'FinishReason
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'FinishReason where toQueryParam :: E'FinishReason -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text)
-> (E'FinishReason -> Text) -> E'FinishReason -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'FinishReason -> Text
fromE'FinishReason
instance WH.FromHttpApiData E'FinishReason where parseQueryParam :: Text -> Either Text E'FinishReason
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'FinishReason)
-> Either Text E'FinishReason
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'FinishReason -> Either Text E'FinishReason
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'FinishReason -> Either Text E'FinishReason)
-> (Text -> Either [Char] E'FinishReason)
-> Text
-> Either Text E'FinishReason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'FinishReason
toE'FinishReason
instance MimeRender MimeMultipartFormData E'FinishReason where mimeRender :: Proxy MimeMultipartFormData -> E'FinishReason -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'FinishReason -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'FinishReason :: E'FinishReason -> Text
fromE'FinishReason :: E'FinishReason -> Text
fromE'FinishReason = \case
E'FinishReason
E'FinishReason'FINISH_REASON_UNSPECIFIED -> Text
"FINISH_REASON_UNSPECIFIED"
E'FinishReason
E'FinishReason'STOP -> Text
"STOP"
E'FinishReason
E'FinishReason'MAX_TOKENS -> Text
"MAX_TOKENS"
E'FinishReason
E'FinishReason'SAFETY -> Text
"SAFETY"
E'FinishReason
E'FinishReason'RECITATION -> Text
"RECITATION"
E'FinishReason
E'FinishReason'LANGUAGE -> Text
"LANGUAGE"
E'FinishReason
E'FinishReason'OTHER -> Text
"OTHER"
E'FinishReason
E'FinishReason'BLOCKLIST -> Text
"BLOCKLIST"
E'FinishReason
E'FinishReason'PROHIBITED_CONTENT -> Text
"PROHIBITED_CONTENT"
E'FinishReason
E'FinishReason'SPII -> Text
"SPII"
E'FinishReason
E'FinishReason'MALFORMED_FUNCTION_CALL -> Text
"MALFORMED_FUNCTION_CALL"
E'FinishReason
E'FinishReason'IMAGE_SAFETY -> Text
"IMAGE_SAFETY"
toE'FinishReason :: Text -> P.Either String E'FinishReason
toE'FinishReason :: Text -> Either [Char] E'FinishReason
toE'FinishReason = \case
Text
"FINISH_REASON_UNSPECIFIED" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'FINISH_REASON_UNSPECIFIED
Text
"STOP" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'STOP
Text
"MAX_TOKENS" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'MAX_TOKENS
Text
"SAFETY" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'SAFETY
Text
"RECITATION" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'RECITATION
Text
"LANGUAGE" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'LANGUAGE
Text
"OTHER" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'OTHER
Text
"BLOCKLIST" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'BLOCKLIST
Text
"PROHIBITED_CONTENT" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'PROHIBITED_CONTENT
Text
"SPII" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'SPII
Text
"MALFORMED_FUNCTION_CALL" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'MALFORMED_FUNCTION_CALL
Text
"IMAGE_SAFETY" -> E'FinishReason -> Either [Char] E'FinishReason
forall a b. b -> Either a b
P.Right E'FinishReason
E'FinishReason'IMAGE_SAFETY
Text
s -> [Char] -> Either [Char] E'FinishReason
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'FinishReason)
-> [Char] -> Either [Char] E'FinishReason
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'FinishReason: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'GranteeType
=
E'GranteeType'GRANTEE_TYPE_UNSPECIFIED
|
E'GranteeType'USER
|
E'GranteeType'GROUP
|
E'GranteeType'EVERYONE
deriving (Int -> E'GranteeType -> ShowS
[E'GranteeType] -> ShowS
E'GranteeType -> [Char]
(Int -> E'GranteeType -> ShowS)
-> (E'GranteeType -> [Char])
-> ([E'GranteeType] -> ShowS)
-> Show E'GranteeType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'GranteeType -> ShowS
showsPrec :: Int -> E'GranteeType -> ShowS
$cshow :: E'GranteeType -> [Char]
show :: E'GranteeType -> [Char]
$cshowList :: [E'GranteeType] -> ShowS
showList :: [E'GranteeType] -> ShowS
P.Show, E'GranteeType -> E'GranteeType -> Bool
(E'GranteeType -> E'GranteeType -> Bool)
-> (E'GranteeType -> E'GranteeType -> Bool) -> Eq E'GranteeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'GranteeType -> E'GranteeType -> Bool
== :: E'GranteeType -> E'GranteeType -> Bool
$c/= :: E'GranteeType -> E'GranteeType -> Bool
/= :: E'GranteeType -> E'GranteeType -> Bool
P.Eq, P.Typeable, Eq E'GranteeType
Eq E'GranteeType =>
(E'GranteeType -> E'GranteeType -> Ordering)
-> (E'GranteeType -> E'GranteeType -> Bool)
-> (E'GranteeType -> E'GranteeType -> Bool)
-> (E'GranteeType -> E'GranteeType -> Bool)
-> (E'GranteeType -> E'GranteeType -> Bool)
-> (E'GranteeType -> E'GranteeType -> E'GranteeType)
-> (E'GranteeType -> E'GranteeType -> E'GranteeType)
-> Ord E'GranteeType
E'GranteeType -> E'GranteeType -> Bool
E'GranteeType -> E'GranteeType -> Ordering
E'GranteeType -> E'GranteeType -> E'GranteeType
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
$ccompare :: E'GranteeType -> E'GranteeType -> Ordering
compare :: E'GranteeType -> E'GranteeType -> Ordering
$c< :: E'GranteeType -> E'GranteeType -> Bool
< :: E'GranteeType -> E'GranteeType -> Bool
$c<= :: E'GranteeType -> E'GranteeType -> Bool
<= :: E'GranteeType -> E'GranteeType -> Bool
$c> :: E'GranteeType -> E'GranteeType -> Bool
> :: E'GranteeType -> E'GranteeType -> Bool
$c>= :: E'GranteeType -> E'GranteeType -> Bool
>= :: E'GranteeType -> E'GranteeType -> Bool
$cmax :: E'GranteeType -> E'GranteeType -> E'GranteeType
max :: E'GranteeType -> E'GranteeType -> E'GranteeType
$cmin :: E'GranteeType -> E'GranteeType -> E'GranteeType
min :: E'GranteeType -> E'GranteeType -> E'GranteeType
P.Ord, E'GranteeType
E'GranteeType -> E'GranteeType -> Bounded E'GranteeType
forall a. a -> a -> Bounded a
$cminBound :: E'GranteeType
minBound :: E'GranteeType
$cmaxBound :: E'GranteeType
maxBound :: E'GranteeType
P.Bounded, Int -> E'GranteeType
E'GranteeType -> Int
E'GranteeType -> [E'GranteeType]
E'GranteeType -> E'GranteeType
E'GranteeType -> E'GranteeType -> [E'GranteeType]
E'GranteeType -> E'GranteeType -> E'GranteeType -> [E'GranteeType]
(E'GranteeType -> E'GranteeType)
-> (E'GranteeType -> E'GranteeType)
-> (Int -> E'GranteeType)
-> (E'GranteeType -> Int)
-> (E'GranteeType -> [E'GranteeType])
-> (E'GranteeType -> E'GranteeType -> [E'GranteeType])
-> (E'GranteeType -> E'GranteeType -> [E'GranteeType])
-> (E'GranteeType
-> E'GranteeType -> E'GranteeType -> [E'GranteeType])
-> Enum E'GranteeType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'GranteeType -> E'GranteeType
succ :: E'GranteeType -> E'GranteeType
$cpred :: E'GranteeType -> E'GranteeType
pred :: E'GranteeType -> E'GranteeType
$ctoEnum :: Int -> E'GranteeType
toEnum :: Int -> E'GranteeType
$cfromEnum :: E'GranteeType -> Int
fromEnum :: E'GranteeType -> Int
$cenumFrom :: E'GranteeType -> [E'GranteeType]
enumFrom :: E'GranteeType -> [E'GranteeType]
$cenumFromThen :: E'GranteeType -> E'GranteeType -> [E'GranteeType]
enumFromThen :: E'GranteeType -> E'GranteeType -> [E'GranteeType]
$cenumFromTo :: E'GranteeType -> E'GranteeType -> [E'GranteeType]
enumFromTo :: E'GranteeType -> E'GranteeType -> [E'GranteeType]
$cenumFromThenTo :: E'GranteeType -> E'GranteeType -> E'GranteeType -> [E'GranteeType]
enumFromThenTo :: E'GranteeType -> E'GranteeType -> E'GranteeType -> [E'GranteeType]
P.Enum)
instance A.ToJSON E'GranteeType where toJSON :: E'GranteeType -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'GranteeType -> Text) -> E'GranteeType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'GranteeType -> Text
fromE'GranteeType
instance A.FromJSON E'GranteeType where parseJSON :: Value -> Parser E'GranteeType
parseJSON Value
o = ([Char] -> Parser E'GranteeType)
-> (E'GranteeType -> Parser E'GranteeType)
-> Either [Char] E'GranteeType
-> Parser E'GranteeType
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'GranteeType
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'GranteeType -> Parser E'GranteeType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'GranteeType -> Parser E'GranteeType)
-> (E'GranteeType -> E'GranteeType)
-> E'GranteeType
-> Parser E'GranteeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'GranteeType -> E'GranteeType
forall a. a -> a
P.id) (Either [Char] E'GranteeType -> Parser E'GranteeType)
-> (Text -> Either [Char] E'GranteeType)
-> Text
-> Parser E'GranteeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'GranteeType
toE'GranteeType (Text -> Parser E'GranteeType)
-> Parser Text -> Parser E'GranteeType
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'GranteeType where toQueryParam :: E'GranteeType -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'GranteeType -> Text) -> E'GranteeType -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'GranteeType -> Text
fromE'GranteeType
instance WH.FromHttpApiData E'GranteeType where parseQueryParam :: Text -> Either Text E'GranteeType
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'GranteeType) -> Either Text E'GranteeType
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'GranteeType -> Either Text E'GranteeType
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'GranteeType -> Either Text E'GranteeType)
-> (Text -> Either [Char] E'GranteeType)
-> Text
-> Either Text E'GranteeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'GranteeType
toE'GranteeType
instance MimeRender MimeMultipartFormData E'GranteeType where mimeRender :: Proxy MimeMultipartFormData -> E'GranteeType -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'GranteeType -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'GranteeType :: E'GranteeType -> Text
fromE'GranteeType :: E'GranteeType -> Text
fromE'GranteeType = \case
E'GranteeType
E'GranteeType'GRANTEE_TYPE_UNSPECIFIED -> Text
"GRANTEE_TYPE_UNSPECIFIED"
E'GranteeType
E'GranteeType'USER -> Text
"USER"
E'GranteeType
E'GranteeType'GROUP -> Text
"GROUP"
E'GranteeType
E'GranteeType'EVERYONE -> Text
"EVERYONE"
toE'GranteeType :: Text -> P.Either String E'GranteeType
toE'GranteeType :: Text -> Either [Char] E'GranteeType
toE'GranteeType = \case
Text
"GRANTEE_TYPE_UNSPECIFIED" -> E'GranteeType -> Either [Char] E'GranteeType
forall a b. b -> Either a b
P.Right E'GranteeType
E'GranteeType'GRANTEE_TYPE_UNSPECIFIED
Text
"USER" -> E'GranteeType -> Either [Char] E'GranteeType
forall a b. b -> Either a b
P.Right E'GranteeType
E'GranteeType'USER
Text
"GROUP" -> E'GranteeType -> Either [Char] E'GranteeType
forall a b. b -> Either a b
P.Right E'GranteeType
E'GranteeType'GROUP
Text
"EVERYONE" -> E'GranteeType -> Either [Char] E'GranteeType
forall a b. b -> Either a b
P.Right E'GranteeType
E'GranteeType'EVERYONE
Text
s -> [Char] -> Either [Char] E'GranteeType
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'GranteeType)
-> [Char] -> Either [Char] E'GranteeType
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'GranteeType: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Language
=
E'Language'LANGUAGE_UNSPECIFIED
|
E'Language'PYTHON
deriving (Int -> E'Language -> ShowS
[E'Language] -> ShowS
E'Language -> [Char]
(Int -> E'Language -> ShowS)
-> (E'Language -> [Char])
-> ([E'Language] -> ShowS)
-> Show E'Language
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Language -> ShowS
showsPrec :: Int -> E'Language -> ShowS
$cshow :: E'Language -> [Char]
show :: E'Language -> [Char]
$cshowList :: [E'Language] -> ShowS
showList :: [E'Language] -> ShowS
P.Show, E'Language -> E'Language -> Bool
(E'Language -> E'Language -> Bool)
-> (E'Language -> E'Language -> Bool) -> Eq E'Language
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Language -> E'Language -> Bool
== :: E'Language -> E'Language -> Bool
$c/= :: E'Language -> E'Language -> Bool
/= :: E'Language -> E'Language -> Bool
P.Eq, P.Typeable, Eq E'Language
Eq E'Language =>
(E'Language -> E'Language -> Ordering)
-> (E'Language -> E'Language -> Bool)
-> (E'Language -> E'Language -> Bool)
-> (E'Language -> E'Language -> Bool)
-> (E'Language -> E'Language -> Bool)
-> (E'Language -> E'Language -> E'Language)
-> (E'Language -> E'Language -> E'Language)
-> Ord E'Language
E'Language -> E'Language -> Bool
E'Language -> E'Language -> Ordering
E'Language -> E'Language -> E'Language
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
$ccompare :: E'Language -> E'Language -> Ordering
compare :: E'Language -> E'Language -> Ordering
$c< :: E'Language -> E'Language -> Bool
< :: E'Language -> E'Language -> Bool
$c<= :: E'Language -> E'Language -> Bool
<= :: E'Language -> E'Language -> Bool
$c> :: E'Language -> E'Language -> Bool
> :: E'Language -> E'Language -> Bool
$c>= :: E'Language -> E'Language -> Bool
>= :: E'Language -> E'Language -> Bool
$cmax :: E'Language -> E'Language -> E'Language
max :: E'Language -> E'Language -> E'Language
$cmin :: E'Language -> E'Language -> E'Language
min :: E'Language -> E'Language -> E'Language
P.Ord, E'Language
E'Language -> E'Language -> Bounded E'Language
forall a. a -> a -> Bounded a
$cminBound :: E'Language
minBound :: E'Language
$cmaxBound :: E'Language
maxBound :: E'Language
P.Bounded, Int -> E'Language
E'Language -> Int
E'Language -> [E'Language]
E'Language -> E'Language
E'Language -> E'Language -> [E'Language]
E'Language -> E'Language -> E'Language -> [E'Language]
(E'Language -> E'Language)
-> (E'Language -> E'Language)
-> (Int -> E'Language)
-> (E'Language -> Int)
-> (E'Language -> [E'Language])
-> (E'Language -> E'Language -> [E'Language])
-> (E'Language -> E'Language -> [E'Language])
-> (E'Language -> E'Language -> E'Language -> [E'Language])
-> Enum E'Language
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Language -> E'Language
succ :: E'Language -> E'Language
$cpred :: E'Language -> E'Language
pred :: E'Language -> E'Language
$ctoEnum :: Int -> E'Language
toEnum :: Int -> E'Language
$cfromEnum :: E'Language -> Int
fromEnum :: E'Language -> Int
$cenumFrom :: E'Language -> [E'Language]
enumFrom :: E'Language -> [E'Language]
$cenumFromThen :: E'Language -> E'Language -> [E'Language]
enumFromThen :: E'Language -> E'Language -> [E'Language]
$cenumFromTo :: E'Language -> E'Language -> [E'Language]
enumFromTo :: E'Language -> E'Language -> [E'Language]
$cenumFromThenTo :: E'Language -> E'Language -> E'Language -> [E'Language]
enumFromThenTo :: E'Language -> E'Language -> E'Language -> [E'Language]
P.Enum)
instance A.ToJSON E'Language where toJSON :: E'Language -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Language -> Text) -> E'Language -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Language -> Text
fromE'Language
instance A.FromJSON E'Language where parseJSON :: Value -> Parser E'Language
parseJSON Value
o = ([Char] -> Parser E'Language)
-> (E'Language -> Parser E'Language)
-> Either [Char] E'Language
-> Parser E'Language
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Language
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Language -> Parser E'Language
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Language -> Parser E'Language)
-> (E'Language -> E'Language) -> E'Language -> Parser E'Language
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Language -> E'Language
forall a. a -> a
P.id) (Either [Char] E'Language -> Parser E'Language)
-> (Text -> Either [Char] E'Language) -> Text -> Parser E'Language
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Language
toE'Language (Text -> Parser E'Language) -> Parser Text -> Parser E'Language
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Language where toQueryParam :: E'Language -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Language -> Text) -> E'Language -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Language -> Text
fromE'Language
instance WH.FromHttpApiData E'Language where parseQueryParam :: Text -> Either Text E'Language
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Language) -> Either Text E'Language
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'Language -> Either Text E'Language
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Language -> Either Text E'Language)
-> (Text -> Either [Char] E'Language)
-> Text
-> Either Text E'Language
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Language
toE'Language
instance MimeRender MimeMultipartFormData E'Language where mimeRender :: Proxy MimeMultipartFormData -> E'Language -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Language -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Language :: E'Language -> Text
fromE'Language :: E'Language -> Text
fromE'Language = \case
E'Language
E'Language'LANGUAGE_UNSPECIFIED -> Text
"LANGUAGE_UNSPECIFIED"
E'Language
E'Language'PYTHON -> Text
"PYTHON"
toE'Language :: Text -> P.Either String E'Language
toE'Language :: Text -> Either [Char] E'Language
toE'Language = \case
Text
"LANGUAGE_UNSPECIFIED" -> E'Language -> Either [Char] E'Language
forall a b. b -> Either a b
P.Right E'Language
E'Language'LANGUAGE_UNSPECIFIED
Text
"PYTHON" -> E'Language -> Either [Char] E'Language
forall a b. b -> Either a b
P.Right E'Language
E'Language'PYTHON
Text
s -> [Char] -> Either [Char] E'Language
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Language)
-> [Char] -> Either [Char] E'Language
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Language: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'MediaResolution
=
E'MediaResolution'UNSPECIFIED
|
E'MediaResolution'LOW
|
E'MediaResolution'MEDIUM
|
E'MediaResolution'HIGH
deriving (Int -> E'MediaResolution -> ShowS
[E'MediaResolution] -> ShowS
E'MediaResolution -> [Char]
(Int -> E'MediaResolution -> ShowS)
-> (E'MediaResolution -> [Char])
-> ([E'MediaResolution] -> ShowS)
-> Show E'MediaResolution
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'MediaResolution -> ShowS
showsPrec :: Int -> E'MediaResolution -> ShowS
$cshow :: E'MediaResolution -> [Char]
show :: E'MediaResolution -> [Char]
$cshowList :: [E'MediaResolution] -> ShowS
showList :: [E'MediaResolution] -> ShowS
P.Show, E'MediaResolution -> E'MediaResolution -> Bool
(E'MediaResolution -> E'MediaResolution -> Bool)
-> (E'MediaResolution -> E'MediaResolution -> Bool)
-> Eq E'MediaResolution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'MediaResolution -> E'MediaResolution -> Bool
== :: E'MediaResolution -> E'MediaResolution -> Bool
$c/= :: E'MediaResolution -> E'MediaResolution -> Bool
/= :: E'MediaResolution -> E'MediaResolution -> Bool
P.Eq, P.Typeable, Eq E'MediaResolution
Eq E'MediaResolution =>
(E'MediaResolution -> E'MediaResolution -> Ordering)
-> (E'MediaResolution -> E'MediaResolution -> Bool)
-> (E'MediaResolution -> E'MediaResolution -> Bool)
-> (E'MediaResolution -> E'MediaResolution -> Bool)
-> (E'MediaResolution -> E'MediaResolution -> Bool)
-> (E'MediaResolution -> E'MediaResolution -> E'MediaResolution)
-> (E'MediaResolution -> E'MediaResolution -> E'MediaResolution)
-> Ord E'MediaResolution
E'MediaResolution -> E'MediaResolution -> Bool
E'MediaResolution -> E'MediaResolution -> Ordering
E'MediaResolution -> E'MediaResolution -> E'MediaResolution
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
$ccompare :: E'MediaResolution -> E'MediaResolution -> Ordering
compare :: E'MediaResolution -> E'MediaResolution -> Ordering
$c< :: E'MediaResolution -> E'MediaResolution -> Bool
< :: E'MediaResolution -> E'MediaResolution -> Bool
$c<= :: E'MediaResolution -> E'MediaResolution -> Bool
<= :: E'MediaResolution -> E'MediaResolution -> Bool
$c> :: E'MediaResolution -> E'MediaResolution -> Bool
> :: E'MediaResolution -> E'MediaResolution -> Bool
$c>= :: E'MediaResolution -> E'MediaResolution -> Bool
>= :: E'MediaResolution -> E'MediaResolution -> Bool
$cmax :: E'MediaResolution -> E'MediaResolution -> E'MediaResolution
max :: E'MediaResolution -> E'MediaResolution -> E'MediaResolution
$cmin :: E'MediaResolution -> E'MediaResolution -> E'MediaResolution
min :: E'MediaResolution -> E'MediaResolution -> E'MediaResolution
P.Ord, E'MediaResolution
E'MediaResolution -> E'MediaResolution -> Bounded E'MediaResolution
forall a. a -> a -> Bounded a
$cminBound :: E'MediaResolution
minBound :: E'MediaResolution
$cmaxBound :: E'MediaResolution
maxBound :: E'MediaResolution
P.Bounded, Int -> E'MediaResolution
E'MediaResolution -> Int
E'MediaResolution -> [E'MediaResolution]
E'MediaResolution -> E'MediaResolution
E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
E'MediaResolution
-> E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
(E'MediaResolution -> E'MediaResolution)
-> (E'MediaResolution -> E'MediaResolution)
-> (Int -> E'MediaResolution)
-> (E'MediaResolution -> Int)
-> (E'MediaResolution -> [E'MediaResolution])
-> (E'MediaResolution -> E'MediaResolution -> [E'MediaResolution])
-> (E'MediaResolution -> E'MediaResolution -> [E'MediaResolution])
-> (E'MediaResolution
-> E'MediaResolution -> E'MediaResolution -> [E'MediaResolution])
-> Enum E'MediaResolution
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'MediaResolution -> E'MediaResolution
succ :: E'MediaResolution -> E'MediaResolution
$cpred :: E'MediaResolution -> E'MediaResolution
pred :: E'MediaResolution -> E'MediaResolution
$ctoEnum :: Int -> E'MediaResolution
toEnum :: Int -> E'MediaResolution
$cfromEnum :: E'MediaResolution -> Int
fromEnum :: E'MediaResolution -> Int
$cenumFrom :: E'MediaResolution -> [E'MediaResolution]
enumFrom :: E'MediaResolution -> [E'MediaResolution]
$cenumFromThen :: E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
enumFromThen :: E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
$cenumFromTo :: E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
enumFromTo :: E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
$cenumFromThenTo :: E'MediaResolution
-> E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
enumFromThenTo :: E'MediaResolution
-> E'MediaResolution -> E'MediaResolution -> [E'MediaResolution]
P.Enum)
instance A.ToJSON E'MediaResolution where toJSON :: E'MediaResolution -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'MediaResolution -> Text) -> E'MediaResolution -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'MediaResolution -> Text
fromE'MediaResolution
instance A.FromJSON E'MediaResolution where parseJSON :: Value -> Parser E'MediaResolution
parseJSON Value
o = ([Char] -> Parser E'MediaResolution)
-> (E'MediaResolution -> Parser E'MediaResolution)
-> Either [Char] E'MediaResolution
-> Parser E'MediaResolution
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'MediaResolution
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'MediaResolution -> Parser E'MediaResolution
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'MediaResolution -> Parser E'MediaResolution)
-> (E'MediaResolution -> E'MediaResolution)
-> E'MediaResolution
-> Parser E'MediaResolution
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'MediaResolution -> E'MediaResolution
forall a. a -> a
P.id) (Either [Char] E'MediaResolution -> Parser E'MediaResolution)
-> (Text -> Either [Char] E'MediaResolution)
-> Text
-> Parser E'MediaResolution
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'MediaResolution
toE'MediaResolution (Text -> Parser E'MediaResolution)
-> Parser Text -> Parser E'MediaResolution
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'MediaResolution where toQueryParam :: E'MediaResolution -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text)
-> (E'MediaResolution -> Text) -> E'MediaResolution -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'MediaResolution -> Text
fromE'MediaResolution
instance WH.FromHttpApiData E'MediaResolution where parseQueryParam :: Text -> Either Text E'MediaResolution
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'MediaResolution)
-> Either Text E'MediaResolution
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'MediaResolution -> Either Text E'MediaResolution
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'MediaResolution -> Either Text E'MediaResolution)
-> (Text -> Either [Char] E'MediaResolution)
-> Text
-> Either Text E'MediaResolution
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'MediaResolution
toE'MediaResolution
instance MimeRender MimeMultipartFormData E'MediaResolution where mimeRender :: Proxy MimeMultipartFormData -> E'MediaResolution -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'MediaResolution -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'MediaResolution :: E'MediaResolution -> Text
fromE'MediaResolution :: E'MediaResolution -> Text
fromE'MediaResolution = \case
E'MediaResolution
E'MediaResolution'UNSPECIFIED -> Text
"MEDIA_RESOLUTION_UNSPECIFIED"
E'MediaResolution
E'MediaResolution'LOW -> Text
"MEDIA_RESOLUTION_LOW"
E'MediaResolution
E'MediaResolution'MEDIUM -> Text
"MEDIA_RESOLUTION_MEDIUM"
E'MediaResolution
E'MediaResolution'HIGH -> Text
"MEDIA_RESOLUTION_HIGH"
toE'MediaResolution :: Text -> P.Either String E'MediaResolution
toE'MediaResolution :: Text -> Either [Char] E'MediaResolution
toE'MediaResolution = \case
Text
"MEDIA_RESOLUTION_UNSPECIFIED" -> E'MediaResolution -> Either [Char] E'MediaResolution
forall a b. b -> Either a b
P.Right E'MediaResolution
E'MediaResolution'UNSPECIFIED
Text
"MEDIA_RESOLUTION_LOW" -> E'MediaResolution -> Either [Char] E'MediaResolution
forall a b. b -> Either a b
P.Right E'MediaResolution
E'MediaResolution'LOW
Text
"MEDIA_RESOLUTION_MEDIUM" -> E'MediaResolution -> Either [Char] E'MediaResolution
forall a b. b -> Either a b
P.Right E'MediaResolution
E'MediaResolution'MEDIUM
Text
"MEDIA_RESOLUTION_HIGH" -> E'MediaResolution -> Either [Char] E'MediaResolution
forall a b. b -> Either a b
P.Right E'MediaResolution
E'MediaResolution'HIGH
Text
s -> [Char] -> Either [Char] E'MediaResolution
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'MediaResolution)
-> [Char] -> Either [Char] E'MediaResolution
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'MediaResolution: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Mode
=
E'Mode'UNSPECIFIED
|
E'Mode'DYNAMIC
deriving (Int -> E'Mode -> ShowS
[E'Mode] -> ShowS
E'Mode -> [Char]
(Int -> E'Mode -> ShowS)
-> (E'Mode -> [Char]) -> ([E'Mode] -> ShowS) -> Show E'Mode
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Mode -> ShowS
showsPrec :: Int -> E'Mode -> ShowS
$cshow :: E'Mode -> [Char]
show :: E'Mode -> [Char]
$cshowList :: [E'Mode] -> ShowS
showList :: [E'Mode] -> ShowS
P.Show, E'Mode -> E'Mode -> Bool
(E'Mode -> E'Mode -> Bool)
-> (E'Mode -> E'Mode -> Bool) -> Eq E'Mode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Mode -> E'Mode -> Bool
== :: E'Mode -> E'Mode -> Bool
$c/= :: E'Mode -> E'Mode -> Bool
/= :: E'Mode -> E'Mode -> Bool
P.Eq, P.Typeable, Eq E'Mode
Eq E'Mode =>
(E'Mode -> E'Mode -> Ordering)
-> (E'Mode -> E'Mode -> Bool)
-> (E'Mode -> E'Mode -> Bool)
-> (E'Mode -> E'Mode -> Bool)
-> (E'Mode -> E'Mode -> Bool)
-> (E'Mode -> E'Mode -> E'Mode)
-> (E'Mode -> E'Mode -> E'Mode)
-> Ord E'Mode
E'Mode -> E'Mode -> Bool
E'Mode -> E'Mode -> Ordering
E'Mode -> E'Mode -> E'Mode
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
$ccompare :: E'Mode -> E'Mode -> Ordering
compare :: E'Mode -> E'Mode -> Ordering
$c< :: E'Mode -> E'Mode -> Bool
< :: E'Mode -> E'Mode -> Bool
$c<= :: E'Mode -> E'Mode -> Bool
<= :: E'Mode -> E'Mode -> Bool
$c> :: E'Mode -> E'Mode -> Bool
> :: E'Mode -> E'Mode -> Bool
$c>= :: E'Mode -> E'Mode -> Bool
>= :: E'Mode -> E'Mode -> Bool
$cmax :: E'Mode -> E'Mode -> E'Mode
max :: E'Mode -> E'Mode -> E'Mode
$cmin :: E'Mode -> E'Mode -> E'Mode
min :: E'Mode -> E'Mode -> E'Mode
P.Ord, E'Mode
E'Mode -> E'Mode -> Bounded E'Mode
forall a. a -> a -> Bounded a
$cminBound :: E'Mode
minBound :: E'Mode
$cmaxBound :: E'Mode
maxBound :: E'Mode
P.Bounded, Int -> E'Mode
E'Mode -> Int
E'Mode -> [E'Mode]
E'Mode -> E'Mode
E'Mode -> E'Mode -> [E'Mode]
E'Mode -> E'Mode -> E'Mode -> [E'Mode]
(E'Mode -> E'Mode)
-> (E'Mode -> E'Mode)
-> (Int -> E'Mode)
-> (E'Mode -> Int)
-> (E'Mode -> [E'Mode])
-> (E'Mode -> E'Mode -> [E'Mode])
-> (E'Mode -> E'Mode -> [E'Mode])
-> (E'Mode -> E'Mode -> E'Mode -> [E'Mode])
-> Enum E'Mode
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Mode -> E'Mode
succ :: E'Mode -> E'Mode
$cpred :: E'Mode -> E'Mode
pred :: E'Mode -> E'Mode
$ctoEnum :: Int -> E'Mode
toEnum :: Int -> E'Mode
$cfromEnum :: E'Mode -> Int
fromEnum :: E'Mode -> Int
$cenumFrom :: E'Mode -> [E'Mode]
enumFrom :: E'Mode -> [E'Mode]
$cenumFromThen :: E'Mode -> E'Mode -> [E'Mode]
enumFromThen :: E'Mode -> E'Mode -> [E'Mode]
$cenumFromTo :: E'Mode -> E'Mode -> [E'Mode]
enumFromTo :: E'Mode -> E'Mode -> [E'Mode]
$cenumFromThenTo :: E'Mode -> E'Mode -> E'Mode -> [E'Mode]
enumFromThenTo :: E'Mode -> E'Mode -> E'Mode -> [E'Mode]
P.Enum)
instance A.ToJSON E'Mode where toJSON :: E'Mode -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Mode -> Text) -> E'Mode -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Mode -> Text
fromE'Mode
instance A.FromJSON E'Mode where parseJSON :: Value -> Parser E'Mode
parseJSON Value
o = ([Char] -> Parser E'Mode)
-> (E'Mode -> Parser E'Mode)
-> Either [Char] E'Mode
-> Parser E'Mode
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Mode
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Mode -> Parser E'Mode
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Mode -> Parser E'Mode)
-> (E'Mode -> E'Mode) -> E'Mode -> Parser E'Mode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Mode -> E'Mode
forall a. a -> a
P.id) (Either [Char] E'Mode -> Parser E'Mode)
-> (Text -> Either [Char] E'Mode) -> Text -> Parser E'Mode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Mode
toE'Mode (Text -> Parser E'Mode) -> Parser Text -> Parser E'Mode
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Mode where toQueryParam :: E'Mode -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Mode -> Text) -> E'Mode -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Mode -> Text
fromE'Mode
instance WH.FromHttpApiData E'Mode where parseQueryParam :: Text -> Either Text E'Mode
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Mode) -> Either Text E'Mode
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'Mode -> Either Text E'Mode
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Mode -> Either Text E'Mode)
-> (Text -> Either [Char] E'Mode) -> Text -> Either Text E'Mode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Mode
toE'Mode
instance MimeRender MimeMultipartFormData E'Mode where mimeRender :: Proxy MimeMultipartFormData -> E'Mode -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Mode -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Mode :: E'Mode -> Text
fromE'Mode :: E'Mode -> Text
fromE'Mode = \case
E'Mode
E'Mode'UNSPECIFIED -> Text
"MODE_UNSPECIFIED"
E'Mode
E'Mode'DYNAMIC -> Text
"MODE_DYNAMIC"
toE'Mode :: Text -> P.Either String E'Mode
toE'Mode :: Text -> Either [Char] E'Mode
toE'Mode = \case
Text
"MODE_UNSPECIFIED" -> E'Mode -> Either [Char] E'Mode
forall a b. b -> Either a b
P.Right E'Mode
E'Mode'UNSPECIFIED
Text
"MODE_DYNAMIC" -> E'Mode -> Either [Char] E'Mode
forall a b. b -> Either a b
P.Right E'Mode
E'Mode'DYNAMIC
Text
s -> [Char] -> Either [Char] E'Mode
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Mode) -> [Char] -> Either [Char] E'Mode
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Mode: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Mode2
=
E'Mode2'MODE_UNSPECIFIED
|
E'Mode2'AUTO
|
E'Mode2'ANY
|
E'Mode2'NONE
|
E'Mode2'VALIDATED
deriving (Int -> E'Mode2 -> ShowS
[E'Mode2] -> ShowS
E'Mode2 -> [Char]
(Int -> E'Mode2 -> ShowS)
-> (E'Mode2 -> [Char]) -> ([E'Mode2] -> ShowS) -> Show E'Mode2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Mode2 -> ShowS
showsPrec :: Int -> E'Mode2 -> ShowS
$cshow :: E'Mode2 -> [Char]
show :: E'Mode2 -> [Char]
$cshowList :: [E'Mode2] -> ShowS
showList :: [E'Mode2] -> ShowS
P.Show, E'Mode2 -> E'Mode2 -> Bool
(E'Mode2 -> E'Mode2 -> Bool)
-> (E'Mode2 -> E'Mode2 -> Bool) -> Eq E'Mode2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Mode2 -> E'Mode2 -> Bool
== :: E'Mode2 -> E'Mode2 -> Bool
$c/= :: E'Mode2 -> E'Mode2 -> Bool
/= :: E'Mode2 -> E'Mode2 -> Bool
P.Eq, P.Typeable, Eq E'Mode2
Eq E'Mode2 =>
(E'Mode2 -> E'Mode2 -> Ordering)
-> (E'Mode2 -> E'Mode2 -> Bool)
-> (E'Mode2 -> E'Mode2 -> Bool)
-> (E'Mode2 -> E'Mode2 -> Bool)
-> (E'Mode2 -> E'Mode2 -> Bool)
-> (E'Mode2 -> E'Mode2 -> E'Mode2)
-> (E'Mode2 -> E'Mode2 -> E'Mode2)
-> Ord E'Mode2
E'Mode2 -> E'Mode2 -> Bool
E'Mode2 -> E'Mode2 -> Ordering
E'Mode2 -> E'Mode2 -> E'Mode2
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
$ccompare :: E'Mode2 -> E'Mode2 -> Ordering
compare :: E'Mode2 -> E'Mode2 -> Ordering
$c< :: E'Mode2 -> E'Mode2 -> Bool
< :: E'Mode2 -> E'Mode2 -> Bool
$c<= :: E'Mode2 -> E'Mode2 -> Bool
<= :: E'Mode2 -> E'Mode2 -> Bool
$c> :: E'Mode2 -> E'Mode2 -> Bool
> :: E'Mode2 -> E'Mode2 -> Bool
$c>= :: E'Mode2 -> E'Mode2 -> Bool
>= :: E'Mode2 -> E'Mode2 -> Bool
$cmax :: E'Mode2 -> E'Mode2 -> E'Mode2
max :: E'Mode2 -> E'Mode2 -> E'Mode2
$cmin :: E'Mode2 -> E'Mode2 -> E'Mode2
min :: E'Mode2 -> E'Mode2 -> E'Mode2
P.Ord, E'Mode2
E'Mode2 -> E'Mode2 -> Bounded E'Mode2
forall a. a -> a -> Bounded a
$cminBound :: E'Mode2
minBound :: E'Mode2
$cmaxBound :: E'Mode2
maxBound :: E'Mode2
P.Bounded, Int -> E'Mode2
E'Mode2 -> Int
E'Mode2 -> [E'Mode2]
E'Mode2 -> E'Mode2
E'Mode2 -> E'Mode2 -> [E'Mode2]
E'Mode2 -> E'Mode2 -> E'Mode2 -> [E'Mode2]
(E'Mode2 -> E'Mode2)
-> (E'Mode2 -> E'Mode2)
-> (Int -> E'Mode2)
-> (E'Mode2 -> Int)
-> (E'Mode2 -> [E'Mode2])
-> (E'Mode2 -> E'Mode2 -> [E'Mode2])
-> (E'Mode2 -> E'Mode2 -> [E'Mode2])
-> (E'Mode2 -> E'Mode2 -> E'Mode2 -> [E'Mode2])
-> Enum E'Mode2
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Mode2 -> E'Mode2
succ :: E'Mode2 -> E'Mode2
$cpred :: E'Mode2 -> E'Mode2
pred :: E'Mode2 -> E'Mode2
$ctoEnum :: Int -> E'Mode2
toEnum :: Int -> E'Mode2
$cfromEnum :: E'Mode2 -> Int
fromEnum :: E'Mode2 -> Int
$cenumFrom :: E'Mode2 -> [E'Mode2]
enumFrom :: E'Mode2 -> [E'Mode2]
$cenumFromThen :: E'Mode2 -> E'Mode2 -> [E'Mode2]
enumFromThen :: E'Mode2 -> E'Mode2 -> [E'Mode2]
$cenumFromTo :: E'Mode2 -> E'Mode2 -> [E'Mode2]
enumFromTo :: E'Mode2 -> E'Mode2 -> [E'Mode2]
$cenumFromThenTo :: E'Mode2 -> E'Mode2 -> E'Mode2 -> [E'Mode2]
enumFromThenTo :: E'Mode2 -> E'Mode2 -> E'Mode2 -> [E'Mode2]
P.Enum)
instance A.ToJSON E'Mode2 where toJSON :: E'Mode2 -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Mode2 -> Text) -> E'Mode2 -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Mode2 -> Text
fromE'Mode2
instance A.FromJSON E'Mode2 where parseJSON :: Value -> Parser E'Mode2
parseJSON Value
o = ([Char] -> Parser E'Mode2)
-> (E'Mode2 -> Parser E'Mode2)
-> Either [Char] E'Mode2
-> Parser E'Mode2
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Mode2
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Mode2 -> Parser E'Mode2
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Mode2 -> Parser E'Mode2)
-> (E'Mode2 -> E'Mode2) -> E'Mode2 -> Parser E'Mode2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Mode2 -> E'Mode2
forall a. a -> a
P.id) (Either [Char] E'Mode2 -> Parser E'Mode2)
-> (Text -> Either [Char] E'Mode2) -> Text -> Parser E'Mode2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Mode2
toE'Mode2 (Text -> Parser E'Mode2) -> Parser Text -> Parser E'Mode2
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Mode2 where toQueryParam :: E'Mode2 -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Mode2 -> Text) -> E'Mode2 -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Mode2 -> Text
fromE'Mode2
instance WH.FromHttpApiData E'Mode2 where parseQueryParam :: Text -> Either Text E'Mode2
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Mode2) -> Either Text E'Mode2
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'Mode2 -> Either Text E'Mode2
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Mode2 -> Either Text E'Mode2)
-> (Text -> Either [Char] E'Mode2) -> Text -> Either Text E'Mode2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Mode2
toE'Mode2
instance MimeRender MimeMultipartFormData E'Mode2 where mimeRender :: Proxy MimeMultipartFormData -> E'Mode2 -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Mode2 -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Mode2 :: E'Mode2 -> Text
fromE'Mode2 :: E'Mode2 -> Text
fromE'Mode2 = \case
E'Mode2
E'Mode2'MODE_UNSPECIFIED -> Text
"MODE_UNSPECIFIED"
E'Mode2
E'Mode2'AUTO -> Text
"AUTO"
E'Mode2
E'Mode2'ANY -> Text
"ANY"
E'Mode2
E'Mode2'NONE -> Text
"NONE"
E'Mode2
E'Mode2'VALIDATED -> Text
"VALIDATED"
toE'Mode2 :: Text -> P.Either String E'Mode2
toE'Mode2 :: Text -> Either [Char] E'Mode2
toE'Mode2 = \case
Text
"MODE_UNSPECIFIED" -> E'Mode2 -> Either [Char] E'Mode2
forall a b. b -> Either a b
P.Right E'Mode2
E'Mode2'MODE_UNSPECIFIED
Text
"AUTO" -> E'Mode2 -> Either [Char] E'Mode2
forall a b. b -> Either a b
P.Right E'Mode2
E'Mode2'AUTO
Text
"ANY" -> E'Mode2 -> Either [Char] E'Mode2
forall a b. b -> Either a b
P.Right E'Mode2
E'Mode2'ANY
Text
"NONE" -> E'Mode2 -> Either [Char] E'Mode2
forall a b. b -> Either a b
P.Right E'Mode2
E'Mode2'NONE
Text
"VALIDATED" -> E'Mode2 -> Either [Char] E'Mode2
forall a b. b -> Either a b
P.Right E'Mode2
E'Mode2'VALIDATED
Text
s -> [Char] -> Either [Char] E'Mode2
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Mode2)
-> [Char] -> Either [Char] E'Mode2
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Mode2: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Operation
=
E'Operation'OPERATOR_UNSPECIFIED
|
E'Operation'LESS
|
E'Operation'LESS_EQUAL
|
E'Operation'EQUAL
|
E'Operation'GREATER_EQUAL
|
E'Operation'GREATER
|
E'Operation'NOT_EQUAL
|
E'Operation'INCLUDES
|
E'Operation'EXCLUDES
deriving (Int -> E'Operation -> ShowS
[E'Operation] -> ShowS
E'Operation -> [Char]
(Int -> E'Operation -> ShowS)
-> (E'Operation -> [Char])
-> ([E'Operation] -> ShowS)
-> Show E'Operation
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Operation -> ShowS
showsPrec :: Int -> E'Operation -> ShowS
$cshow :: E'Operation -> [Char]
show :: E'Operation -> [Char]
$cshowList :: [E'Operation] -> ShowS
showList :: [E'Operation] -> ShowS
P.Show, E'Operation -> E'Operation -> Bool
(E'Operation -> E'Operation -> Bool)
-> (E'Operation -> E'Operation -> Bool) -> Eq E'Operation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Operation -> E'Operation -> Bool
== :: E'Operation -> E'Operation -> Bool
$c/= :: E'Operation -> E'Operation -> Bool
/= :: E'Operation -> E'Operation -> Bool
P.Eq, P.Typeable, Eq E'Operation
Eq E'Operation =>
(E'Operation -> E'Operation -> Ordering)
-> (E'Operation -> E'Operation -> Bool)
-> (E'Operation -> E'Operation -> Bool)
-> (E'Operation -> E'Operation -> Bool)
-> (E'Operation -> E'Operation -> Bool)
-> (E'Operation -> E'Operation -> E'Operation)
-> (E'Operation -> E'Operation -> E'Operation)
-> Ord E'Operation
E'Operation -> E'Operation -> Bool
E'Operation -> E'Operation -> Ordering
E'Operation -> E'Operation -> E'Operation
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
$ccompare :: E'Operation -> E'Operation -> Ordering
compare :: E'Operation -> E'Operation -> Ordering
$c< :: E'Operation -> E'Operation -> Bool
< :: E'Operation -> E'Operation -> Bool
$c<= :: E'Operation -> E'Operation -> Bool
<= :: E'Operation -> E'Operation -> Bool
$c> :: E'Operation -> E'Operation -> Bool
> :: E'Operation -> E'Operation -> Bool
$c>= :: E'Operation -> E'Operation -> Bool
>= :: E'Operation -> E'Operation -> Bool
$cmax :: E'Operation -> E'Operation -> E'Operation
max :: E'Operation -> E'Operation -> E'Operation
$cmin :: E'Operation -> E'Operation -> E'Operation
min :: E'Operation -> E'Operation -> E'Operation
P.Ord, E'Operation
E'Operation -> E'Operation -> Bounded E'Operation
forall a. a -> a -> Bounded a
$cminBound :: E'Operation
minBound :: E'Operation
$cmaxBound :: E'Operation
maxBound :: E'Operation
P.Bounded, Int -> E'Operation
E'Operation -> Int
E'Operation -> [E'Operation]
E'Operation -> E'Operation
E'Operation -> E'Operation -> [E'Operation]
E'Operation -> E'Operation -> E'Operation -> [E'Operation]
(E'Operation -> E'Operation)
-> (E'Operation -> E'Operation)
-> (Int -> E'Operation)
-> (E'Operation -> Int)
-> (E'Operation -> [E'Operation])
-> (E'Operation -> E'Operation -> [E'Operation])
-> (E'Operation -> E'Operation -> [E'Operation])
-> (E'Operation -> E'Operation -> E'Operation -> [E'Operation])
-> Enum E'Operation
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Operation -> E'Operation
succ :: E'Operation -> E'Operation
$cpred :: E'Operation -> E'Operation
pred :: E'Operation -> E'Operation
$ctoEnum :: Int -> E'Operation
toEnum :: Int -> E'Operation
$cfromEnum :: E'Operation -> Int
fromEnum :: E'Operation -> Int
$cenumFrom :: E'Operation -> [E'Operation]
enumFrom :: E'Operation -> [E'Operation]
$cenumFromThen :: E'Operation -> E'Operation -> [E'Operation]
enumFromThen :: E'Operation -> E'Operation -> [E'Operation]
$cenumFromTo :: E'Operation -> E'Operation -> [E'Operation]
enumFromTo :: E'Operation -> E'Operation -> [E'Operation]
$cenumFromThenTo :: E'Operation -> E'Operation -> E'Operation -> [E'Operation]
enumFromThenTo :: E'Operation -> E'Operation -> E'Operation -> [E'Operation]
P.Enum)
instance A.ToJSON E'Operation where toJSON :: E'Operation -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Operation -> Text) -> E'Operation -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Operation -> Text
fromE'Operation
instance A.FromJSON E'Operation where parseJSON :: Value -> Parser E'Operation
parseJSON Value
o = ([Char] -> Parser E'Operation)
-> (E'Operation -> Parser E'Operation)
-> Either [Char] E'Operation
-> Parser E'Operation
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Operation
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Operation -> Parser E'Operation
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Operation -> Parser E'Operation)
-> (E'Operation -> E'Operation)
-> E'Operation
-> Parser E'Operation
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Operation -> E'Operation
forall a. a -> a
P.id) (Either [Char] E'Operation -> Parser E'Operation)
-> (Text -> Either [Char] E'Operation)
-> Text
-> Parser E'Operation
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Operation
toE'Operation (Text -> Parser E'Operation) -> Parser Text -> Parser E'Operation
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Operation where toQueryParam :: E'Operation -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Operation -> Text) -> E'Operation -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Operation -> Text
fromE'Operation
instance WH.FromHttpApiData E'Operation where parseQueryParam :: Text -> Either Text E'Operation
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Operation) -> Either Text E'Operation
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'Operation -> Either Text E'Operation
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Operation -> Either Text E'Operation)
-> (Text -> Either [Char] E'Operation)
-> Text
-> Either Text E'Operation
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Operation
toE'Operation
instance MimeRender MimeMultipartFormData E'Operation where mimeRender :: Proxy MimeMultipartFormData -> E'Operation -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Operation -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Operation :: E'Operation -> Text
fromE'Operation :: E'Operation -> Text
fromE'Operation = \case
E'Operation
E'Operation'OPERATOR_UNSPECIFIED -> Text
"OPERATOR_UNSPECIFIED"
E'Operation
E'Operation'LESS -> Text
"LESS"
E'Operation
E'Operation'LESS_EQUAL -> Text
"LESS_EQUAL"
E'Operation
E'Operation'EQUAL -> Text
"EQUAL"
E'Operation
E'Operation'GREATER_EQUAL -> Text
"GREATER_EQUAL"
E'Operation
E'Operation'GREATER -> Text
"GREATER"
E'Operation
E'Operation'NOT_EQUAL -> Text
"NOT_EQUAL"
E'Operation
E'Operation'INCLUDES -> Text
"INCLUDES"
E'Operation
E'Operation'EXCLUDES -> Text
"EXCLUDES"
toE'Operation :: Text -> P.Either String E'Operation
toE'Operation :: Text -> Either [Char] E'Operation
toE'Operation = \case
Text
"OPERATOR_UNSPECIFIED" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'OPERATOR_UNSPECIFIED
Text
"LESS" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'LESS
Text
"LESS_EQUAL" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'LESS_EQUAL
Text
"EQUAL" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'EQUAL
Text
"GREATER_EQUAL" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'GREATER_EQUAL
Text
"GREATER" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'GREATER
Text
"NOT_EQUAL" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'NOT_EQUAL
Text
"INCLUDES" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'INCLUDES
Text
"EXCLUDES" -> E'Operation -> Either [Char] E'Operation
forall a b. b -> Either a b
P.Right E'Operation
E'Operation'EXCLUDES
Text
s -> [Char] -> Either [Char] E'Operation
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Operation)
-> [Char] -> Either [Char] E'Operation
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Operation: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Outcome
=
E'Outcome'UNSPECIFIED
|
E'Outcome'OK
|
E'Outcome'FAILED
|
E'Outcome'DEADLINE_EXCEEDED
deriving (Int -> E'Outcome -> ShowS
[E'Outcome] -> ShowS
E'Outcome -> [Char]
(Int -> E'Outcome -> ShowS)
-> (E'Outcome -> [Char])
-> ([E'Outcome] -> ShowS)
-> Show E'Outcome
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Outcome -> ShowS
showsPrec :: Int -> E'Outcome -> ShowS
$cshow :: E'Outcome -> [Char]
show :: E'Outcome -> [Char]
$cshowList :: [E'Outcome] -> ShowS
showList :: [E'Outcome] -> ShowS
P.Show, E'Outcome -> E'Outcome -> Bool
(E'Outcome -> E'Outcome -> Bool)
-> (E'Outcome -> E'Outcome -> Bool) -> Eq E'Outcome
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Outcome -> E'Outcome -> Bool
== :: E'Outcome -> E'Outcome -> Bool
$c/= :: E'Outcome -> E'Outcome -> Bool
/= :: E'Outcome -> E'Outcome -> Bool
P.Eq, P.Typeable, Eq E'Outcome
Eq E'Outcome =>
(E'Outcome -> E'Outcome -> Ordering)
-> (E'Outcome -> E'Outcome -> Bool)
-> (E'Outcome -> E'Outcome -> Bool)
-> (E'Outcome -> E'Outcome -> Bool)
-> (E'Outcome -> E'Outcome -> Bool)
-> (E'Outcome -> E'Outcome -> E'Outcome)
-> (E'Outcome -> E'Outcome -> E'Outcome)
-> Ord E'Outcome
E'Outcome -> E'Outcome -> Bool
E'Outcome -> E'Outcome -> Ordering
E'Outcome -> E'Outcome -> E'Outcome
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
$ccompare :: E'Outcome -> E'Outcome -> Ordering
compare :: E'Outcome -> E'Outcome -> Ordering
$c< :: E'Outcome -> E'Outcome -> Bool
< :: E'Outcome -> E'Outcome -> Bool
$c<= :: E'Outcome -> E'Outcome -> Bool
<= :: E'Outcome -> E'Outcome -> Bool
$c> :: E'Outcome -> E'Outcome -> Bool
> :: E'Outcome -> E'Outcome -> Bool
$c>= :: E'Outcome -> E'Outcome -> Bool
>= :: E'Outcome -> E'Outcome -> Bool
$cmax :: E'Outcome -> E'Outcome -> E'Outcome
max :: E'Outcome -> E'Outcome -> E'Outcome
$cmin :: E'Outcome -> E'Outcome -> E'Outcome
min :: E'Outcome -> E'Outcome -> E'Outcome
P.Ord, E'Outcome
E'Outcome -> E'Outcome -> Bounded E'Outcome
forall a. a -> a -> Bounded a
$cminBound :: E'Outcome
minBound :: E'Outcome
$cmaxBound :: E'Outcome
maxBound :: E'Outcome
P.Bounded, Int -> E'Outcome
E'Outcome -> Int
E'Outcome -> [E'Outcome]
E'Outcome -> E'Outcome
E'Outcome -> E'Outcome -> [E'Outcome]
E'Outcome -> E'Outcome -> E'Outcome -> [E'Outcome]
(E'Outcome -> E'Outcome)
-> (E'Outcome -> E'Outcome)
-> (Int -> E'Outcome)
-> (E'Outcome -> Int)
-> (E'Outcome -> [E'Outcome])
-> (E'Outcome -> E'Outcome -> [E'Outcome])
-> (E'Outcome -> E'Outcome -> [E'Outcome])
-> (E'Outcome -> E'Outcome -> E'Outcome -> [E'Outcome])
-> Enum E'Outcome
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Outcome -> E'Outcome
succ :: E'Outcome -> E'Outcome
$cpred :: E'Outcome -> E'Outcome
pred :: E'Outcome -> E'Outcome
$ctoEnum :: Int -> E'Outcome
toEnum :: Int -> E'Outcome
$cfromEnum :: E'Outcome -> Int
fromEnum :: E'Outcome -> Int
$cenumFrom :: E'Outcome -> [E'Outcome]
enumFrom :: E'Outcome -> [E'Outcome]
$cenumFromThen :: E'Outcome -> E'Outcome -> [E'Outcome]
enumFromThen :: E'Outcome -> E'Outcome -> [E'Outcome]
$cenumFromTo :: E'Outcome -> E'Outcome -> [E'Outcome]
enumFromTo :: E'Outcome -> E'Outcome -> [E'Outcome]
$cenumFromThenTo :: E'Outcome -> E'Outcome -> E'Outcome -> [E'Outcome]
enumFromThenTo :: E'Outcome -> E'Outcome -> E'Outcome -> [E'Outcome]
P.Enum)
instance A.ToJSON E'Outcome where toJSON :: E'Outcome -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Outcome -> Text) -> E'Outcome -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Outcome -> Text
fromE'Outcome
instance A.FromJSON E'Outcome where parseJSON :: Value -> Parser E'Outcome
parseJSON Value
o = ([Char] -> Parser E'Outcome)
-> (E'Outcome -> Parser E'Outcome)
-> Either [Char] E'Outcome
-> Parser E'Outcome
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Outcome
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Outcome -> Parser E'Outcome
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Outcome -> Parser E'Outcome)
-> (E'Outcome -> E'Outcome) -> E'Outcome -> Parser E'Outcome
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Outcome -> E'Outcome
forall a. a -> a
P.id) (Either [Char] E'Outcome -> Parser E'Outcome)
-> (Text -> Either [Char] E'Outcome) -> Text -> Parser E'Outcome
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Outcome
toE'Outcome (Text -> Parser E'Outcome) -> Parser Text -> Parser E'Outcome
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Outcome where toQueryParam :: E'Outcome -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Outcome -> Text) -> E'Outcome -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Outcome -> Text
fromE'Outcome
instance WH.FromHttpApiData E'Outcome where parseQueryParam :: Text -> Either Text E'Outcome
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Outcome) -> Either Text E'Outcome
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'Outcome -> Either Text E'Outcome
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Outcome -> Either Text E'Outcome)
-> (Text -> Either [Char] E'Outcome)
-> Text
-> Either Text E'Outcome
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Outcome
toE'Outcome
instance MimeRender MimeMultipartFormData E'Outcome where mimeRender :: Proxy MimeMultipartFormData -> E'Outcome -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Outcome -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Outcome :: E'Outcome -> Text
fromE'Outcome :: E'Outcome -> Text
fromE'Outcome = \case
E'Outcome
E'Outcome'UNSPECIFIED -> Text
"OUTCOME_UNSPECIFIED"
E'Outcome
E'Outcome'OK -> Text
"OUTCOME_OK"
E'Outcome
E'Outcome'FAILED -> Text
"OUTCOME_FAILED"
E'Outcome
E'Outcome'DEADLINE_EXCEEDED -> Text
"OUTCOME_DEADLINE_EXCEEDED"
toE'Outcome :: Text -> P.Either String E'Outcome
toE'Outcome :: Text -> Either [Char] E'Outcome
toE'Outcome = \case
Text
"OUTCOME_UNSPECIFIED" -> E'Outcome -> Either [Char] E'Outcome
forall a b. b -> Either a b
P.Right E'Outcome
E'Outcome'UNSPECIFIED
Text
"OUTCOME_OK" -> E'Outcome -> Either [Char] E'Outcome
forall a b. b -> Either a b
P.Right E'Outcome
E'Outcome'OK
Text
"OUTCOME_FAILED" -> E'Outcome -> Either [Char] E'Outcome
forall a b. b -> Either a b
P.Right E'Outcome
E'Outcome'FAILED
Text
"OUTCOME_DEADLINE_EXCEEDED" -> E'Outcome -> Either [Char] E'Outcome
forall a b. b -> Either a b
P.Right E'Outcome
E'Outcome'DEADLINE_EXCEEDED
Text
s -> [Char] -> Either [Char] E'Outcome
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Outcome)
-> [Char] -> Either [Char] E'Outcome
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Outcome: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Probability
=
E'Probability'HARM_PROBABILITY_UNSPECIFIED
|
E'Probability'NEGLIGIBLE
|
E'Probability'LOW
|
E'Probability'MEDIUM
|
E'Probability'HIGH
deriving (Int -> E'Probability -> ShowS
[E'Probability] -> ShowS
E'Probability -> [Char]
(Int -> E'Probability -> ShowS)
-> (E'Probability -> [Char])
-> ([E'Probability] -> ShowS)
-> Show E'Probability
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Probability -> ShowS
showsPrec :: Int -> E'Probability -> ShowS
$cshow :: E'Probability -> [Char]
show :: E'Probability -> [Char]
$cshowList :: [E'Probability] -> ShowS
showList :: [E'Probability] -> ShowS
P.Show, E'Probability -> E'Probability -> Bool
(E'Probability -> E'Probability -> Bool)
-> (E'Probability -> E'Probability -> Bool) -> Eq E'Probability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Probability -> E'Probability -> Bool
== :: E'Probability -> E'Probability -> Bool
$c/= :: E'Probability -> E'Probability -> Bool
/= :: E'Probability -> E'Probability -> Bool
P.Eq, P.Typeable, Eq E'Probability
Eq E'Probability =>
(E'Probability -> E'Probability -> Ordering)
-> (E'Probability -> E'Probability -> Bool)
-> (E'Probability -> E'Probability -> Bool)
-> (E'Probability -> E'Probability -> Bool)
-> (E'Probability -> E'Probability -> Bool)
-> (E'Probability -> E'Probability -> E'Probability)
-> (E'Probability -> E'Probability -> E'Probability)
-> Ord E'Probability
E'Probability -> E'Probability -> Bool
E'Probability -> E'Probability -> Ordering
E'Probability -> E'Probability -> E'Probability
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
$ccompare :: E'Probability -> E'Probability -> Ordering
compare :: E'Probability -> E'Probability -> Ordering
$c< :: E'Probability -> E'Probability -> Bool
< :: E'Probability -> E'Probability -> Bool
$c<= :: E'Probability -> E'Probability -> Bool
<= :: E'Probability -> E'Probability -> Bool
$c> :: E'Probability -> E'Probability -> Bool
> :: E'Probability -> E'Probability -> Bool
$c>= :: E'Probability -> E'Probability -> Bool
>= :: E'Probability -> E'Probability -> Bool
$cmax :: E'Probability -> E'Probability -> E'Probability
max :: E'Probability -> E'Probability -> E'Probability
$cmin :: E'Probability -> E'Probability -> E'Probability
min :: E'Probability -> E'Probability -> E'Probability
P.Ord, E'Probability
E'Probability -> E'Probability -> Bounded E'Probability
forall a. a -> a -> Bounded a
$cminBound :: E'Probability
minBound :: E'Probability
$cmaxBound :: E'Probability
maxBound :: E'Probability
P.Bounded, Int -> E'Probability
E'Probability -> Int
E'Probability -> [E'Probability]
E'Probability -> E'Probability
E'Probability -> E'Probability -> [E'Probability]
E'Probability -> E'Probability -> E'Probability -> [E'Probability]
(E'Probability -> E'Probability)
-> (E'Probability -> E'Probability)
-> (Int -> E'Probability)
-> (E'Probability -> Int)
-> (E'Probability -> [E'Probability])
-> (E'Probability -> E'Probability -> [E'Probability])
-> (E'Probability -> E'Probability -> [E'Probability])
-> (E'Probability
-> E'Probability -> E'Probability -> [E'Probability])
-> Enum E'Probability
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Probability -> E'Probability
succ :: E'Probability -> E'Probability
$cpred :: E'Probability -> E'Probability
pred :: E'Probability -> E'Probability
$ctoEnum :: Int -> E'Probability
toEnum :: Int -> E'Probability
$cfromEnum :: E'Probability -> Int
fromEnum :: E'Probability -> Int
$cenumFrom :: E'Probability -> [E'Probability]
enumFrom :: E'Probability -> [E'Probability]
$cenumFromThen :: E'Probability -> E'Probability -> [E'Probability]
enumFromThen :: E'Probability -> E'Probability -> [E'Probability]
$cenumFromTo :: E'Probability -> E'Probability -> [E'Probability]
enumFromTo :: E'Probability -> E'Probability -> [E'Probability]
$cenumFromThenTo :: E'Probability -> E'Probability -> E'Probability -> [E'Probability]
enumFromThenTo :: E'Probability -> E'Probability -> E'Probability -> [E'Probability]
P.Enum)
instance A.ToJSON E'Probability where toJSON :: E'Probability -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'Probability -> Text) -> E'Probability -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Probability -> Text
fromE'Probability
instance A.FromJSON E'Probability where parseJSON :: Value -> Parser E'Probability
parseJSON Value
o = ([Char] -> Parser E'Probability)
-> (E'Probability -> Parser E'Probability)
-> Either [Char] E'Probability
-> Parser E'Probability
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Probability
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Probability -> Parser E'Probability
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Probability -> Parser E'Probability)
-> (E'Probability -> E'Probability)
-> E'Probability
-> Parser E'Probability
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Probability -> E'Probability
forall a. a -> a
P.id) (Either [Char] E'Probability -> Parser E'Probability)
-> (Text -> Either [Char] E'Probability)
-> Text
-> Parser E'Probability
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Probability
toE'Probability (Text -> Parser E'Probability)
-> Parser Text -> Parser E'Probability
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Probability where toQueryParam :: E'Probability -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Probability -> Text) -> E'Probability -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Probability -> Text
fromE'Probability
instance WH.FromHttpApiData E'Probability where parseQueryParam :: Text -> Either Text E'Probability
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Probability) -> Either Text E'Probability
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'Probability -> Either Text E'Probability
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Probability -> Either Text E'Probability)
-> (Text -> Either [Char] E'Probability)
-> Text
-> Either Text E'Probability
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Probability
toE'Probability
instance MimeRender MimeMultipartFormData E'Probability where mimeRender :: Proxy MimeMultipartFormData -> E'Probability -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Probability -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Probability :: E'Probability -> Text
fromE'Probability :: E'Probability -> Text
fromE'Probability = \case
E'Probability
E'Probability'HARM_PROBABILITY_UNSPECIFIED -> Text
"HARM_PROBABILITY_UNSPECIFIED"
E'Probability
E'Probability'NEGLIGIBLE -> Text
"NEGLIGIBLE"
E'Probability
E'Probability'LOW -> Text
"LOW"
E'Probability
E'Probability'MEDIUM -> Text
"MEDIUM"
E'Probability
E'Probability'HIGH -> Text
"HIGH"
toE'Probability :: Text -> P.Either String E'Probability
toE'Probability :: Text -> Either [Char] E'Probability
toE'Probability = \case
Text
"HARM_PROBABILITY_UNSPECIFIED" -> E'Probability -> Either [Char] E'Probability
forall a b. b -> Either a b
P.Right E'Probability
E'Probability'HARM_PROBABILITY_UNSPECIFIED
Text
"NEGLIGIBLE" -> E'Probability -> Either [Char] E'Probability
forall a b. b -> Either a b
P.Right E'Probability
E'Probability'NEGLIGIBLE
Text
"LOW" -> E'Probability -> Either [Char] E'Probability
forall a b. b -> Either a b
P.Right E'Probability
E'Probability'LOW
Text
"MEDIUM" -> E'Probability -> Either [Char] E'Probability
forall a b. b -> Either a b
P.Right E'Probability
E'Probability'MEDIUM
Text
"HIGH" -> E'Probability -> Either [Char] E'Probability
forall a b. b -> Either a b
P.Right E'Probability
E'Probability'HIGH
Text
s -> [Char] -> Either [Char] E'Probability
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Probability)
-> [Char] -> Either [Char] E'Probability
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Probability: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Reason
=
E'Reason'BLOCKED_REASON_UNSPECIFIED
|
E'Reason'SAFETY
|
E'Reason'OTHER
deriving (Int -> E'Reason -> ShowS
[E'Reason] -> ShowS
E'Reason -> [Char]
(Int -> E'Reason -> ShowS)
-> (E'Reason -> [Char]) -> ([E'Reason] -> ShowS) -> Show E'Reason
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Reason -> ShowS
showsPrec :: Int -> E'Reason -> ShowS
$cshow :: E'Reason -> [Char]
show :: E'Reason -> [Char]
$cshowList :: [E'Reason] -> ShowS
showList :: [E'Reason] -> ShowS
P.Show, E'Reason -> E'Reason -> Bool
(E'Reason -> E'Reason -> Bool)
-> (E'Reason -> E'Reason -> Bool) -> Eq E'Reason
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Reason -> E'Reason -> Bool
== :: E'Reason -> E'Reason -> Bool
$c/= :: E'Reason -> E'Reason -> Bool
/= :: E'Reason -> E'Reason -> Bool
P.Eq, P.Typeable, Eq E'Reason
Eq E'Reason =>
(E'Reason -> E'Reason -> Ordering)
-> (E'Reason -> E'Reason -> Bool)
-> (E'Reason -> E'Reason -> Bool)
-> (E'Reason -> E'Reason -> Bool)
-> (E'Reason -> E'Reason -> Bool)
-> (E'Reason -> E'Reason -> E'Reason)
-> (E'Reason -> E'Reason -> E'Reason)
-> Ord E'Reason
E'Reason -> E'Reason -> Bool
E'Reason -> E'Reason -> Ordering
E'Reason -> E'Reason -> E'Reason
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
$ccompare :: E'Reason -> E'Reason -> Ordering
compare :: E'Reason -> E'Reason -> Ordering
$c< :: E'Reason -> E'Reason -> Bool
< :: E'Reason -> E'Reason -> Bool
$c<= :: E'Reason -> E'Reason -> Bool
<= :: E'Reason -> E'Reason -> Bool
$c> :: E'Reason -> E'Reason -> Bool
> :: E'Reason -> E'Reason -> Bool
$c>= :: E'Reason -> E'Reason -> Bool
>= :: E'Reason -> E'Reason -> Bool
$cmax :: E'Reason -> E'Reason -> E'Reason
max :: E'Reason -> E'Reason -> E'Reason
$cmin :: E'Reason -> E'Reason -> E'Reason
min :: E'Reason -> E'Reason -> E'Reason
P.Ord, E'Reason
E'Reason -> E'Reason -> Bounded E'Reason
forall a. a -> a -> Bounded a
$cminBound :: E'Reason
minBound :: E'Reason
$cmaxBound :: E'Reason
maxBound :: E'Reason
P.Bounded, Int -> E'Reason
E'Reason -> Int
E'Reason -> [E'Reason]
E'Reason -> E'Reason
E'Reason -> E'Reason -> [E'Reason]
E'Reason -> E'Reason -> E'Reason -> [E'Reason]
(E'Reason -> E'Reason)
-> (E'Reason -> E'Reason)
-> (Int -> E'Reason)
-> (E'Reason -> Int)
-> (E'Reason -> [E'Reason])
-> (E'Reason -> E'Reason -> [E'Reason])
-> (E'Reason -> E'Reason -> [E'Reason])
-> (E'Reason -> E'Reason -> E'Reason -> [E'Reason])
-> Enum E'Reason
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Reason -> E'Reason
succ :: E'Reason -> E'Reason
$cpred :: E'Reason -> E'Reason
pred :: E'Reason -> E'Reason
$ctoEnum :: Int -> E'Reason
toEnum :: Int -> E'Reason
$cfromEnum :: E'Reason -> Int
fromEnum :: E'Reason -> Int
$cenumFrom :: E'Reason -> [E'Reason]
enumFrom :: E'Reason -> [E'Reason]
$cenumFromThen :: E'Reason -> E'Reason -> [E'Reason]
enumFromThen :: E'Reason -> E'Reason -> [E'Reason]
$cenumFromTo :: E'Reason -> E'Reason -> [E'Reason]
enumFromTo :: E'Reason -> E'Reason -> [E'Reason]
$cenumFromThenTo :: E'Reason -> E'Reason -> E'Reason -> [E'Reason]
enumFromThenTo :: E'Reason -> E'Reason -> E'Reason -> [E'Reason]
P.Enum)
instance A.ToJSON E'Reason where toJSON :: E'Reason -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Reason -> Text) -> E'Reason -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Reason -> Text
fromE'Reason
instance A.FromJSON E'Reason where parseJSON :: Value -> Parser E'Reason
parseJSON Value
o = ([Char] -> Parser E'Reason)
-> (E'Reason -> Parser E'Reason)
-> Either [Char] E'Reason
-> Parser E'Reason
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Reason
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Reason -> Parser E'Reason
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Reason -> Parser E'Reason)
-> (E'Reason -> E'Reason) -> E'Reason -> Parser E'Reason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Reason -> E'Reason
forall a. a -> a
P.id) (Either [Char] E'Reason -> Parser E'Reason)
-> (Text -> Either [Char] E'Reason) -> Text -> Parser E'Reason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Reason
toE'Reason (Text -> Parser E'Reason) -> Parser Text -> Parser E'Reason
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Reason where toQueryParam :: E'Reason -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Reason -> Text) -> E'Reason -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Reason -> Text
fromE'Reason
instance WH.FromHttpApiData E'Reason where parseQueryParam :: Text -> Either Text E'Reason
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Reason) -> Either Text E'Reason
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'Reason -> Either Text E'Reason
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Reason -> Either Text E'Reason)
-> (Text -> Either [Char] E'Reason) -> Text -> Either Text E'Reason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Reason
toE'Reason
instance MimeRender MimeMultipartFormData E'Reason where mimeRender :: Proxy MimeMultipartFormData -> E'Reason -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Reason -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Reason :: E'Reason -> Text
fromE'Reason :: E'Reason -> Text
fromE'Reason = \case
E'Reason
E'Reason'BLOCKED_REASON_UNSPECIFIED -> Text
"BLOCKED_REASON_UNSPECIFIED"
E'Reason
E'Reason'SAFETY -> Text
"SAFETY"
E'Reason
E'Reason'OTHER -> Text
"OTHER"
toE'Reason :: Text -> P.Either String E'Reason
toE'Reason :: Text -> Either [Char] E'Reason
toE'Reason = \case
Text
"BLOCKED_REASON_UNSPECIFIED" -> E'Reason -> Either [Char] E'Reason
forall a b. b -> Either a b
P.Right E'Reason
E'Reason'BLOCKED_REASON_UNSPECIFIED
Text
"SAFETY" -> E'Reason -> Either [Char] E'Reason
forall a b. b -> Either a b
P.Right E'Reason
E'Reason'SAFETY
Text
"OTHER" -> E'Reason -> Either [Char] E'Reason
forall a b. b -> Either a b
P.Right E'Reason
E'Reason'OTHER
Text
s -> [Char] -> Either [Char] E'Reason
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Reason)
-> [Char] -> Either [Char] E'Reason
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Reason: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'ResponseModalities
=
E'ResponseModalities'MODALITY_UNSPECIFIED
|
E'ResponseModalities'TEXT
|
E'ResponseModalities'IMAGE
|
E'ResponseModalities'AUDIO
deriving (Int -> E'ResponseModalities -> ShowS
[E'ResponseModalities] -> ShowS
E'ResponseModalities -> [Char]
(Int -> E'ResponseModalities -> ShowS)
-> (E'ResponseModalities -> [Char])
-> ([E'ResponseModalities] -> ShowS)
-> Show E'ResponseModalities
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'ResponseModalities -> ShowS
showsPrec :: Int -> E'ResponseModalities -> ShowS
$cshow :: E'ResponseModalities -> [Char]
show :: E'ResponseModalities -> [Char]
$cshowList :: [E'ResponseModalities] -> ShowS
showList :: [E'ResponseModalities] -> ShowS
P.Show, E'ResponseModalities -> E'ResponseModalities -> Bool
(E'ResponseModalities -> E'ResponseModalities -> Bool)
-> (E'ResponseModalities -> E'ResponseModalities -> Bool)
-> Eq E'ResponseModalities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'ResponseModalities -> E'ResponseModalities -> Bool
== :: E'ResponseModalities -> E'ResponseModalities -> Bool
$c/= :: E'ResponseModalities -> E'ResponseModalities -> Bool
/= :: E'ResponseModalities -> E'ResponseModalities -> Bool
P.Eq, P.Typeable, Eq E'ResponseModalities
Eq E'ResponseModalities =>
(E'ResponseModalities -> E'ResponseModalities -> Ordering)
-> (E'ResponseModalities -> E'ResponseModalities -> Bool)
-> (E'ResponseModalities -> E'ResponseModalities -> Bool)
-> (E'ResponseModalities -> E'ResponseModalities -> Bool)
-> (E'ResponseModalities -> E'ResponseModalities -> Bool)
-> (E'ResponseModalities
-> E'ResponseModalities -> E'ResponseModalities)
-> (E'ResponseModalities
-> E'ResponseModalities -> E'ResponseModalities)
-> Ord E'ResponseModalities
E'ResponseModalities -> E'ResponseModalities -> Bool
E'ResponseModalities -> E'ResponseModalities -> Ordering
E'ResponseModalities
-> E'ResponseModalities -> E'ResponseModalities
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
$ccompare :: E'ResponseModalities -> E'ResponseModalities -> Ordering
compare :: E'ResponseModalities -> E'ResponseModalities -> Ordering
$c< :: E'ResponseModalities -> E'ResponseModalities -> Bool
< :: E'ResponseModalities -> E'ResponseModalities -> Bool
$c<= :: E'ResponseModalities -> E'ResponseModalities -> Bool
<= :: E'ResponseModalities -> E'ResponseModalities -> Bool
$c> :: E'ResponseModalities -> E'ResponseModalities -> Bool
> :: E'ResponseModalities -> E'ResponseModalities -> Bool
$c>= :: E'ResponseModalities -> E'ResponseModalities -> Bool
>= :: E'ResponseModalities -> E'ResponseModalities -> Bool
$cmax :: E'ResponseModalities
-> E'ResponseModalities -> E'ResponseModalities
max :: E'ResponseModalities
-> E'ResponseModalities -> E'ResponseModalities
$cmin :: E'ResponseModalities
-> E'ResponseModalities -> E'ResponseModalities
min :: E'ResponseModalities
-> E'ResponseModalities -> E'ResponseModalities
P.Ord, E'ResponseModalities
E'ResponseModalities
-> E'ResponseModalities -> Bounded E'ResponseModalities
forall a. a -> a -> Bounded a
$cminBound :: E'ResponseModalities
minBound :: E'ResponseModalities
$cmaxBound :: E'ResponseModalities
maxBound :: E'ResponseModalities
P.Bounded, Int -> E'ResponseModalities
E'ResponseModalities -> Int
E'ResponseModalities -> [E'ResponseModalities]
E'ResponseModalities -> E'ResponseModalities
E'ResponseModalities
-> E'ResponseModalities -> [E'ResponseModalities]
E'ResponseModalities
-> E'ResponseModalities
-> E'ResponseModalities
-> [E'ResponseModalities]
(E'ResponseModalities -> E'ResponseModalities)
-> (E'ResponseModalities -> E'ResponseModalities)
-> (Int -> E'ResponseModalities)
-> (E'ResponseModalities -> Int)
-> (E'ResponseModalities -> [E'ResponseModalities])
-> (E'ResponseModalities
-> E'ResponseModalities -> [E'ResponseModalities])
-> (E'ResponseModalities
-> E'ResponseModalities -> [E'ResponseModalities])
-> (E'ResponseModalities
-> E'ResponseModalities
-> E'ResponseModalities
-> [E'ResponseModalities])
-> Enum E'ResponseModalities
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'ResponseModalities -> E'ResponseModalities
succ :: E'ResponseModalities -> E'ResponseModalities
$cpred :: E'ResponseModalities -> E'ResponseModalities
pred :: E'ResponseModalities -> E'ResponseModalities
$ctoEnum :: Int -> E'ResponseModalities
toEnum :: Int -> E'ResponseModalities
$cfromEnum :: E'ResponseModalities -> Int
fromEnum :: E'ResponseModalities -> Int
$cenumFrom :: E'ResponseModalities -> [E'ResponseModalities]
enumFrom :: E'ResponseModalities -> [E'ResponseModalities]
$cenumFromThen :: E'ResponseModalities
-> E'ResponseModalities -> [E'ResponseModalities]
enumFromThen :: E'ResponseModalities
-> E'ResponseModalities -> [E'ResponseModalities]
$cenumFromTo :: E'ResponseModalities
-> E'ResponseModalities -> [E'ResponseModalities]
enumFromTo :: E'ResponseModalities
-> E'ResponseModalities -> [E'ResponseModalities]
$cenumFromThenTo :: E'ResponseModalities
-> E'ResponseModalities
-> E'ResponseModalities
-> [E'ResponseModalities]
enumFromThenTo :: E'ResponseModalities
-> E'ResponseModalities
-> E'ResponseModalities
-> [E'ResponseModalities]
P.Enum)
instance A.ToJSON E'ResponseModalities where toJSON :: E'ResponseModalities -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'ResponseModalities -> Text) -> E'ResponseModalities -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'ResponseModalities -> Text
fromE'ResponseModalities
instance A.FromJSON E'ResponseModalities where parseJSON :: Value -> Parser E'ResponseModalities
parseJSON Value
o = ([Char] -> Parser E'ResponseModalities)
-> (E'ResponseModalities -> Parser E'ResponseModalities)
-> Either [Char] E'ResponseModalities
-> Parser E'ResponseModalities
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'ResponseModalities
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'ResponseModalities -> Parser E'ResponseModalities
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'ResponseModalities -> Parser E'ResponseModalities)
-> (E'ResponseModalities -> E'ResponseModalities)
-> E'ResponseModalities
-> Parser E'ResponseModalities
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'ResponseModalities -> E'ResponseModalities
forall a. a -> a
P.id) (Either [Char] E'ResponseModalities -> Parser E'ResponseModalities)
-> (Text -> Either [Char] E'ResponseModalities)
-> Text
-> Parser E'ResponseModalities
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'ResponseModalities
toE'ResponseModalities (Text -> Parser E'ResponseModalities)
-> Parser Text -> Parser E'ResponseModalities
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'ResponseModalities where toQueryParam :: E'ResponseModalities -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text)
-> (E'ResponseModalities -> Text) -> E'ResponseModalities -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'ResponseModalities -> Text
fromE'ResponseModalities
instance WH.FromHttpApiData E'ResponseModalities where parseQueryParam :: Text -> Either Text E'ResponseModalities
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'ResponseModalities)
-> Either Text E'ResponseModalities
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'ResponseModalities
-> Either Text E'ResponseModalities
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'ResponseModalities
-> Either Text E'ResponseModalities)
-> (Text -> Either [Char] E'ResponseModalities)
-> Text
-> Either Text E'ResponseModalities
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'ResponseModalities
toE'ResponseModalities
instance MimeRender MimeMultipartFormData E'ResponseModalities where mimeRender :: Proxy MimeMultipartFormData -> E'ResponseModalities -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'ResponseModalities -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'ResponseModalities :: E'ResponseModalities -> Text
fromE'ResponseModalities :: E'ResponseModalities -> Text
fromE'ResponseModalities = \case
E'ResponseModalities
E'ResponseModalities'MODALITY_UNSPECIFIED -> Text
"MODALITY_UNSPECIFIED"
E'ResponseModalities
E'ResponseModalities'TEXT -> Text
"TEXT"
E'ResponseModalities
E'ResponseModalities'IMAGE -> Text
"IMAGE"
E'ResponseModalities
E'ResponseModalities'AUDIO -> Text
"AUDIO"
toE'ResponseModalities :: Text -> P.Either String E'ResponseModalities
toE'ResponseModalities :: Text -> Either [Char] E'ResponseModalities
toE'ResponseModalities = \case
Text
"MODALITY_UNSPECIFIED" -> E'ResponseModalities -> Either [Char] E'ResponseModalities
forall a b. b -> Either a b
P.Right E'ResponseModalities
E'ResponseModalities'MODALITY_UNSPECIFIED
Text
"TEXT" -> E'ResponseModalities -> Either [Char] E'ResponseModalities
forall a b. b -> Either a b
P.Right E'ResponseModalities
E'ResponseModalities'TEXT
Text
"IMAGE" -> E'ResponseModalities -> Either [Char] E'ResponseModalities
forall a b. b -> Either a b
P.Right E'ResponseModalities
E'ResponseModalities'IMAGE
Text
"AUDIO" -> E'ResponseModalities -> Either [Char] E'ResponseModalities
forall a b. b -> Either a b
P.Right E'ResponseModalities
E'ResponseModalities'AUDIO
Text
s -> [Char] -> Either [Char] E'ResponseModalities
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'ResponseModalities)
-> [Char] -> Either [Char] E'ResponseModalities
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'ResponseModalities: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Role
=
E'Role'ROLE_UNSPECIFIED
|
E'Role'OWNER
|
E'Role'WRITER
|
E'Role'READER
deriving (Int -> E'Role -> ShowS
[E'Role] -> ShowS
E'Role -> [Char]
(Int -> E'Role -> ShowS)
-> (E'Role -> [Char]) -> ([E'Role] -> ShowS) -> Show E'Role
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Role -> ShowS
showsPrec :: Int -> E'Role -> ShowS
$cshow :: E'Role -> [Char]
show :: E'Role -> [Char]
$cshowList :: [E'Role] -> ShowS
showList :: [E'Role] -> ShowS
P.Show, E'Role -> E'Role -> Bool
(E'Role -> E'Role -> Bool)
-> (E'Role -> E'Role -> Bool) -> Eq E'Role
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Role -> E'Role -> Bool
== :: E'Role -> E'Role -> Bool
$c/= :: E'Role -> E'Role -> Bool
/= :: E'Role -> E'Role -> Bool
P.Eq, P.Typeable, Eq E'Role
Eq E'Role =>
(E'Role -> E'Role -> Ordering)
-> (E'Role -> E'Role -> Bool)
-> (E'Role -> E'Role -> Bool)
-> (E'Role -> E'Role -> Bool)
-> (E'Role -> E'Role -> Bool)
-> (E'Role -> E'Role -> E'Role)
-> (E'Role -> E'Role -> E'Role)
-> Ord E'Role
E'Role -> E'Role -> Bool
E'Role -> E'Role -> Ordering
E'Role -> E'Role -> E'Role
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
$ccompare :: E'Role -> E'Role -> Ordering
compare :: E'Role -> E'Role -> Ordering
$c< :: E'Role -> E'Role -> Bool
< :: E'Role -> E'Role -> Bool
$c<= :: E'Role -> E'Role -> Bool
<= :: E'Role -> E'Role -> Bool
$c> :: E'Role -> E'Role -> Bool
> :: E'Role -> E'Role -> Bool
$c>= :: E'Role -> E'Role -> Bool
>= :: E'Role -> E'Role -> Bool
$cmax :: E'Role -> E'Role -> E'Role
max :: E'Role -> E'Role -> E'Role
$cmin :: E'Role -> E'Role -> E'Role
min :: E'Role -> E'Role -> E'Role
P.Ord, E'Role
E'Role -> E'Role -> Bounded E'Role
forall a. a -> a -> Bounded a
$cminBound :: E'Role
minBound :: E'Role
$cmaxBound :: E'Role
maxBound :: E'Role
P.Bounded, Int -> E'Role
E'Role -> Int
E'Role -> [E'Role]
E'Role -> E'Role
E'Role -> E'Role -> [E'Role]
E'Role -> E'Role -> E'Role -> [E'Role]
(E'Role -> E'Role)
-> (E'Role -> E'Role)
-> (Int -> E'Role)
-> (E'Role -> Int)
-> (E'Role -> [E'Role])
-> (E'Role -> E'Role -> [E'Role])
-> (E'Role -> E'Role -> [E'Role])
-> (E'Role -> E'Role -> E'Role -> [E'Role])
-> Enum E'Role
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Role -> E'Role
succ :: E'Role -> E'Role
$cpred :: E'Role -> E'Role
pred :: E'Role -> E'Role
$ctoEnum :: Int -> E'Role
toEnum :: Int -> E'Role
$cfromEnum :: E'Role -> Int
fromEnum :: E'Role -> Int
$cenumFrom :: E'Role -> [E'Role]
enumFrom :: E'Role -> [E'Role]
$cenumFromThen :: E'Role -> E'Role -> [E'Role]
enumFromThen :: E'Role -> E'Role -> [E'Role]
$cenumFromTo :: E'Role -> E'Role -> [E'Role]
enumFromTo :: E'Role -> E'Role -> [E'Role]
$cenumFromThenTo :: E'Role -> E'Role -> E'Role -> [E'Role]
enumFromThenTo :: E'Role -> E'Role -> E'Role -> [E'Role]
P.Enum)
instance A.ToJSON E'Role where toJSON :: E'Role -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Role -> Text) -> E'Role -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Role -> Text
fromE'Role
instance A.FromJSON E'Role where parseJSON :: Value -> Parser E'Role
parseJSON Value
o = ([Char] -> Parser E'Role)
-> (E'Role -> Parser E'Role)
-> Either [Char] E'Role
-> Parser E'Role
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Role
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Role -> Parser E'Role
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Role -> Parser E'Role)
-> (E'Role -> E'Role) -> E'Role -> Parser E'Role
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Role -> E'Role
forall a. a -> a
P.id) (Either [Char] E'Role -> Parser E'Role)
-> (Text -> Either [Char] E'Role) -> Text -> Parser E'Role
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Role
toE'Role (Text -> Parser E'Role) -> Parser Text -> Parser E'Role
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Role where toQueryParam :: E'Role -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Role -> Text) -> E'Role -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Role -> Text
fromE'Role
instance WH.FromHttpApiData E'Role where parseQueryParam :: Text -> Either Text E'Role
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Role) -> Either Text E'Role
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'Role -> Either Text E'Role
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Role -> Either Text E'Role)
-> (Text -> Either [Char] E'Role) -> Text -> Either Text E'Role
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Role
toE'Role
instance MimeRender MimeMultipartFormData E'Role where mimeRender :: Proxy MimeMultipartFormData -> E'Role -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Role -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Role :: E'Role -> Text
fromE'Role :: E'Role -> Text
fromE'Role = \case
E'Role
E'Role'ROLE_UNSPECIFIED -> Text
"ROLE_UNSPECIFIED"
E'Role
E'Role'OWNER -> Text
"OWNER"
E'Role
E'Role'WRITER -> Text
"WRITER"
E'Role
E'Role'READER -> Text
"READER"
toE'Role :: Text -> P.Either String E'Role
toE'Role :: Text -> Either [Char] E'Role
toE'Role = \case
Text
"ROLE_UNSPECIFIED" -> E'Role -> Either [Char] E'Role
forall a b. b -> Either a b
P.Right E'Role
E'Role'ROLE_UNSPECIFIED
Text
"OWNER" -> E'Role -> Either [Char] E'Role
forall a b. b -> Either a b
P.Right E'Role
E'Role'OWNER
Text
"WRITER" -> E'Role -> Either [Char] E'Role
forall a b. b -> Either a b
P.Right E'Role
E'Role'WRITER
Text
"READER" -> E'Role -> Either [Char] E'Role
forall a b. b -> Either a b
P.Right E'Role
E'Role'READER
Text
s -> [Char] -> Either [Char] E'Role
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Role) -> [Char] -> Either [Char] E'Role
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Role: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Scheduling
=
E'Scheduling'SCHEDULING_UNSPECIFIED
|
E'Scheduling'SILENT
|
E'Scheduling'WHEN_IDLE
|
E'Scheduling'INTERRUPT
deriving (Int -> E'Scheduling -> ShowS
[E'Scheduling] -> ShowS
E'Scheduling -> [Char]
(Int -> E'Scheduling -> ShowS)
-> (E'Scheduling -> [Char])
-> ([E'Scheduling] -> ShowS)
-> Show E'Scheduling
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Scheduling -> ShowS
showsPrec :: Int -> E'Scheduling -> ShowS
$cshow :: E'Scheduling -> [Char]
show :: E'Scheduling -> [Char]
$cshowList :: [E'Scheduling] -> ShowS
showList :: [E'Scheduling] -> ShowS
P.Show, E'Scheduling -> E'Scheduling -> Bool
(E'Scheduling -> E'Scheduling -> Bool)
-> (E'Scheduling -> E'Scheduling -> Bool) -> Eq E'Scheduling
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Scheduling -> E'Scheduling -> Bool
== :: E'Scheduling -> E'Scheduling -> Bool
$c/= :: E'Scheduling -> E'Scheduling -> Bool
/= :: E'Scheduling -> E'Scheduling -> Bool
P.Eq, P.Typeable, Eq E'Scheduling
Eq E'Scheduling =>
(E'Scheduling -> E'Scheduling -> Ordering)
-> (E'Scheduling -> E'Scheduling -> Bool)
-> (E'Scheduling -> E'Scheduling -> Bool)
-> (E'Scheduling -> E'Scheduling -> Bool)
-> (E'Scheduling -> E'Scheduling -> Bool)
-> (E'Scheduling -> E'Scheduling -> E'Scheduling)
-> (E'Scheduling -> E'Scheduling -> E'Scheduling)
-> Ord E'Scheduling
E'Scheduling -> E'Scheduling -> Bool
E'Scheduling -> E'Scheduling -> Ordering
E'Scheduling -> E'Scheduling -> E'Scheduling
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
$ccompare :: E'Scheduling -> E'Scheduling -> Ordering
compare :: E'Scheduling -> E'Scheduling -> Ordering
$c< :: E'Scheduling -> E'Scheduling -> Bool
< :: E'Scheduling -> E'Scheduling -> Bool
$c<= :: E'Scheduling -> E'Scheduling -> Bool
<= :: E'Scheduling -> E'Scheduling -> Bool
$c> :: E'Scheduling -> E'Scheduling -> Bool
> :: E'Scheduling -> E'Scheduling -> Bool
$c>= :: E'Scheduling -> E'Scheduling -> Bool
>= :: E'Scheduling -> E'Scheduling -> Bool
$cmax :: E'Scheduling -> E'Scheduling -> E'Scheduling
max :: E'Scheduling -> E'Scheduling -> E'Scheduling
$cmin :: E'Scheduling -> E'Scheduling -> E'Scheduling
min :: E'Scheduling -> E'Scheduling -> E'Scheduling
P.Ord, E'Scheduling
E'Scheduling -> E'Scheduling -> Bounded E'Scheduling
forall a. a -> a -> Bounded a
$cminBound :: E'Scheduling
minBound :: E'Scheduling
$cmaxBound :: E'Scheduling
maxBound :: E'Scheduling
P.Bounded, Int -> E'Scheduling
E'Scheduling -> Int
E'Scheduling -> [E'Scheduling]
E'Scheduling -> E'Scheduling
E'Scheduling -> E'Scheduling -> [E'Scheduling]
E'Scheduling -> E'Scheduling -> E'Scheduling -> [E'Scheduling]
(E'Scheduling -> E'Scheduling)
-> (E'Scheduling -> E'Scheduling)
-> (Int -> E'Scheduling)
-> (E'Scheduling -> Int)
-> (E'Scheduling -> [E'Scheduling])
-> (E'Scheduling -> E'Scheduling -> [E'Scheduling])
-> (E'Scheduling -> E'Scheduling -> [E'Scheduling])
-> (E'Scheduling -> E'Scheduling -> E'Scheduling -> [E'Scheduling])
-> Enum E'Scheduling
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Scheduling -> E'Scheduling
succ :: E'Scheduling -> E'Scheduling
$cpred :: E'Scheduling -> E'Scheduling
pred :: E'Scheduling -> E'Scheduling
$ctoEnum :: Int -> E'Scheduling
toEnum :: Int -> E'Scheduling
$cfromEnum :: E'Scheduling -> Int
fromEnum :: E'Scheduling -> Int
$cenumFrom :: E'Scheduling -> [E'Scheduling]
enumFrom :: E'Scheduling -> [E'Scheduling]
$cenumFromThen :: E'Scheduling -> E'Scheduling -> [E'Scheduling]
enumFromThen :: E'Scheduling -> E'Scheduling -> [E'Scheduling]
$cenumFromTo :: E'Scheduling -> E'Scheduling -> [E'Scheduling]
enumFromTo :: E'Scheduling -> E'Scheduling -> [E'Scheduling]
$cenumFromThenTo :: E'Scheduling -> E'Scheduling -> E'Scheduling -> [E'Scheduling]
enumFromThenTo :: E'Scheduling -> E'Scheduling -> E'Scheduling -> [E'Scheduling]
P.Enum)
instance A.ToJSON E'Scheduling where toJSON :: E'Scheduling -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Scheduling -> Text) -> E'Scheduling -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Scheduling -> Text
fromE'Scheduling
instance A.FromJSON E'Scheduling where parseJSON :: Value -> Parser E'Scheduling
parseJSON Value
o = ([Char] -> Parser E'Scheduling)
-> (E'Scheduling -> Parser E'Scheduling)
-> Either [Char] E'Scheduling
-> Parser E'Scheduling
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Scheduling
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Scheduling -> Parser E'Scheduling
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Scheduling -> Parser E'Scheduling)
-> (E'Scheduling -> E'Scheduling)
-> E'Scheduling
-> Parser E'Scheduling
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Scheduling -> E'Scheduling
forall a. a -> a
P.id) (Either [Char] E'Scheduling -> Parser E'Scheduling)
-> (Text -> Either [Char] E'Scheduling)
-> Text
-> Parser E'Scheduling
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Scheduling
toE'Scheduling (Text -> Parser E'Scheduling) -> Parser Text -> Parser E'Scheduling
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Scheduling where toQueryParam :: E'Scheduling -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Scheduling -> Text) -> E'Scheduling -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Scheduling -> Text
fromE'Scheduling
instance WH.FromHttpApiData E'Scheduling where parseQueryParam :: Text -> Either Text E'Scheduling
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Scheduling) -> Either Text E'Scheduling
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'Scheduling -> Either Text E'Scheduling
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Scheduling -> Either Text E'Scheduling)
-> (Text -> Either [Char] E'Scheduling)
-> Text
-> Either Text E'Scheduling
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Scheduling
toE'Scheduling
instance MimeRender MimeMultipartFormData E'Scheduling where mimeRender :: Proxy MimeMultipartFormData -> E'Scheduling -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Scheduling -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Scheduling :: E'Scheduling -> Text
fromE'Scheduling :: E'Scheduling -> Text
fromE'Scheduling = \case
E'Scheduling
E'Scheduling'SCHEDULING_UNSPECIFIED -> Text
"SCHEDULING_UNSPECIFIED"
E'Scheduling
E'Scheduling'SILENT -> Text
"SILENT"
E'Scheduling
E'Scheduling'WHEN_IDLE -> Text
"WHEN_IDLE"
E'Scheduling
E'Scheduling'INTERRUPT -> Text
"INTERRUPT"
toE'Scheduling :: Text -> P.Either String E'Scheduling
toE'Scheduling :: Text -> Either [Char] E'Scheduling
toE'Scheduling = \case
Text
"SCHEDULING_UNSPECIFIED" -> E'Scheduling -> Either [Char] E'Scheduling
forall a b. b -> Either a b
P.Right E'Scheduling
E'Scheduling'SCHEDULING_UNSPECIFIED
Text
"SILENT" -> E'Scheduling -> Either [Char] E'Scheduling
forall a b. b -> Either a b
P.Right E'Scheduling
E'Scheduling'SILENT
Text
"WHEN_IDLE" -> E'Scheduling -> Either [Char] E'Scheduling
forall a b. b -> Either a b
P.Right E'Scheduling
E'Scheduling'WHEN_IDLE
Text
"INTERRUPT" -> E'Scheduling -> Either [Char] E'Scheduling
forall a b. b -> Either a b
P.Right E'Scheduling
E'Scheduling'INTERRUPT
Text
s -> [Char] -> Either [Char] E'Scheduling
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Scheduling)
-> [Char] -> Either [Char] E'Scheduling
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Scheduling: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Source
=
E'Source'SOURCE_UNSPECIFIED
|
E'Source'UPLOADED
|
E'Source'GENERATED
deriving (Int -> E'Source -> ShowS
[E'Source] -> ShowS
E'Source -> [Char]
(Int -> E'Source -> ShowS)
-> (E'Source -> [Char]) -> ([E'Source] -> ShowS) -> Show E'Source
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Source -> ShowS
showsPrec :: Int -> E'Source -> ShowS
$cshow :: E'Source -> [Char]
show :: E'Source -> [Char]
$cshowList :: [E'Source] -> ShowS
showList :: [E'Source] -> ShowS
P.Show, E'Source -> E'Source -> Bool
(E'Source -> E'Source -> Bool)
-> (E'Source -> E'Source -> Bool) -> Eq E'Source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Source -> E'Source -> Bool
== :: E'Source -> E'Source -> Bool
$c/= :: E'Source -> E'Source -> Bool
/= :: E'Source -> E'Source -> Bool
P.Eq, P.Typeable, Eq E'Source
Eq E'Source =>
(E'Source -> E'Source -> Ordering)
-> (E'Source -> E'Source -> Bool)
-> (E'Source -> E'Source -> Bool)
-> (E'Source -> E'Source -> Bool)
-> (E'Source -> E'Source -> Bool)
-> (E'Source -> E'Source -> E'Source)
-> (E'Source -> E'Source -> E'Source)
-> Ord E'Source
E'Source -> E'Source -> Bool
E'Source -> E'Source -> Ordering
E'Source -> E'Source -> E'Source
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
$ccompare :: E'Source -> E'Source -> Ordering
compare :: E'Source -> E'Source -> Ordering
$c< :: E'Source -> E'Source -> Bool
< :: E'Source -> E'Source -> Bool
$c<= :: E'Source -> E'Source -> Bool
<= :: E'Source -> E'Source -> Bool
$c> :: E'Source -> E'Source -> Bool
> :: E'Source -> E'Source -> Bool
$c>= :: E'Source -> E'Source -> Bool
>= :: E'Source -> E'Source -> Bool
$cmax :: E'Source -> E'Source -> E'Source
max :: E'Source -> E'Source -> E'Source
$cmin :: E'Source -> E'Source -> E'Source
min :: E'Source -> E'Source -> E'Source
P.Ord, E'Source
E'Source -> E'Source -> Bounded E'Source
forall a. a -> a -> Bounded a
$cminBound :: E'Source
minBound :: E'Source
$cmaxBound :: E'Source
maxBound :: E'Source
P.Bounded, Int -> E'Source
E'Source -> Int
E'Source -> [E'Source]
E'Source -> E'Source
E'Source -> E'Source -> [E'Source]
E'Source -> E'Source -> E'Source -> [E'Source]
(E'Source -> E'Source)
-> (E'Source -> E'Source)
-> (Int -> E'Source)
-> (E'Source -> Int)
-> (E'Source -> [E'Source])
-> (E'Source -> E'Source -> [E'Source])
-> (E'Source -> E'Source -> [E'Source])
-> (E'Source -> E'Source -> E'Source -> [E'Source])
-> Enum E'Source
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Source -> E'Source
succ :: E'Source -> E'Source
$cpred :: E'Source -> E'Source
pred :: E'Source -> E'Source
$ctoEnum :: Int -> E'Source
toEnum :: Int -> E'Source
$cfromEnum :: E'Source -> Int
fromEnum :: E'Source -> Int
$cenumFrom :: E'Source -> [E'Source]
enumFrom :: E'Source -> [E'Source]
$cenumFromThen :: E'Source -> E'Source -> [E'Source]
enumFromThen :: E'Source -> E'Source -> [E'Source]
$cenumFromTo :: E'Source -> E'Source -> [E'Source]
enumFromTo :: E'Source -> E'Source -> [E'Source]
$cenumFromThenTo :: E'Source -> E'Source -> E'Source -> [E'Source]
enumFromThenTo :: E'Source -> E'Source -> E'Source -> [E'Source]
P.Enum)
instance A.ToJSON E'Source where toJSON :: E'Source -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Source -> Text) -> E'Source -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Source -> Text
fromE'Source
instance A.FromJSON E'Source where parseJSON :: Value -> Parser E'Source
parseJSON Value
o = ([Char] -> Parser E'Source)
-> (E'Source -> Parser E'Source)
-> Either [Char] E'Source
-> Parser E'Source
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Source
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Source -> Parser E'Source
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Source -> Parser E'Source)
-> (E'Source -> E'Source) -> E'Source -> Parser E'Source
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Source -> E'Source
forall a. a -> a
P.id) (Either [Char] E'Source -> Parser E'Source)
-> (Text -> Either [Char] E'Source) -> Text -> Parser E'Source
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Source
toE'Source (Text -> Parser E'Source) -> Parser Text -> Parser E'Source
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Source where toQueryParam :: E'Source -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Source -> Text) -> E'Source -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Source -> Text
fromE'Source
instance WH.FromHttpApiData E'Source where parseQueryParam :: Text -> Either Text E'Source
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Source) -> Either Text E'Source
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'Source -> Either Text E'Source
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Source -> Either Text E'Source)
-> (Text -> Either [Char] E'Source) -> Text -> Either Text E'Source
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Source
toE'Source
instance MimeRender MimeMultipartFormData E'Source where mimeRender :: Proxy MimeMultipartFormData -> E'Source -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Source -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Source :: E'Source -> Text
fromE'Source :: E'Source -> Text
fromE'Source = \case
E'Source
E'Source'SOURCE_UNSPECIFIED -> Text
"SOURCE_UNSPECIFIED"
E'Source
E'Source'UPLOADED -> Text
"UPLOADED"
E'Source
E'Source'GENERATED -> Text
"GENERATED"
toE'Source :: Text -> P.Either String E'Source
toE'Source :: Text -> Either [Char] E'Source
toE'Source = \case
Text
"SOURCE_UNSPECIFIED" -> E'Source -> Either [Char] E'Source
forall a b. b -> Either a b
P.Right E'Source
E'Source'SOURCE_UNSPECIFIED
Text
"UPLOADED" -> E'Source -> Either [Char] E'Source
forall a b. b -> Either a b
P.Right E'Source
E'Source'UPLOADED
Text
"GENERATED" -> E'Source -> Either [Char] E'Source
forall a b. b -> Either a b
P.Right E'Source
E'Source'GENERATED
Text
s -> [Char] -> Either [Char] E'Source
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Source)
-> [Char] -> Either [Char] E'Source
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Source: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'State
=
E'State'STATE_UNSPECIFIED
|
E'State'PROCESSING
|
E'State'ACTIVE
|
E'State'FAILED
deriving (Int -> E'State -> ShowS
[E'State] -> ShowS
E'State -> [Char]
(Int -> E'State -> ShowS)
-> (E'State -> [Char]) -> ([E'State] -> ShowS) -> Show E'State
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'State -> ShowS
showsPrec :: Int -> E'State -> ShowS
$cshow :: E'State -> [Char]
show :: E'State -> [Char]
$cshowList :: [E'State] -> ShowS
showList :: [E'State] -> ShowS
P.Show, E'State -> E'State -> Bool
(E'State -> E'State -> Bool)
-> (E'State -> E'State -> Bool) -> Eq E'State
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'State -> E'State -> Bool
== :: E'State -> E'State -> Bool
$c/= :: E'State -> E'State -> Bool
/= :: E'State -> E'State -> Bool
P.Eq, P.Typeable, Eq E'State
Eq E'State =>
(E'State -> E'State -> Ordering)
-> (E'State -> E'State -> Bool)
-> (E'State -> E'State -> Bool)
-> (E'State -> E'State -> Bool)
-> (E'State -> E'State -> Bool)
-> (E'State -> E'State -> E'State)
-> (E'State -> E'State -> E'State)
-> Ord E'State
E'State -> E'State -> Bool
E'State -> E'State -> Ordering
E'State -> E'State -> E'State
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
$ccompare :: E'State -> E'State -> Ordering
compare :: E'State -> E'State -> Ordering
$c< :: E'State -> E'State -> Bool
< :: E'State -> E'State -> Bool
$c<= :: E'State -> E'State -> Bool
<= :: E'State -> E'State -> Bool
$c> :: E'State -> E'State -> Bool
> :: E'State -> E'State -> Bool
$c>= :: E'State -> E'State -> Bool
>= :: E'State -> E'State -> Bool
$cmax :: E'State -> E'State -> E'State
max :: E'State -> E'State -> E'State
$cmin :: E'State -> E'State -> E'State
min :: E'State -> E'State -> E'State
P.Ord, E'State
E'State -> E'State -> Bounded E'State
forall a. a -> a -> Bounded a
$cminBound :: E'State
minBound :: E'State
$cmaxBound :: E'State
maxBound :: E'State
P.Bounded, Int -> E'State
E'State -> Int
E'State -> [E'State]
E'State -> E'State
E'State -> E'State -> [E'State]
E'State -> E'State -> E'State -> [E'State]
(E'State -> E'State)
-> (E'State -> E'State)
-> (Int -> E'State)
-> (E'State -> Int)
-> (E'State -> [E'State])
-> (E'State -> E'State -> [E'State])
-> (E'State -> E'State -> [E'State])
-> (E'State -> E'State -> E'State -> [E'State])
-> Enum E'State
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'State -> E'State
succ :: E'State -> E'State
$cpred :: E'State -> E'State
pred :: E'State -> E'State
$ctoEnum :: Int -> E'State
toEnum :: Int -> E'State
$cfromEnum :: E'State -> Int
fromEnum :: E'State -> Int
$cenumFrom :: E'State -> [E'State]
enumFrom :: E'State -> [E'State]
$cenumFromThen :: E'State -> E'State -> [E'State]
enumFromThen :: E'State -> E'State -> [E'State]
$cenumFromTo :: E'State -> E'State -> [E'State]
enumFromTo :: E'State -> E'State -> [E'State]
$cenumFromThenTo :: E'State -> E'State -> E'State -> [E'State]
enumFromThenTo :: E'State -> E'State -> E'State -> [E'State]
P.Enum)
instance A.ToJSON E'State where toJSON :: E'State -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'State -> Text) -> E'State -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State -> Text
fromE'State
instance A.FromJSON E'State where parseJSON :: Value -> Parser E'State
parseJSON Value
o = ([Char] -> Parser E'State)
-> (E'State -> Parser E'State)
-> Either [Char] E'State
-> Parser E'State
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'State
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'State -> Parser E'State
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'State -> Parser E'State)
-> (E'State -> E'State) -> E'State -> Parser E'State
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State -> E'State
forall a. a -> a
P.id) (Either [Char] E'State -> Parser E'State)
-> (Text -> Either [Char] E'State) -> Text -> Parser E'State
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State
toE'State (Text -> Parser E'State) -> Parser Text -> Parser E'State
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'State where toQueryParam :: E'State -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'State -> Text) -> E'State -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State -> Text
fromE'State
instance WH.FromHttpApiData E'State where parseQueryParam :: Text -> Either Text E'State
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'State) -> Either Text E'State
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'State -> Either Text E'State
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'State -> Either Text E'State)
-> (Text -> Either [Char] E'State) -> Text -> Either Text E'State
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State
toE'State
instance MimeRender MimeMultipartFormData E'State where mimeRender :: Proxy MimeMultipartFormData -> E'State -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'State -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'State :: E'State -> Text
fromE'State :: E'State -> Text
fromE'State = \case
E'State
E'State'STATE_UNSPECIFIED -> Text
"STATE_UNSPECIFIED"
E'State
E'State'PROCESSING -> Text
"PROCESSING"
E'State
E'State'ACTIVE -> Text
"ACTIVE"
E'State
E'State'FAILED -> Text
"FAILED"
toE'State :: Text -> P.Either String E'State
toE'State :: Text -> Either [Char] E'State
toE'State = \case
Text
"STATE_UNSPECIFIED" -> E'State -> Either [Char] E'State
forall a b. b -> Either a b
P.Right E'State
E'State'STATE_UNSPECIFIED
Text
"PROCESSING" -> E'State -> Either [Char] E'State
forall a b. b -> Either a b
P.Right E'State
E'State'PROCESSING
Text
"ACTIVE" -> E'State -> Either [Char] E'State
forall a b. b -> Either a b
P.Right E'State
E'State'ACTIVE
Text
"FAILED" -> E'State -> Either [Char] E'State
forall a b. b -> Either a b
P.Right E'State
E'State'FAILED
Text
s -> [Char] -> Either [Char] E'State
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'State)
-> [Char] -> Either [Char] E'State
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'State: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'State2
=
E'State2'STATE_UNSPECIFIED
|
E'State2'GENERATING
|
E'State2'GENERATED
|
E'State2'FAILED
deriving (Int -> E'State2 -> ShowS
[E'State2] -> ShowS
E'State2 -> [Char]
(Int -> E'State2 -> ShowS)
-> (E'State2 -> [Char]) -> ([E'State2] -> ShowS) -> Show E'State2
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'State2 -> ShowS
showsPrec :: Int -> E'State2 -> ShowS
$cshow :: E'State2 -> [Char]
show :: E'State2 -> [Char]
$cshowList :: [E'State2] -> ShowS
showList :: [E'State2] -> ShowS
P.Show, E'State2 -> E'State2 -> Bool
(E'State2 -> E'State2 -> Bool)
-> (E'State2 -> E'State2 -> Bool) -> Eq E'State2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'State2 -> E'State2 -> Bool
== :: E'State2 -> E'State2 -> Bool
$c/= :: E'State2 -> E'State2 -> Bool
/= :: E'State2 -> E'State2 -> Bool
P.Eq, P.Typeable, Eq E'State2
Eq E'State2 =>
(E'State2 -> E'State2 -> Ordering)
-> (E'State2 -> E'State2 -> Bool)
-> (E'State2 -> E'State2 -> Bool)
-> (E'State2 -> E'State2 -> Bool)
-> (E'State2 -> E'State2 -> Bool)
-> (E'State2 -> E'State2 -> E'State2)
-> (E'State2 -> E'State2 -> E'State2)
-> Ord E'State2
E'State2 -> E'State2 -> Bool
E'State2 -> E'State2 -> Ordering
E'State2 -> E'State2 -> E'State2
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
$ccompare :: E'State2 -> E'State2 -> Ordering
compare :: E'State2 -> E'State2 -> Ordering
$c< :: E'State2 -> E'State2 -> Bool
< :: E'State2 -> E'State2 -> Bool
$c<= :: E'State2 -> E'State2 -> Bool
<= :: E'State2 -> E'State2 -> Bool
$c> :: E'State2 -> E'State2 -> Bool
> :: E'State2 -> E'State2 -> Bool
$c>= :: E'State2 -> E'State2 -> Bool
>= :: E'State2 -> E'State2 -> Bool
$cmax :: E'State2 -> E'State2 -> E'State2
max :: E'State2 -> E'State2 -> E'State2
$cmin :: E'State2 -> E'State2 -> E'State2
min :: E'State2 -> E'State2 -> E'State2
P.Ord, E'State2
E'State2 -> E'State2 -> Bounded E'State2
forall a. a -> a -> Bounded a
$cminBound :: E'State2
minBound :: E'State2
$cmaxBound :: E'State2
maxBound :: E'State2
P.Bounded, Int -> E'State2
E'State2 -> Int
E'State2 -> [E'State2]
E'State2 -> E'State2
E'State2 -> E'State2 -> [E'State2]
E'State2 -> E'State2 -> E'State2 -> [E'State2]
(E'State2 -> E'State2)
-> (E'State2 -> E'State2)
-> (Int -> E'State2)
-> (E'State2 -> Int)
-> (E'State2 -> [E'State2])
-> (E'State2 -> E'State2 -> [E'State2])
-> (E'State2 -> E'State2 -> [E'State2])
-> (E'State2 -> E'State2 -> E'State2 -> [E'State2])
-> Enum E'State2
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'State2 -> E'State2
succ :: E'State2 -> E'State2
$cpred :: E'State2 -> E'State2
pred :: E'State2 -> E'State2
$ctoEnum :: Int -> E'State2
toEnum :: Int -> E'State2
$cfromEnum :: E'State2 -> Int
fromEnum :: E'State2 -> Int
$cenumFrom :: E'State2 -> [E'State2]
enumFrom :: E'State2 -> [E'State2]
$cenumFromThen :: E'State2 -> E'State2 -> [E'State2]
enumFromThen :: E'State2 -> E'State2 -> [E'State2]
$cenumFromTo :: E'State2 -> E'State2 -> [E'State2]
enumFromTo :: E'State2 -> E'State2 -> [E'State2]
$cenumFromThenTo :: E'State2 -> E'State2 -> E'State2 -> [E'State2]
enumFromThenTo :: E'State2 -> E'State2 -> E'State2 -> [E'State2]
P.Enum)
instance A.ToJSON E'State2 where toJSON :: E'State2 -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'State2 -> Text) -> E'State2 -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State2 -> Text
fromE'State2
instance A.FromJSON E'State2 where parseJSON :: Value -> Parser E'State2
parseJSON Value
o = ([Char] -> Parser E'State2)
-> (E'State2 -> Parser E'State2)
-> Either [Char] E'State2
-> Parser E'State2
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'State2
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'State2 -> Parser E'State2
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'State2 -> Parser E'State2)
-> (E'State2 -> E'State2) -> E'State2 -> Parser E'State2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State2 -> E'State2
forall a. a -> a
P.id) (Either [Char] E'State2 -> Parser E'State2)
-> (Text -> Either [Char] E'State2) -> Text -> Parser E'State2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State2
toE'State2 (Text -> Parser E'State2) -> Parser Text -> Parser E'State2
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'State2 where toQueryParam :: E'State2 -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'State2 -> Text) -> E'State2 -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State2 -> Text
fromE'State2
instance WH.FromHttpApiData E'State2 where parseQueryParam :: Text -> Either Text E'State2
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'State2) -> Either Text E'State2
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'State2 -> Either Text E'State2
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'State2 -> Either Text E'State2)
-> (Text -> Either [Char] E'State2) -> Text -> Either Text E'State2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State2
toE'State2
instance MimeRender MimeMultipartFormData E'State2 where mimeRender :: Proxy MimeMultipartFormData -> E'State2 -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'State2 -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'State2 :: E'State2 -> Text
fromE'State2 :: E'State2 -> Text
fromE'State2 = \case
E'State2
E'State2'STATE_UNSPECIFIED -> Text
"STATE_UNSPECIFIED"
E'State2
E'State2'GENERATING -> Text
"GENERATING"
E'State2
E'State2'GENERATED -> Text
"GENERATED"
E'State2
E'State2'FAILED -> Text
"FAILED"
toE'State2 :: Text -> P.Either String E'State2
toE'State2 :: Text -> Either [Char] E'State2
toE'State2 = \case
Text
"STATE_UNSPECIFIED" -> E'State2 -> Either [Char] E'State2
forall a b. b -> Either a b
P.Right E'State2
E'State2'STATE_UNSPECIFIED
Text
"GENERATING" -> E'State2 -> Either [Char] E'State2
forall a b. b -> Either a b
P.Right E'State2
E'State2'GENERATING
Text
"GENERATED" -> E'State2 -> Either [Char] E'State2
forall a b. b -> Either a b
P.Right E'State2
E'State2'GENERATED
Text
"FAILED" -> E'State2 -> Either [Char] E'State2
forall a b. b -> Either a b
P.Right E'State2
E'State2'FAILED
Text
s -> [Char] -> Either [Char] E'State2
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'State2)
-> [Char] -> Either [Char] E'State2
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'State2: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'State3
=
E'State3'STATE_UNSPECIFIED
|
E'State3'CREATING
|
E'State3'ACTIVE
|
E'State3'FAILED
deriving (Int -> E'State3 -> ShowS
[E'State3] -> ShowS
E'State3 -> [Char]
(Int -> E'State3 -> ShowS)
-> (E'State3 -> [Char]) -> ([E'State3] -> ShowS) -> Show E'State3
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'State3 -> ShowS
showsPrec :: Int -> E'State3 -> ShowS
$cshow :: E'State3 -> [Char]
show :: E'State3 -> [Char]
$cshowList :: [E'State3] -> ShowS
showList :: [E'State3] -> ShowS
P.Show, E'State3 -> E'State3 -> Bool
(E'State3 -> E'State3 -> Bool)
-> (E'State3 -> E'State3 -> Bool) -> Eq E'State3
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'State3 -> E'State3 -> Bool
== :: E'State3 -> E'State3 -> Bool
$c/= :: E'State3 -> E'State3 -> Bool
/= :: E'State3 -> E'State3 -> Bool
P.Eq, P.Typeable, Eq E'State3
Eq E'State3 =>
(E'State3 -> E'State3 -> Ordering)
-> (E'State3 -> E'State3 -> Bool)
-> (E'State3 -> E'State3 -> Bool)
-> (E'State3 -> E'State3 -> Bool)
-> (E'State3 -> E'State3 -> Bool)
-> (E'State3 -> E'State3 -> E'State3)
-> (E'State3 -> E'State3 -> E'State3)
-> Ord E'State3
E'State3 -> E'State3 -> Bool
E'State3 -> E'State3 -> Ordering
E'State3 -> E'State3 -> E'State3
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
$ccompare :: E'State3 -> E'State3 -> Ordering
compare :: E'State3 -> E'State3 -> Ordering
$c< :: E'State3 -> E'State3 -> Bool
< :: E'State3 -> E'State3 -> Bool
$c<= :: E'State3 -> E'State3 -> Bool
<= :: E'State3 -> E'State3 -> Bool
$c> :: E'State3 -> E'State3 -> Bool
> :: E'State3 -> E'State3 -> Bool
$c>= :: E'State3 -> E'State3 -> Bool
>= :: E'State3 -> E'State3 -> Bool
$cmax :: E'State3 -> E'State3 -> E'State3
max :: E'State3 -> E'State3 -> E'State3
$cmin :: E'State3 -> E'State3 -> E'State3
min :: E'State3 -> E'State3 -> E'State3
P.Ord, E'State3
E'State3 -> E'State3 -> Bounded E'State3
forall a. a -> a -> Bounded a
$cminBound :: E'State3
minBound :: E'State3
$cmaxBound :: E'State3
maxBound :: E'State3
P.Bounded, Int -> E'State3
E'State3 -> Int
E'State3 -> [E'State3]
E'State3 -> E'State3
E'State3 -> E'State3 -> [E'State3]
E'State3 -> E'State3 -> E'State3 -> [E'State3]
(E'State3 -> E'State3)
-> (E'State3 -> E'State3)
-> (Int -> E'State3)
-> (E'State3 -> Int)
-> (E'State3 -> [E'State3])
-> (E'State3 -> E'State3 -> [E'State3])
-> (E'State3 -> E'State3 -> [E'State3])
-> (E'State3 -> E'State3 -> E'State3 -> [E'State3])
-> Enum E'State3
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'State3 -> E'State3
succ :: E'State3 -> E'State3
$cpred :: E'State3 -> E'State3
pred :: E'State3 -> E'State3
$ctoEnum :: Int -> E'State3
toEnum :: Int -> E'State3
$cfromEnum :: E'State3 -> Int
fromEnum :: E'State3 -> Int
$cenumFrom :: E'State3 -> [E'State3]
enumFrom :: E'State3 -> [E'State3]
$cenumFromThen :: E'State3 -> E'State3 -> [E'State3]
enumFromThen :: E'State3 -> E'State3 -> [E'State3]
$cenumFromTo :: E'State3 -> E'State3 -> [E'State3]
enumFromTo :: E'State3 -> E'State3 -> [E'State3]
$cenumFromThenTo :: E'State3 -> E'State3 -> E'State3 -> [E'State3]
enumFromThenTo :: E'State3 -> E'State3 -> E'State3 -> [E'State3]
P.Enum)
instance A.ToJSON E'State3 where toJSON :: E'State3 -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'State3 -> Text) -> E'State3 -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State3 -> Text
fromE'State3
instance A.FromJSON E'State3 where parseJSON :: Value -> Parser E'State3
parseJSON Value
o = ([Char] -> Parser E'State3)
-> (E'State3 -> Parser E'State3)
-> Either [Char] E'State3
-> Parser E'State3
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'State3
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'State3 -> Parser E'State3
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'State3 -> Parser E'State3)
-> (E'State3 -> E'State3) -> E'State3 -> Parser E'State3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State3 -> E'State3
forall a. a -> a
P.id) (Either [Char] E'State3 -> Parser E'State3)
-> (Text -> Either [Char] E'State3) -> Text -> Parser E'State3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State3
toE'State3 (Text -> Parser E'State3) -> Parser Text -> Parser E'State3
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'State3 where toQueryParam :: E'State3 -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'State3 -> Text) -> E'State3 -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State3 -> Text
fromE'State3
instance WH.FromHttpApiData E'State3 where parseQueryParam :: Text -> Either Text E'State3
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'State3) -> Either Text E'State3
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'State3 -> Either Text E'State3
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'State3 -> Either Text E'State3)
-> (Text -> Either [Char] E'State3) -> Text -> Either Text E'State3
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State3
toE'State3
instance MimeRender MimeMultipartFormData E'State3 where mimeRender :: Proxy MimeMultipartFormData -> E'State3 -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'State3 -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'State3 :: E'State3 -> Text
fromE'State3 :: E'State3 -> Text
fromE'State3 = \case
E'State3
E'State3'STATE_UNSPECIFIED -> Text
"STATE_UNSPECIFIED"
E'State3
E'State3'CREATING -> Text
"CREATING"
E'State3
E'State3'ACTIVE -> Text
"ACTIVE"
E'State3
E'State3'FAILED -> Text
"FAILED"
toE'State3 :: Text -> P.Either String E'State3
toE'State3 :: Text -> Either [Char] E'State3
toE'State3 = \case
Text
"STATE_UNSPECIFIED" -> E'State3 -> Either [Char] E'State3
forall a b. b -> Either a b
P.Right E'State3
E'State3'STATE_UNSPECIFIED
Text
"CREATING" -> E'State3 -> Either [Char] E'State3
forall a b. b -> Either a b
P.Right E'State3
E'State3'CREATING
Text
"ACTIVE" -> E'State3 -> Either [Char] E'State3
forall a b. b -> Either a b
P.Right E'State3
E'State3'ACTIVE
Text
"FAILED" -> E'State3 -> Either [Char] E'State3
forall a b. b -> Either a b
P.Right E'State3
E'State3'FAILED
Text
s -> [Char] -> Either [Char] E'State3
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'State3)
-> [Char] -> Either [Char] E'State3
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'State3: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'State4
=
E'State4'UNSPECIFIED
|
E'State4'PENDING_PROCESSING
|
E'State4'ACTIVE
|
E'State4'FAILED
deriving (Int -> E'State4 -> ShowS
[E'State4] -> ShowS
E'State4 -> [Char]
(Int -> E'State4 -> ShowS)
-> (E'State4 -> [Char]) -> ([E'State4] -> ShowS) -> Show E'State4
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'State4 -> ShowS
showsPrec :: Int -> E'State4 -> ShowS
$cshow :: E'State4 -> [Char]
show :: E'State4 -> [Char]
$cshowList :: [E'State4] -> ShowS
showList :: [E'State4] -> ShowS
P.Show, E'State4 -> E'State4 -> Bool
(E'State4 -> E'State4 -> Bool)
-> (E'State4 -> E'State4 -> Bool) -> Eq E'State4
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'State4 -> E'State4 -> Bool
== :: E'State4 -> E'State4 -> Bool
$c/= :: E'State4 -> E'State4 -> Bool
/= :: E'State4 -> E'State4 -> Bool
P.Eq, P.Typeable, Eq E'State4
Eq E'State4 =>
(E'State4 -> E'State4 -> Ordering)
-> (E'State4 -> E'State4 -> Bool)
-> (E'State4 -> E'State4 -> Bool)
-> (E'State4 -> E'State4 -> Bool)
-> (E'State4 -> E'State4 -> Bool)
-> (E'State4 -> E'State4 -> E'State4)
-> (E'State4 -> E'State4 -> E'State4)
-> Ord E'State4
E'State4 -> E'State4 -> Bool
E'State4 -> E'State4 -> Ordering
E'State4 -> E'State4 -> E'State4
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
$ccompare :: E'State4 -> E'State4 -> Ordering
compare :: E'State4 -> E'State4 -> Ordering
$c< :: E'State4 -> E'State4 -> Bool
< :: E'State4 -> E'State4 -> Bool
$c<= :: E'State4 -> E'State4 -> Bool
<= :: E'State4 -> E'State4 -> Bool
$c> :: E'State4 -> E'State4 -> Bool
> :: E'State4 -> E'State4 -> Bool
$c>= :: E'State4 -> E'State4 -> Bool
>= :: E'State4 -> E'State4 -> Bool
$cmax :: E'State4 -> E'State4 -> E'State4
max :: E'State4 -> E'State4 -> E'State4
$cmin :: E'State4 -> E'State4 -> E'State4
min :: E'State4 -> E'State4 -> E'State4
P.Ord, E'State4
E'State4 -> E'State4 -> Bounded E'State4
forall a. a -> a -> Bounded a
$cminBound :: E'State4
minBound :: E'State4
$cmaxBound :: E'State4
maxBound :: E'State4
P.Bounded, Int -> E'State4
E'State4 -> Int
E'State4 -> [E'State4]
E'State4 -> E'State4
E'State4 -> E'State4 -> [E'State4]
E'State4 -> E'State4 -> E'State4 -> [E'State4]
(E'State4 -> E'State4)
-> (E'State4 -> E'State4)
-> (Int -> E'State4)
-> (E'State4 -> Int)
-> (E'State4 -> [E'State4])
-> (E'State4 -> E'State4 -> [E'State4])
-> (E'State4 -> E'State4 -> [E'State4])
-> (E'State4 -> E'State4 -> E'State4 -> [E'State4])
-> Enum E'State4
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'State4 -> E'State4
succ :: E'State4 -> E'State4
$cpred :: E'State4 -> E'State4
pred :: E'State4 -> E'State4
$ctoEnum :: Int -> E'State4
toEnum :: Int -> E'State4
$cfromEnum :: E'State4 -> Int
fromEnum :: E'State4 -> Int
$cenumFrom :: E'State4 -> [E'State4]
enumFrom :: E'State4 -> [E'State4]
$cenumFromThen :: E'State4 -> E'State4 -> [E'State4]
enumFromThen :: E'State4 -> E'State4 -> [E'State4]
$cenumFromTo :: E'State4 -> E'State4 -> [E'State4]
enumFromTo :: E'State4 -> E'State4 -> [E'State4]
$cenumFromThenTo :: E'State4 -> E'State4 -> E'State4 -> [E'State4]
enumFromThenTo :: E'State4 -> E'State4 -> E'State4 -> [E'State4]
P.Enum)
instance A.ToJSON E'State4 where toJSON :: E'State4 -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'State4 -> Text) -> E'State4 -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State4 -> Text
fromE'State4
instance A.FromJSON E'State4 where parseJSON :: Value -> Parser E'State4
parseJSON Value
o = ([Char] -> Parser E'State4)
-> (E'State4 -> Parser E'State4)
-> Either [Char] E'State4
-> Parser E'State4
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'State4
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'State4 -> Parser E'State4
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'State4 -> Parser E'State4)
-> (E'State4 -> E'State4) -> E'State4 -> Parser E'State4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State4 -> E'State4
forall a. a -> a
P.id) (Either [Char] E'State4 -> Parser E'State4)
-> (Text -> Either [Char] E'State4) -> Text -> Parser E'State4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State4
toE'State4 (Text -> Parser E'State4) -> Parser Text -> Parser E'State4
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'State4 where toQueryParam :: E'State4 -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'State4 -> Text) -> E'State4 -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'State4 -> Text
fromE'State4
instance WH.FromHttpApiData E'State4 where parseQueryParam :: Text -> Either Text E'State4
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'State4) -> Either Text E'State4
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'State4 -> Either Text E'State4
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'State4 -> Either Text E'State4)
-> (Text -> Either [Char] E'State4) -> Text -> Either Text E'State4
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'State4
toE'State4
instance MimeRender MimeMultipartFormData E'State4 where mimeRender :: Proxy MimeMultipartFormData -> E'State4 -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'State4 -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'State4 :: E'State4 -> Text
fromE'State4 :: E'State4 -> Text
fromE'State4 = \case
E'State4
E'State4'UNSPECIFIED -> Text
"STATE_UNSPECIFIED"
E'State4
E'State4'PENDING_PROCESSING -> Text
"STATE_PENDING_PROCESSING"
E'State4
E'State4'ACTIVE -> Text
"STATE_ACTIVE"
E'State4
E'State4'FAILED -> Text
"STATE_FAILED"
toE'State4 :: Text -> P.Either String E'State4
toE'State4 :: Text -> Either [Char] E'State4
toE'State4 = \case
Text
"STATE_UNSPECIFIED" -> E'State4 -> Either [Char] E'State4
forall a b. b -> Either a b
P.Right E'State4
E'State4'UNSPECIFIED
Text
"STATE_PENDING_PROCESSING" -> E'State4 -> Either [Char] E'State4
forall a b. b -> Either a b
P.Right E'State4
E'State4'PENDING_PROCESSING
Text
"STATE_ACTIVE" -> E'State4 -> Either [Char] E'State4
forall a b. b -> Either a b
P.Right E'State4
E'State4'ACTIVE
Text
"STATE_FAILED" -> E'State4 -> Either [Char] E'State4
forall a b. b -> Either a b
P.Right E'State4
E'State4'FAILED
Text
s -> [Char] -> Either [Char] E'State4
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'State4)
-> [Char] -> Either [Char] E'State4
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'State4: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Threshold
=
E'Threshold'HARM_BLOCK_THRESHOLD_UNSPECIFIED
|
E'Threshold'BLOCK_LOW_AND_ABOVE
|
E'Threshold'BLOCK_MEDIUM_AND_ABOVE
|
E'Threshold'BLOCK_ONLY_HIGH
|
E'Threshold'BLOCK_NONE
|
E'Threshold'OFF
deriving (Int -> E'Threshold -> ShowS
[E'Threshold] -> ShowS
E'Threshold -> [Char]
(Int -> E'Threshold -> ShowS)
-> (E'Threshold -> [Char])
-> ([E'Threshold] -> ShowS)
-> Show E'Threshold
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Threshold -> ShowS
showsPrec :: Int -> E'Threshold -> ShowS
$cshow :: E'Threshold -> [Char]
show :: E'Threshold -> [Char]
$cshowList :: [E'Threshold] -> ShowS
showList :: [E'Threshold] -> ShowS
P.Show, E'Threshold -> E'Threshold -> Bool
(E'Threshold -> E'Threshold -> Bool)
-> (E'Threshold -> E'Threshold -> Bool) -> Eq E'Threshold
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Threshold -> E'Threshold -> Bool
== :: E'Threshold -> E'Threshold -> Bool
$c/= :: E'Threshold -> E'Threshold -> Bool
/= :: E'Threshold -> E'Threshold -> Bool
P.Eq, P.Typeable, Eq E'Threshold
Eq E'Threshold =>
(E'Threshold -> E'Threshold -> Ordering)
-> (E'Threshold -> E'Threshold -> Bool)
-> (E'Threshold -> E'Threshold -> Bool)
-> (E'Threshold -> E'Threshold -> Bool)
-> (E'Threshold -> E'Threshold -> Bool)
-> (E'Threshold -> E'Threshold -> E'Threshold)
-> (E'Threshold -> E'Threshold -> E'Threshold)
-> Ord E'Threshold
E'Threshold -> E'Threshold -> Bool
E'Threshold -> E'Threshold -> Ordering
E'Threshold -> E'Threshold -> E'Threshold
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
$ccompare :: E'Threshold -> E'Threshold -> Ordering
compare :: E'Threshold -> E'Threshold -> Ordering
$c< :: E'Threshold -> E'Threshold -> Bool
< :: E'Threshold -> E'Threshold -> Bool
$c<= :: E'Threshold -> E'Threshold -> Bool
<= :: E'Threshold -> E'Threshold -> Bool
$c> :: E'Threshold -> E'Threshold -> Bool
> :: E'Threshold -> E'Threshold -> Bool
$c>= :: E'Threshold -> E'Threshold -> Bool
>= :: E'Threshold -> E'Threshold -> Bool
$cmax :: E'Threshold -> E'Threshold -> E'Threshold
max :: E'Threshold -> E'Threshold -> E'Threshold
$cmin :: E'Threshold -> E'Threshold -> E'Threshold
min :: E'Threshold -> E'Threshold -> E'Threshold
P.Ord, E'Threshold
E'Threshold -> E'Threshold -> Bounded E'Threshold
forall a. a -> a -> Bounded a
$cminBound :: E'Threshold
minBound :: E'Threshold
$cmaxBound :: E'Threshold
maxBound :: E'Threshold
P.Bounded, Int -> E'Threshold
E'Threshold -> Int
E'Threshold -> [E'Threshold]
E'Threshold -> E'Threshold
E'Threshold -> E'Threshold -> [E'Threshold]
E'Threshold -> E'Threshold -> E'Threshold -> [E'Threshold]
(E'Threshold -> E'Threshold)
-> (E'Threshold -> E'Threshold)
-> (Int -> E'Threshold)
-> (E'Threshold -> Int)
-> (E'Threshold -> [E'Threshold])
-> (E'Threshold -> E'Threshold -> [E'Threshold])
-> (E'Threshold -> E'Threshold -> [E'Threshold])
-> (E'Threshold -> E'Threshold -> E'Threshold -> [E'Threshold])
-> Enum E'Threshold
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Threshold -> E'Threshold
succ :: E'Threshold -> E'Threshold
$cpred :: E'Threshold -> E'Threshold
pred :: E'Threshold -> E'Threshold
$ctoEnum :: Int -> E'Threshold
toEnum :: Int -> E'Threshold
$cfromEnum :: E'Threshold -> Int
fromEnum :: E'Threshold -> Int
$cenumFrom :: E'Threshold -> [E'Threshold]
enumFrom :: E'Threshold -> [E'Threshold]
$cenumFromThen :: E'Threshold -> E'Threshold -> [E'Threshold]
enumFromThen :: E'Threshold -> E'Threshold -> [E'Threshold]
$cenumFromTo :: E'Threshold -> E'Threshold -> [E'Threshold]
enumFromTo :: E'Threshold -> E'Threshold -> [E'Threshold]
$cenumFromThenTo :: E'Threshold -> E'Threshold -> E'Threshold -> [E'Threshold]
enumFromThenTo :: E'Threshold -> E'Threshold -> E'Threshold -> [E'Threshold]
P.Enum)
instance A.ToJSON E'Threshold where toJSON :: E'Threshold -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Threshold -> Text) -> E'Threshold -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Threshold -> Text
fromE'Threshold
instance A.FromJSON E'Threshold where parseJSON :: Value -> Parser E'Threshold
parseJSON Value
o = ([Char] -> Parser E'Threshold)
-> (E'Threshold -> Parser E'Threshold)
-> Either [Char] E'Threshold
-> Parser E'Threshold
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Threshold
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Threshold -> Parser E'Threshold
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Threshold -> Parser E'Threshold)
-> (E'Threshold -> E'Threshold)
-> E'Threshold
-> Parser E'Threshold
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Threshold -> E'Threshold
forall a. a -> a
P.id) (Either [Char] E'Threshold -> Parser E'Threshold)
-> (Text -> Either [Char] E'Threshold)
-> Text
-> Parser E'Threshold
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Threshold
toE'Threshold (Text -> Parser E'Threshold) -> Parser Text -> Parser E'Threshold
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Threshold where toQueryParam :: E'Threshold -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Threshold -> Text) -> E'Threshold -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Threshold -> Text
fromE'Threshold
instance WH.FromHttpApiData E'Threshold where parseQueryParam :: Text -> Either Text E'Threshold
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Threshold) -> Either Text E'Threshold
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'Threshold -> Either Text E'Threshold
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Threshold -> Either Text E'Threshold)
-> (Text -> Either [Char] E'Threshold)
-> Text
-> Either Text E'Threshold
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Threshold
toE'Threshold
instance MimeRender MimeMultipartFormData E'Threshold where mimeRender :: Proxy MimeMultipartFormData -> E'Threshold -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Threshold -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Threshold :: E'Threshold -> Text
fromE'Threshold :: E'Threshold -> Text
fromE'Threshold = \case
E'Threshold
E'Threshold'HARM_BLOCK_THRESHOLD_UNSPECIFIED -> Text
"HARM_BLOCK_THRESHOLD_UNSPECIFIED"
E'Threshold
E'Threshold'BLOCK_LOW_AND_ABOVE -> Text
"BLOCK_LOW_AND_ABOVE"
E'Threshold
E'Threshold'BLOCK_MEDIUM_AND_ABOVE -> Text
"BLOCK_MEDIUM_AND_ABOVE"
E'Threshold
E'Threshold'BLOCK_ONLY_HIGH -> Text
"BLOCK_ONLY_HIGH"
E'Threshold
E'Threshold'BLOCK_NONE -> Text
"BLOCK_NONE"
E'Threshold
E'Threshold'OFF -> Text
"OFF"
toE'Threshold :: Text -> P.Either String E'Threshold
toE'Threshold :: Text -> Either [Char] E'Threshold
toE'Threshold = \case
Text
"HARM_BLOCK_THRESHOLD_UNSPECIFIED" -> E'Threshold -> Either [Char] E'Threshold
forall a b. b -> Either a b
P.Right E'Threshold
E'Threshold'HARM_BLOCK_THRESHOLD_UNSPECIFIED
Text
"BLOCK_LOW_AND_ABOVE" -> E'Threshold -> Either [Char] E'Threshold
forall a b. b -> Either a b
P.Right E'Threshold
E'Threshold'BLOCK_LOW_AND_ABOVE
Text
"BLOCK_MEDIUM_AND_ABOVE" -> E'Threshold -> Either [Char] E'Threshold
forall a b. b -> Either a b
P.Right E'Threshold
E'Threshold'BLOCK_MEDIUM_AND_ABOVE
Text
"BLOCK_ONLY_HIGH" -> E'Threshold -> Either [Char] E'Threshold
forall a b. b -> Either a b
P.Right E'Threshold
E'Threshold'BLOCK_ONLY_HIGH
Text
"BLOCK_NONE" -> E'Threshold -> Either [Char] E'Threshold
forall a b. b -> Either a b
P.Right E'Threshold
E'Threshold'BLOCK_NONE
Text
"OFF" -> E'Threshold -> Either [Char] E'Threshold
forall a b. b -> Either a b
P.Right E'Threshold
E'Threshold'OFF
Text
s -> [Char] -> Either [Char] E'Threshold
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Threshold)
-> [Char] -> Either [Char] E'Threshold
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Threshold: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'UrlRetrievalStatus
=
E'UrlRetrievalStatus'UNSPECIFIED
|
E'UrlRetrievalStatus'SUCCESS
|
E'UrlRetrievalStatus'ERROR
deriving (Int -> E'UrlRetrievalStatus -> ShowS
[E'UrlRetrievalStatus] -> ShowS
E'UrlRetrievalStatus -> [Char]
(Int -> E'UrlRetrievalStatus -> ShowS)
-> (E'UrlRetrievalStatus -> [Char])
-> ([E'UrlRetrievalStatus] -> ShowS)
-> Show E'UrlRetrievalStatus
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'UrlRetrievalStatus -> ShowS
showsPrec :: Int -> E'UrlRetrievalStatus -> ShowS
$cshow :: E'UrlRetrievalStatus -> [Char]
show :: E'UrlRetrievalStatus -> [Char]
$cshowList :: [E'UrlRetrievalStatus] -> ShowS
showList :: [E'UrlRetrievalStatus] -> ShowS
P.Show, E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
(E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool)
-> (E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool)
-> Eq E'UrlRetrievalStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
== :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
$c/= :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
/= :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
P.Eq, P.Typeable, Eq E'UrlRetrievalStatus
Eq E'UrlRetrievalStatus =>
(E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Ordering)
-> (E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool)
-> (E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool)
-> (E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool)
-> (E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool)
-> (E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> E'UrlRetrievalStatus)
-> (E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> E'UrlRetrievalStatus)
-> Ord E'UrlRetrievalStatus
E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Ordering
E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> E'UrlRetrievalStatus
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
$ccompare :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Ordering
compare :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Ordering
$c< :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
< :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
$c<= :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
<= :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
$c> :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
> :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
$c>= :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
>= :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus -> Bool
$cmax :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> E'UrlRetrievalStatus
max :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> E'UrlRetrievalStatus
$cmin :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> E'UrlRetrievalStatus
min :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> E'UrlRetrievalStatus
P.Ord, E'UrlRetrievalStatus
E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> Bounded E'UrlRetrievalStatus
forall a. a -> a -> Bounded a
$cminBound :: E'UrlRetrievalStatus
minBound :: E'UrlRetrievalStatus
$cmaxBound :: E'UrlRetrievalStatus
maxBound :: E'UrlRetrievalStatus
P.Bounded, Int -> E'UrlRetrievalStatus
E'UrlRetrievalStatus -> Int
E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
E'UrlRetrievalStatus -> E'UrlRetrievalStatus
E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> [E'UrlRetrievalStatus]
(E'UrlRetrievalStatus -> E'UrlRetrievalStatus)
-> (E'UrlRetrievalStatus -> E'UrlRetrievalStatus)
-> (Int -> E'UrlRetrievalStatus)
-> (E'UrlRetrievalStatus -> Int)
-> (E'UrlRetrievalStatus -> [E'UrlRetrievalStatus])
-> (E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> [E'UrlRetrievalStatus])
-> (E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> [E'UrlRetrievalStatus])
-> (E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> [E'UrlRetrievalStatus])
-> Enum E'UrlRetrievalStatus
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus
succ :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus
$cpred :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus
pred :: E'UrlRetrievalStatus -> E'UrlRetrievalStatus
$ctoEnum :: Int -> E'UrlRetrievalStatus
toEnum :: Int -> E'UrlRetrievalStatus
$cfromEnum :: E'UrlRetrievalStatus -> Int
fromEnum :: E'UrlRetrievalStatus -> Int
$cenumFrom :: E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
enumFrom :: E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
$cenumFromThen :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
enumFromThen :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
$cenumFromTo :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
enumFromTo :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus -> [E'UrlRetrievalStatus]
$cenumFromThenTo :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> [E'UrlRetrievalStatus]
enumFromThenTo :: E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> E'UrlRetrievalStatus
-> [E'UrlRetrievalStatus]
P.Enum)
instance A.ToJSON E'UrlRetrievalStatus where toJSON :: E'UrlRetrievalStatus -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value)
-> (E'UrlRetrievalStatus -> Text) -> E'UrlRetrievalStatus -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'UrlRetrievalStatus -> Text
fromE'UrlRetrievalStatus
instance A.FromJSON E'UrlRetrievalStatus where parseJSON :: Value -> Parser E'UrlRetrievalStatus
parseJSON Value
o = ([Char] -> Parser E'UrlRetrievalStatus)
-> (E'UrlRetrievalStatus -> Parser E'UrlRetrievalStatus)
-> Either [Char] E'UrlRetrievalStatus
-> Parser E'UrlRetrievalStatus
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'UrlRetrievalStatus
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'UrlRetrievalStatus -> Parser E'UrlRetrievalStatus
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'UrlRetrievalStatus -> Parser E'UrlRetrievalStatus)
-> (E'UrlRetrievalStatus -> E'UrlRetrievalStatus)
-> E'UrlRetrievalStatus
-> Parser E'UrlRetrievalStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'UrlRetrievalStatus -> E'UrlRetrievalStatus
forall a. a -> a
P.id) (Either [Char] E'UrlRetrievalStatus -> Parser E'UrlRetrievalStatus)
-> (Text -> Either [Char] E'UrlRetrievalStatus)
-> Text
-> Parser E'UrlRetrievalStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'UrlRetrievalStatus
toE'UrlRetrievalStatus (Text -> Parser E'UrlRetrievalStatus)
-> Parser Text -> Parser E'UrlRetrievalStatus
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'UrlRetrievalStatus where toQueryParam :: E'UrlRetrievalStatus -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text)
-> (E'UrlRetrievalStatus -> Text) -> E'UrlRetrievalStatus -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'UrlRetrievalStatus -> Text
fromE'UrlRetrievalStatus
instance WH.FromHttpApiData E'UrlRetrievalStatus where parseQueryParam :: Text -> Either Text E'UrlRetrievalStatus
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'UrlRetrievalStatus)
-> Either Text E'UrlRetrievalStatus
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] E'UrlRetrievalStatus
-> Either Text E'UrlRetrievalStatus
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'UrlRetrievalStatus
-> Either Text E'UrlRetrievalStatus)
-> (Text -> Either [Char] E'UrlRetrievalStatus)
-> Text
-> Either Text E'UrlRetrievalStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'UrlRetrievalStatus
toE'UrlRetrievalStatus
instance MimeRender MimeMultipartFormData E'UrlRetrievalStatus where mimeRender :: Proxy MimeMultipartFormData -> E'UrlRetrievalStatus -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'UrlRetrievalStatus -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'UrlRetrievalStatus :: E'UrlRetrievalStatus -> Text
fromE'UrlRetrievalStatus :: E'UrlRetrievalStatus -> Text
fromE'UrlRetrievalStatus = \case
E'UrlRetrievalStatus
E'UrlRetrievalStatus'UNSPECIFIED -> Text
"URL_RETRIEVAL_STATUS_UNSPECIFIED"
E'UrlRetrievalStatus
E'UrlRetrievalStatus'SUCCESS -> Text
"URL_RETRIEVAL_STATUS_SUCCESS"
E'UrlRetrievalStatus
E'UrlRetrievalStatus'ERROR -> Text
"URL_RETRIEVAL_STATUS_ERROR"
toE'UrlRetrievalStatus :: Text -> P.Either String E'UrlRetrievalStatus
toE'UrlRetrievalStatus :: Text -> Either [Char] E'UrlRetrievalStatus
toE'UrlRetrievalStatus = \case
Text
"URL_RETRIEVAL_STATUS_UNSPECIFIED" -> E'UrlRetrievalStatus -> Either [Char] E'UrlRetrievalStatus
forall a b. b -> Either a b
P.Right E'UrlRetrievalStatus
E'UrlRetrievalStatus'UNSPECIFIED
Text
"URL_RETRIEVAL_STATUS_SUCCESS" -> E'UrlRetrievalStatus -> Either [Char] E'UrlRetrievalStatus
forall a b. b -> Either a b
P.Right E'UrlRetrievalStatus
E'UrlRetrievalStatus'SUCCESS
Text
"URL_RETRIEVAL_STATUS_ERROR" -> E'UrlRetrievalStatus -> Either [Char] E'UrlRetrievalStatus
forall a b. b -> Either a b
P.Right E'UrlRetrievalStatus
E'UrlRetrievalStatus'ERROR
Text
s -> [Char] -> Either [Char] E'UrlRetrievalStatus
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'UrlRetrievalStatus)
-> [Char] -> Either [Char] E'UrlRetrievalStatus
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'UrlRetrievalStatus: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data E'Xgafv
=
E'Xgafv'1
|
E'Xgafv'2
deriving (Int -> E'Xgafv -> ShowS
[E'Xgafv] -> ShowS
E'Xgafv -> [Char]
(Int -> E'Xgafv -> ShowS)
-> (E'Xgafv -> [Char]) -> ([E'Xgafv] -> ShowS) -> Show E'Xgafv
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> E'Xgafv -> ShowS
showsPrec :: Int -> E'Xgafv -> ShowS
$cshow :: E'Xgafv -> [Char]
show :: E'Xgafv -> [Char]
$cshowList :: [E'Xgafv] -> ShowS
showList :: [E'Xgafv] -> ShowS
P.Show, E'Xgafv -> E'Xgafv -> Bool
(E'Xgafv -> E'Xgafv -> Bool)
-> (E'Xgafv -> E'Xgafv -> Bool) -> Eq E'Xgafv
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: E'Xgafv -> E'Xgafv -> Bool
== :: E'Xgafv -> E'Xgafv -> Bool
$c/= :: E'Xgafv -> E'Xgafv -> Bool
/= :: E'Xgafv -> E'Xgafv -> Bool
P.Eq, P.Typeable, Eq E'Xgafv
Eq E'Xgafv =>
(E'Xgafv -> E'Xgafv -> Ordering)
-> (E'Xgafv -> E'Xgafv -> Bool)
-> (E'Xgafv -> E'Xgafv -> Bool)
-> (E'Xgafv -> E'Xgafv -> Bool)
-> (E'Xgafv -> E'Xgafv -> Bool)
-> (E'Xgafv -> E'Xgafv -> E'Xgafv)
-> (E'Xgafv -> E'Xgafv -> E'Xgafv)
-> Ord E'Xgafv
E'Xgafv -> E'Xgafv -> Bool
E'Xgafv -> E'Xgafv -> Ordering
E'Xgafv -> E'Xgafv -> E'Xgafv
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
$ccompare :: E'Xgafv -> E'Xgafv -> Ordering
compare :: E'Xgafv -> E'Xgafv -> Ordering
$c< :: E'Xgafv -> E'Xgafv -> Bool
< :: E'Xgafv -> E'Xgafv -> Bool
$c<= :: E'Xgafv -> E'Xgafv -> Bool
<= :: E'Xgafv -> E'Xgafv -> Bool
$c> :: E'Xgafv -> E'Xgafv -> Bool
> :: E'Xgafv -> E'Xgafv -> Bool
$c>= :: E'Xgafv -> E'Xgafv -> Bool
>= :: E'Xgafv -> E'Xgafv -> Bool
$cmax :: E'Xgafv -> E'Xgafv -> E'Xgafv
max :: E'Xgafv -> E'Xgafv -> E'Xgafv
$cmin :: E'Xgafv -> E'Xgafv -> E'Xgafv
min :: E'Xgafv -> E'Xgafv -> E'Xgafv
P.Ord, E'Xgafv
E'Xgafv -> E'Xgafv -> Bounded E'Xgafv
forall a. a -> a -> Bounded a
$cminBound :: E'Xgafv
minBound :: E'Xgafv
$cmaxBound :: E'Xgafv
maxBound :: E'Xgafv
P.Bounded, Int -> E'Xgafv
E'Xgafv -> Int
E'Xgafv -> [E'Xgafv]
E'Xgafv -> E'Xgafv
E'Xgafv -> E'Xgafv -> [E'Xgafv]
E'Xgafv -> E'Xgafv -> E'Xgafv -> [E'Xgafv]
(E'Xgafv -> E'Xgafv)
-> (E'Xgafv -> E'Xgafv)
-> (Int -> E'Xgafv)
-> (E'Xgafv -> Int)
-> (E'Xgafv -> [E'Xgafv])
-> (E'Xgafv -> E'Xgafv -> [E'Xgafv])
-> (E'Xgafv -> E'Xgafv -> [E'Xgafv])
-> (E'Xgafv -> E'Xgafv -> E'Xgafv -> [E'Xgafv])
-> Enum E'Xgafv
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: E'Xgafv -> E'Xgafv
succ :: E'Xgafv -> E'Xgafv
$cpred :: E'Xgafv -> E'Xgafv
pred :: E'Xgafv -> E'Xgafv
$ctoEnum :: Int -> E'Xgafv
toEnum :: Int -> E'Xgafv
$cfromEnum :: E'Xgafv -> Int
fromEnum :: E'Xgafv -> Int
$cenumFrom :: E'Xgafv -> [E'Xgafv]
enumFrom :: E'Xgafv -> [E'Xgafv]
$cenumFromThen :: E'Xgafv -> E'Xgafv -> [E'Xgafv]
enumFromThen :: E'Xgafv -> E'Xgafv -> [E'Xgafv]
$cenumFromTo :: E'Xgafv -> E'Xgafv -> [E'Xgafv]
enumFromTo :: E'Xgafv -> E'Xgafv -> [E'Xgafv]
$cenumFromThenTo :: E'Xgafv -> E'Xgafv -> E'Xgafv -> [E'Xgafv]
enumFromThenTo :: E'Xgafv -> E'Xgafv -> E'Xgafv -> [E'Xgafv]
P.Enum)
instance A.ToJSON E'Xgafv where toJSON :: E'Xgafv -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (E'Xgafv -> Text) -> E'Xgafv -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Xgafv -> Text
fromE'Xgafv
instance A.FromJSON E'Xgafv where parseJSON :: Value -> Parser E'Xgafv
parseJSON Value
o = ([Char] -> Parser E'Xgafv)
-> (E'Xgafv -> Parser E'Xgafv)
-> Either [Char] E'Xgafv
-> Parser E'Xgafv
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser E'Xgafv
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (E'Xgafv -> Parser E'Xgafv
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (E'Xgafv -> Parser E'Xgafv)
-> (E'Xgafv -> E'Xgafv) -> E'Xgafv -> Parser E'Xgafv
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Xgafv -> E'Xgafv
forall a. a -> a
P.id) (Either [Char] E'Xgafv -> Parser E'Xgafv)
-> (Text -> Either [Char] E'Xgafv) -> Text -> Parser E'Xgafv
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Xgafv
toE'Xgafv (Text -> Parser E'Xgafv) -> Parser Text -> Parser E'Xgafv
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData E'Xgafv where toQueryParam :: E'Xgafv -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (E'Xgafv -> Text) -> E'Xgafv -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E'Xgafv -> Text
fromE'Xgafv
instance WH.FromHttpApiData E'Xgafv where parseQueryParam :: Text -> Either Text E'Xgafv
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text E'Xgafv) -> Either Text E'Xgafv
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] E'Xgafv -> Either Text E'Xgafv
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] E'Xgafv -> Either Text E'Xgafv)
-> (Text -> Either [Char] E'Xgafv) -> Text -> Either Text E'Xgafv
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] E'Xgafv
toE'Xgafv
instance MimeRender MimeMultipartFormData E'Xgafv where mimeRender :: Proxy MimeMultipartFormData -> E'Xgafv -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = E'Xgafv -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromE'Xgafv :: E'Xgafv -> Text
fromE'Xgafv :: E'Xgafv -> Text
fromE'Xgafv = \case
E'Xgafv
E'Xgafv'1 -> Text
"1"
E'Xgafv
E'Xgafv'2 -> Text
"2"
toE'Xgafv :: Text -> P.Either String E'Xgafv
toE'Xgafv :: Text -> Either [Char] E'Xgafv
toE'Xgafv = \case
Text
"1" -> E'Xgafv -> Either [Char] E'Xgafv
forall a b. b -> Either a b
P.Right E'Xgafv
E'Xgafv'1
Text
"2" -> E'Xgafv -> Either [Char] E'Xgafv
forall a b. b -> Either a b
P.Right E'Xgafv
E'Xgafv'2
Text
s -> [Char] -> Either [Char] E'Xgafv
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] E'Xgafv)
-> [Char] -> Either [Char] E'Xgafv
forall a b. (a -> b) -> a -> b
$ [Char]
"toE'Xgafv: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data HarmCategory
=
HarmCategory'UNSPECIFIED
|
HarmCategory'DEROGATORY
|
HarmCategory'TOXICITY
|
HarmCategory'VIOLENCE
|
HarmCategory'SEXUAL
|
HarmCategory'MEDICAL
|
HarmCategory'DANGEROUS
|
HarmCategory'HARASSMENT
|
HarmCategory'HATE_SPEECH
|
HarmCategory'SEXUALLY_EXPLICIT
|
HarmCategory'DANGEROUS_CONTENT
|
HarmCategory'CIVIC_INTEGRITY
deriving (Int -> HarmCategory -> ShowS
[HarmCategory] -> ShowS
HarmCategory -> [Char]
(Int -> HarmCategory -> ShowS)
-> (HarmCategory -> [Char])
-> ([HarmCategory] -> ShowS)
-> Show HarmCategory
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HarmCategory -> ShowS
showsPrec :: Int -> HarmCategory -> ShowS
$cshow :: HarmCategory -> [Char]
show :: HarmCategory -> [Char]
$cshowList :: [HarmCategory] -> ShowS
showList :: [HarmCategory] -> ShowS
P.Show, HarmCategory -> HarmCategory -> Bool
(HarmCategory -> HarmCategory -> Bool)
-> (HarmCategory -> HarmCategory -> Bool) -> Eq HarmCategory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HarmCategory -> HarmCategory -> Bool
== :: HarmCategory -> HarmCategory -> Bool
$c/= :: HarmCategory -> HarmCategory -> Bool
/= :: HarmCategory -> HarmCategory -> Bool
P.Eq, P.Typeable, Eq HarmCategory
Eq HarmCategory =>
(HarmCategory -> HarmCategory -> Ordering)
-> (HarmCategory -> HarmCategory -> Bool)
-> (HarmCategory -> HarmCategory -> Bool)
-> (HarmCategory -> HarmCategory -> Bool)
-> (HarmCategory -> HarmCategory -> Bool)
-> (HarmCategory -> HarmCategory -> HarmCategory)
-> (HarmCategory -> HarmCategory -> HarmCategory)
-> Ord HarmCategory
HarmCategory -> HarmCategory -> Bool
HarmCategory -> HarmCategory -> Ordering
HarmCategory -> HarmCategory -> HarmCategory
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
$ccompare :: HarmCategory -> HarmCategory -> Ordering
compare :: HarmCategory -> HarmCategory -> Ordering
$c< :: HarmCategory -> HarmCategory -> Bool
< :: HarmCategory -> HarmCategory -> Bool
$c<= :: HarmCategory -> HarmCategory -> Bool
<= :: HarmCategory -> HarmCategory -> Bool
$c> :: HarmCategory -> HarmCategory -> Bool
> :: HarmCategory -> HarmCategory -> Bool
$c>= :: HarmCategory -> HarmCategory -> Bool
>= :: HarmCategory -> HarmCategory -> Bool
$cmax :: HarmCategory -> HarmCategory -> HarmCategory
max :: HarmCategory -> HarmCategory -> HarmCategory
$cmin :: HarmCategory -> HarmCategory -> HarmCategory
min :: HarmCategory -> HarmCategory -> HarmCategory
P.Ord, HarmCategory
HarmCategory -> HarmCategory -> Bounded HarmCategory
forall a. a -> a -> Bounded a
$cminBound :: HarmCategory
minBound :: HarmCategory
$cmaxBound :: HarmCategory
maxBound :: HarmCategory
P.Bounded, Int -> HarmCategory
HarmCategory -> Int
HarmCategory -> [HarmCategory]
HarmCategory -> HarmCategory
HarmCategory -> HarmCategory -> [HarmCategory]
HarmCategory -> HarmCategory -> HarmCategory -> [HarmCategory]
(HarmCategory -> HarmCategory)
-> (HarmCategory -> HarmCategory)
-> (Int -> HarmCategory)
-> (HarmCategory -> Int)
-> (HarmCategory -> [HarmCategory])
-> (HarmCategory -> HarmCategory -> [HarmCategory])
-> (HarmCategory -> HarmCategory -> [HarmCategory])
-> (HarmCategory -> HarmCategory -> HarmCategory -> [HarmCategory])
-> Enum HarmCategory
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: HarmCategory -> HarmCategory
succ :: HarmCategory -> HarmCategory
$cpred :: HarmCategory -> HarmCategory
pred :: HarmCategory -> HarmCategory
$ctoEnum :: Int -> HarmCategory
toEnum :: Int -> HarmCategory
$cfromEnum :: HarmCategory -> Int
fromEnum :: HarmCategory -> Int
$cenumFrom :: HarmCategory -> [HarmCategory]
enumFrom :: HarmCategory -> [HarmCategory]
$cenumFromThen :: HarmCategory -> HarmCategory -> [HarmCategory]
enumFromThen :: HarmCategory -> HarmCategory -> [HarmCategory]
$cenumFromTo :: HarmCategory -> HarmCategory -> [HarmCategory]
enumFromTo :: HarmCategory -> HarmCategory -> [HarmCategory]
$cenumFromThenTo :: HarmCategory -> HarmCategory -> HarmCategory -> [HarmCategory]
enumFromThenTo :: HarmCategory -> HarmCategory -> HarmCategory -> [HarmCategory]
P.Enum)
instance A.ToJSON HarmCategory where toJSON :: HarmCategory -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (HarmCategory -> Text) -> HarmCategory -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HarmCategory -> Text
fromHarmCategory
instance A.FromJSON HarmCategory where parseJSON :: Value -> Parser HarmCategory
parseJSON Value
o = ([Char] -> Parser HarmCategory)
-> (HarmCategory -> Parser HarmCategory)
-> Either [Char] HarmCategory
-> Parser HarmCategory
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser HarmCategory
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (HarmCategory -> Parser HarmCategory
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HarmCategory -> Parser HarmCategory)
-> (HarmCategory -> HarmCategory)
-> HarmCategory
-> Parser HarmCategory
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HarmCategory -> HarmCategory
forall a. a -> a
P.id) (Either [Char] HarmCategory -> Parser HarmCategory)
-> (Text -> Either [Char] HarmCategory)
-> Text
-> Parser HarmCategory
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] HarmCategory
toHarmCategory (Text -> Parser HarmCategory) -> Parser Text -> Parser HarmCategory
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData HarmCategory where toQueryParam :: HarmCategory -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (HarmCategory -> Text) -> HarmCategory -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HarmCategory -> Text
fromHarmCategory
instance WH.FromHttpApiData HarmCategory where parseQueryParam :: Text -> Either Text HarmCategory
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text HarmCategory) -> Either Text HarmCategory
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] HarmCategory -> Either Text HarmCategory
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] HarmCategory -> Either Text HarmCategory)
-> (Text -> Either [Char] HarmCategory)
-> Text
-> Either Text HarmCategory
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] HarmCategory
toHarmCategory
instance MimeRender MimeMultipartFormData HarmCategory where mimeRender :: Proxy MimeMultipartFormData -> HarmCategory -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = HarmCategory -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromHarmCategory :: HarmCategory -> Text
fromHarmCategory :: HarmCategory -> Text
fromHarmCategory = \case
HarmCategory
HarmCategory'UNSPECIFIED -> Text
"HARM_CATEGORY_UNSPECIFIED"
HarmCategory
HarmCategory'DEROGATORY -> Text
"HARM_CATEGORY_DEROGATORY"
HarmCategory
HarmCategory'TOXICITY -> Text
"HARM_CATEGORY_TOXICITY"
HarmCategory
HarmCategory'VIOLENCE -> Text
"HARM_CATEGORY_VIOLENCE"
HarmCategory
HarmCategory'SEXUAL -> Text
"HARM_CATEGORY_SEXUAL"
HarmCategory
HarmCategory'MEDICAL -> Text
"HARM_CATEGORY_MEDICAL"
HarmCategory
HarmCategory'DANGEROUS -> Text
"HARM_CATEGORY_DANGEROUS"
HarmCategory
HarmCategory'HARASSMENT -> Text
"HARM_CATEGORY_HARASSMENT"
HarmCategory
HarmCategory'HATE_SPEECH -> Text
"HARM_CATEGORY_HATE_SPEECH"
HarmCategory
HarmCategory'SEXUALLY_EXPLICIT -> Text
"HARM_CATEGORY_SEXUALLY_EXPLICIT"
HarmCategory
HarmCategory'DANGEROUS_CONTENT -> Text
"HARM_CATEGORY_DANGEROUS_CONTENT"
HarmCategory
HarmCategory'CIVIC_INTEGRITY -> Text
"HARM_CATEGORY_CIVIC_INTEGRITY"
toHarmCategory :: Text -> P.Either String HarmCategory
toHarmCategory :: Text -> Either [Char] HarmCategory
toHarmCategory = \case
Text
"HARM_CATEGORY_UNSPECIFIED" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'UNSPECIFIED
Text
"HARM_CATEGORY_DEROGATORY" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'DEROGATORY
Text
"HARM_CATEGORY_TOXICITY" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'TOXICITY
Text
"HARM_CATEGORY_VIOLENCE" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'VIOLENCE
Text
"HARM_CATEGORY_SEXUAL" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'SEXUAL
Text
"HARM_CATEGORY_MEDICAL" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'MEDICAL
Text
"HARM_CATEGORY_DANGEROUS" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'DANGEROUS
Text
"HARM_CATEGORY_HARASSMENT" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'HARASSMENT
Text
"HARM_CATEGORY_HATE_SPEECH" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'HATE_SPEECH
Text
"HARM_CATEGORY_SEXUALLY_EXPLICIT" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'SEXUALLY_EXPLICIT
Text
"HARM_CATEGORY_DANGEROUS_CONTENT" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'DANGEROUS_CONTENT
Text
"HARM_CATEGORY_CIVIC_INTEGRITY" -> HarmCategory -> Either [Char] HarmCategory
forall a b. b -> Either a b
P.Right HarmCategory
HarmCategory'CIVIC_INTEGRITY
Text
s -> [Char] -> Either [Char] HarmCategory
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] HarmCategory)
-> [Char] -> Either [Char] HarmCategory
forall a b. (a -> b) -> a -> b
$ [Char]
"toHarmCategory: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data Modality
=
Modality'MODALITY_UNSPECIFIED
|
Modality'TEXT
|
Modality'IMAGE
|
Modality'VIDEO
|
Modality'AUDIO
|
Modality'DOCUMENT
deriving (Int -> Modality -> ShowS
[Modality] -> ShowS
Modality -> [Char]
(Int -> Modality -> ShowS)
-> (Modality -> [Char]) -> ([Modality] -> ShowS) -> Show Modality
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Modality -> ShowS
showsPrec :: Int -> Modality -> ShowS
$cshow :: Modality -> [Char]
show :: Modality -> [Char]
$cshowList :: [Modality] -> ShowS
showList :: [Modality] -> ShowS
P.Show, Modality -> Modality -> Bool
(Modality -> Modality -> Bool)
-> (Modality -> Modality -> Bool) -> Eq Modality
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Modality -> Modality -> Bool
== :: Modality -> Modality -> Bool
$c/= :: Modality -> Modality -> Bool
/= :: Modality -> Modality -> Bool
P.Eq, P.Typeable, Eq Modality
Eq Modality =>
(Modality -> Modality -> Ordering)
-> (Modality -> Modality -> Bool)
-> (Modality -> Modality -> Bool)
-> (Modality -> Modality -> Bool)
-> (Modality -> Modality -> Bool)
-> (Modality -> Modality -> Modality)
-> (Modality -> Modality -> Modality)
-> Ord Modality
Modality -> Modality -> Bool
Modality -> Modality -> Ordering
Modality -> Modality -> Modality
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
$ccompare :: Modality -> Modality -> Ordering
compare :: Modality -> Modality -> Ordering
$c< :: Modality -> Modality -> Bool
< :: Modality -> Modality -> Bool
$c<= :: Modality -> Modality -> Bool
<= :: Modality -> Modality -> Bool
$c> :: Modality -> Modality -> Bool
> :: Modality -> Modality -> Bool
$c>= :: Modality -> Modality -> Bool
>= :: Modality -> Modality -> Bool
$cmax :: Modality -> Modality -> Modality
max :: Modality -> Modality -> Modality
$cmin :: Modality -> Modality -> Modality
min :: Modality -> Modality -> Modality
P.Ord, Modality
Modality -> Modality -> Bounded Modality
forall a. a -> a -> Bounded a
$cminBound :: Modality
minBound :: Modality
$cmaxBound :: Modality
maxBound :: Modality
P.Bounded, Int -> Modality
Modality -> Int
Modality -> [Modality]
Modality -> Modality
Modality -> Modality -> [Modality]
Modality -> Modality -> Modality -> [Modality]
(Modality -> Modality)
-> (Modality -> Modality)
-> (Int -> Modality)
-> (Modality -> Int)
-> (Modality -> [Modality])
-> (Modality -> Modality -> [Modality])
-> (Modality -> Modality -> [Modality])
-> (Modality -> Modality -> Modality -> [Modality])
-> Enum Modality
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Modality -> Modality
succ :: Modality -> Modality
$cpred :: Modality -> Modality
pred :: Modality -> Modality
$ctoEnum :: Int -> Modality
toEnum :: Int -> Modality
$cfromEnum :: Modality -> Int
fromEnum :: Modality -> Int
$cenumFrom :: Modality -> [Modality]
enumFrom :: Modality -> [Modality]
$cenumFromThen :: Modality -> Modality -> [Modality]
enumFromThen :: Modality -> Modality -> [Modality]
$cenumFromTo :: Modality -> Modality -> [Modality]
enumFromTo :: Modality -> Modality -> [Modality]
$cenumFromThenTo :: Modality -> Modality -> Modality -> [Modality]
enumFromThenTo :: Modality -> Modality -> Modality -> [Modality]
P.Enum)
instance A.ToJSON Modality where toJSON :: Modality -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (Modality -> Text) -> Modality -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Modality -> Text
fromModality
instance A.FromJSON Modality where parseJSON :: Value -> Parser Modality
parseJSON Value
o = ([Char] -> Parser Modality)
-> (Modality -> Parser Modality)
-> Either [Char] Modality
-> Parser Modality
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser Modality
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (Modality -> Parser Modality
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Modality -> Parser Modality)
-> (Modality -> Modality) -> Modality -> Parser Modality
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Modality -> Modality
forall a. a -> a
P.id) (Either [Char] Modality -> Parser Modality)
-> (Text -> Either [Char] Modality) -> Text -> Parser Modality
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] Modality
toModality (Text -> Parser Modality) -> Parser Text -> Parser Modality
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData Modality where toQueryParam :: Modality -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (Modality -> Text) -> Modality -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Modality -> Text
fromModality
instance WH.FromHttpApiData Modality where parseQueryParam :: Text -> Either Text Modality
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text Modality) -> Either Text Modality
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] Modality -> Either Text Modality
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] Modality -> Either Text Modality)
-> (Text -> Either [Char] Modality) -> Text -> Either Text Modality
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] Modality
toModality
instance MimeRender MimeMultipartFormData Modality where mimeRender :: Proxy MimeMultipartFormData -> Modality -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = Modality -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromModality :: Modality -> Text
fromModality :: Modality -> Text
fromModality = \case
Modality
Modality'MODALITY_UNSPECIFIED -> Text
"MODALITY_UNSPECIFIED"
Modality
Modality'TEXT -> Text
"TEXT"
Modality
Modality'IMAGE -> Text
"IMAGE"
Modality
Modality'VIDEO -> Text
"VIDEO"
Modality
Modality'AUDIO -> Text
"AUDIO"
Modality
Modality'DOCUMENT -> Text
"DOCUMENT"
toModality :: Text -> P.Either String Modality
toModality :: Text -> Either [Char] Modality
toModality = \case
Text
"MODALITY_UNSPECIFIED" -> Modality -> Either [Char] Modality
forall a b. b -> Either a b
P.Right Modality
Modality'MODALITY_UNSPECIFIED
Text
"TEXT" -> Modality -> Either [Char] Modality
forall a b. b -> Either a b
P.Right Modality
Modality'TEXT
Text
"IMAGE" -> Modality -> Either [Char] Modality
forall a b. b -> Either a b
P.Right Modality
Modality'IMAGE
Text
"VIDEO" -> Modality -> Either [Char] Modality
forall a b. b -> Either a b
P.Right Modality
Modality'VIDEO
Text
"AUDIO" -> Modality -> Either [Char] Modality
forall a b. b -> Either a b
P.Right Modality
Modality'AUDIO
Text
"DOCUMENT" -> Modality -> Either [Char] Modality
forall a b. b -> Either a b
P.Right Modality
Modality'DOCUMENT
Text
s -> [Char] -> Either [Char] Modality
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] Modality)
-> [Char] -> Either [Char] Modality
forall a b. (a -> b) -> a -> b
$ [Char]
"toModality: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data ModelType
=
ModelType'TYPE_UNSPECIFIED
|
ModelType'STRING
|
ModelType'NUMBER
|
ModelType'INTEGER
|
ModelType'BOOLEAN
|
ModelType'ARRAY
|
ModelType'OBJECT
|
ModelType'NULL
deriving (Int -> ModelType -> ShowS
[ModelType] -> ShowS
ModelType -> [Char]
(Int -> ModelType -> ShowS)
-> (ModelType -> [Char])
-> ([ModelType] -> ShowS)
-> Show ModelType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ModelType -> ShowS
showsPrec :: Int -> ModelType -> ShowS
$cshow :: ModelType -> [Char]
show :: ModelType -> [Char]
$cshowList :: [ModelType] -> ShowS
showList :: [ModelType] -> ShowS
P.Show, ModelType -> ModelType -> Bool
(ModelType -> ModelType -> Bool)
-> (ModelType -> ModelType -> Bool) -> Eq ModelType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModelType -> ModelType -> Bool
== :: ModelType -> ModelType -> Bool
$c/= :: ModelType -> ModelType -> Bool
/= :: ModelType -> ModelType -> Bool
P.Eq, P.Typeable, Eq ModelType
Eq ModelType =>
(ModelType -> ModelType -> Ordering)
-> (ModelType -> ModelType -> Bool)
-> (ModelType -> ModelType -> Bool)
-> (ModelType -> ModelType -> Bool)
-> (ModelType -> ModelType -> Bool)
-> (ModelType -> ModelType -> ModelType)
-> (ModelType -> ModelType -> ModelType)
-> Ord ModelType
ModelType -> ModelType -> Bool
ModelType -> ModelType -> Ordering
ModelType -> ModelType -> ModelType
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
$ccompare :: ModelType -> ModelType -> Ordering
compare :: ModelType -> ModelType -> Ordering
$c< :: ModelType -> ModelType -> Bool
< :: ModelType -> ModelType -> Bool
$c<= :: ModelType -> ModelType -> Bool
<= :: ModelType -> ModelType -> Bool
$c> :: ModelType -> ModelType -> Bool
> :: ModelType -> ModelType -> Bool
$c>= :: ModelType -> ModelType -> Bool
>= :: ModelType -> ModelType -> Bool
$cmax :: ModelType -> ModelType -> ModelType
max :: ModelType -> ModelType -> ModelType
$cmin :: ModelType -> ModelType -> ModelType
min :: ModelType -> ModelType -> ModelType
P.Ord, ModelType
ModelType -> ModelType -> Bounded ModelType
forall a. a -> a -> Bounded a
$cminBound :: ModelType
minBound :: ModelType
$cmaxBound :: ModelType
maxBound :: ModelType
P.Bounded, Int -> ModelType
ModelType -> Int
ModelType -> [ModelType]
ModelType -> ModelType
ModelType -> ModelType -> [ModelType]
ModelType -> ModelType -> ModelType -> [ModelType]
(ModelType -> ModelType)
-> (ModelType -> ModelType)
-> (Int -> ModelType)
-> (ModelType -> Int)
-> (ModelType -> [ModelType])
-> (ModelType -> ModelType -> [ModelType])
-> (ModelType -> ModelType -> [ModelType])
-> (ModelType -> ModelType -> ModelType -> [ModelType])
-> Enum ModelType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ModelType -> ModelType
succ :: ModelType -> ModelType
$cpred :: ModelType -> ModelType
pred :: ModelType -> ModelType
$ctoEnum :: Int -> ModelType
toEnum :: Int -> ModelType
$cfromEnum :: ModelType -> Int
fromEnum :: ModelType -> Int
$cenumFrom :: ModelType -> [ModelType]
enumFrom :: ModelType -> [ModelType]
$cenumFromThen :: ModelType -> ModelType -> [ModelType]
enumFromThen :: ModelType -> ModelType -> [ModelType]
$cenumFromTo :: ModelType -> ModelType -> [ModelType]
enumFromTo :: ModelType -> ModelType -> [ModelType]
$cenumFromThenTo :: ModelType -> ModelType -> ModelType -> [ModelType]
enumFromThenTo :: ModelType -> ModelType -> ModelType -> [ModelType]
P.Enum)
instance A.ToJSON ModelType where toJSON :: ModelType -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (ModelType -> Text) -> ModelType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModelType -> Text
fromModelType
instance A.FromJSON ModelType where parseJSON :: Value -> Parser ModelType
parseJSON Value
o = ([Char] -> Parser ModelType)
-> (ModelType -> Parser ModelType)
-> Either [Char] ModelType
-> Parser ModelType
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser ModelType
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (ModelType -> Parser ModelType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ModelType -> Parser ModelType)
-> (ModelType -> ModelType) -> ModelType -> Parser ModelType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModelType -> ModelType
forall a. a -> a
P.id) (Either [Char] ModelType -> Parser ModelType)
-> (Text -> Either [Char] ModelType) -> Text -> Parser ModelType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] ModelType
toModelType (Text -> Parser ModelType) -> Parser Text -> Parser ModelType
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData ModelType where toQueryParam :: ModelType -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (ModelType -> Text) -> ModelType -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModelType -> Text
fromModelType
instance WH.FromHttpApiData ModelType where parseQueryParam :: Text -> Either Text ModelType
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text ModelType) -> Either Text ModelType
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text)
-> Either [Char] ModelType -> Either Text ModelType
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] ModelType -> Either Text ModelType)
-> (Text -> Either [Char] ModelType)
-> Text
-> Either Text ModelType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] ModelType
toModelType
instance MimeRender MimeMultipartFormData ModelType where mimeRender :: Proxy MimeMultipartFormData -> ModelType -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = ModelType -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromModelType :: ModelType -> Text
fromModelType :: ModelType -> Text
fromModelType = \case
ModelType
ModelType'TYPE_UNSPECIFIED -> Text
"TYPE_UNSPECIFIED"
ModelType
ModelType'STRING -> Text
"STRING"
ModelType
ModelType'NUMBER -> Text
"NUMBER"
ModelType
ModelType'INTEGER -> Text
"INTEGER"
ModelType
ModelType'BOOLEAN -> Text
"BOOLEAN"
ModelType
ModelType'ARRAY -> Text
"ARRAY"
ModelType
ModelType'OBJECT -> Text
"OBJECT"
ModelType
ModelType'NULL -> Text
"NULL"
toModelType :: Text -> P.Either String ModelType
toModelType :: Text -> Either [Char] ModelType
toModelType = \case
Text
"TYPE_UNSPECIFIED" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'TYPE_UNSPECIFIED
Text
"STRING" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'STRING
Text
"NUMBER" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'NUMBER
Text
"INTEGER" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'INTEGER
Text
"BOOLEAN" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'BOOLEAN
Text
"ARRAY" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'ARRAY
Text
"OBJECT" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'OBJECT
Text
"NULL" -> ModelType -> Either [Char] ModelType
forall a b. b -> Either a b
P.Right ModelType
ModelType'NULL
Text
s -> [Char] -> Either [Char] ModelType
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] ModelType)
-> [Char] -> Either [Char] ModelType
forall a b. (a -> b) -> a -> b
$ [Char]
"toModelType: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s
data TaskType
=
TaskType'TASK_TYPE_UNSPECIFIED
|
TaskType'RETRIEVAL_QUERY
|
TaskType'RETRIEVAL_DOCUMENT
|
TaskType'SEMANTIC_SIMILARITY
|
TaskType'CLASSIFICATION
|
TaskType'CLUSTERING
|
TaskType'QUESTION_ANSWERING
|
TaskType'FACT_VERIFICATION
|
TaskType'CODE_RETRIEVAL_QUERY
deriving (Int -> TaskType -> ShowS
[TaskType] -> ShowS
TaskType -> [Char]
(Int -> TaskType -> ShowS)
-> (TaskType -> [Char]) -> ([TaskType] -> ShowS) -> Show TaskType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TaskType -> ShowS
showsPrec :: Int -> TaskType -> ShowS
$cshow :: TaskType -> [Char]
show :: TaskType -> [Char]
$cshowList :: [TaskType] -> ShowS
showList :: [TaskType] -> ShowS
P.Show, TaskType -> TaskType -> Bool
(TaskType -> TaskType -> Bool)
-> (TaskType -> TaskType -> Bool) -> Eq TaskType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TaskType -> TaskType -> Bool
== :: TaskType -> TaskType -> Bool
$c/= :: TaskType -> TaskType -> Bool
/= :: TaskType -> TaskType -> Bool
P.Eq, P.Typeable, Eq TaskType
Eq TaskType =>
(TaskType -> TaskType -> Ordering)
-> (TaskType -> TaskType -> Bool)
-> (TaskType -> TaskType -> Bool)
-> (TaskType -> TaskType -> Bool)
-> (TaskType -> TaskType -> Bool)
-> (TaskType -> TaskType -> TaskType)
-> (TaskType -> TaskType -> TaskType)
-> Ord TaskType
TaskType -> TaskType -> Bool
TaskType -> TaskType -> Ordering
TaskType -> TaskType -> TaskType
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
$ccompare :: TaskType -> TaskType -> Ordering
compare :: TaskType -> TaskType -> Ordering
$c< :: TaskType -> TaskType -> Bool
< :: TaskType -> TaskType -> Bool
$c<= :: TaskType -> TaskType -> Bool
<= :: TaskType -> TaskType -> Bool
$c> :: TaskType -> TaskType -> Bool
> :: TaskType -> TaskType -> Bool
$c>= :: TaskType -> TaskType -> Bool
>= :: TaskType -> TaskType -> Bool
$cmax :: TaskType -> TaskType -> TaskType
max :: TaskType -> TaskType -> TaskType
$cmin :: TaskType -> TaskType -> TaskType
min :: TaskType -> TaskType -> TaskType
P.Ord, TaskType
TaskType -> TaskType -> Bounded TaskType
forall a. a -> a -> Bounded a
$cminBound :: TaskType
minBound :: TaskType
$cmaxBound :: TaskType
maxBound :: TaskType
P.Bounded, Int -> TaskType
TaskType -> Int
TaskType -> [TaskType]
TaskType -> TaskType
TaskType -> TaskType -> [TaskType]
TaskType -> TaskType -> TaskType -> [TaskType]
(TaskType -> TaskType)
-> (TaskType -> TaskType)
-> (Int -> TaskType)
-> (TaskType -> Int)
-> (TaskType -> [TaskType])
-> (TaskType -> TaskType -> [TaskType])
-> (TaskType -> TaskType -> [TaskType])
-> (TaskType -> TaskType -> TaskType -> [TaskType])
-> Enum TaskType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: TaskType -> TaskType
succ :: TaskType -> TaskType
$cpred :: TaskType -> TaskType
pred :: TaskType -> TaskType
$ctoEnum :: Int -> TaskType
toEnum :: Int -> TaskType
$cfromEnum :: TaskType -> Int
fromEnum :: TaskType -> Int
$cenumFrom :: TaskType -> [TaskType]
enumFrom :: TaskType -> [TaskType]
$cenumFromThen :: TaskType -> TaskType -> [TaskType]
enumFromThen :: TaskType -> TaskType -> [TaskType]
$cenumFromTo :: TaskType -> TaskType -> [TaskType]
enumFromTo :: TaskType -> TaskType -> [TaskType]
$cenumFromThenTo :: TaskType -> TaskType -> TaskType -> [TaskType]
enumFromThenTo :: TaskType -> TaskType -> TaskType -> [TaskType]
P.Enum)
instance A.ToJSON TaskType where toJSON :: TaskType -> Value
toJSON = Text -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Text -> Value) -> (TaskType -> Text) -> TaskType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TaskType -> Text
fromTaskType
instance A.FromJSON TaskType where parseJSON :: Value -> Parser TaskType
parseJSON Value
o = ([Char] -> Parser TaskType)
-> (TaskType -> Parser TaskType)
-> Either [Char] TaskType
-> Parser TaskType
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
P.either [Char] -> Parser TaskType
forall a. [Char] -> Parser a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
P.fail (TaskType -> Parser TaskType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (TaskType -> Parser TaskType)
-> (TaskType -> TaskType) -> TaskType -> Parser TaskType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TaskType -> TaskType
forall a. a -> a
P.id) (Either [Char] TaskType -> Parser TaskType)
-> (Text -> Either [Char] TaskType) -> Text -> Parser TaskType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] TaskType
toTaskType (Text -> Parser TaskType) -> Parser Text -> Parser TaskType
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
A.parseJSON Value
o
instance WH.ToHttpApiData TaskType where toQueryParam :: TaskType -> Text
toQueryParam = Text -> Text
forall a. ToHttpApiData a => a -> Text
WH.toQueryParam (Text -> Text) -> (TaskType -> Text) -> TaskType -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TaskType -> Text
fromTaskType
instance WH.FromHttpApiData TaskType where parseQueryParam :: Text -> Either Text TaskType
parseQueryParam Text
o = Text -> Either Text Text
forall a. FromHttpApiData a => Text -> Either Text a
WH.parseQueryParam Text
o Either Text Text
-> (Text -> Either Text TaskType) -> Either Text TaskType
forall a b. Either Text a -> (a -> Either Text b) -> Either Text b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ([Char] -> Text) -> Either [Char] TaskType -> Either Text TaskType
forall b c d. (b -> c) -> Either b d -> Either c d
forall (a :: * -> * -> *) b c d.
ArrowChoice a =>
a b c -> a (Either b d) (Either c d)
P.left [Char] -> Text
T.pack (Either [Char] TaskType -> Either Text TaskType)
-> (Text -> Either [Char] TaskType) -> Text -> Either Text TaskType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either [Char] TaskType
toTaskType
instance MimeRender MimeMultipartFormData TaskType where mimeRender :: Proxy MimeMultipartFormData -> TaskType -> ByteString
mimeRender Proxy MimeMultipartFormData
_ = TaskType -> ByteString
forall a. ToHttpApiData a => a -> ByteString
mimeRenderDefaultMultipartFormData
fromTaskType :: TaskType -> Text
fromTaskType :: TaskType -> Text
fromTaskType = \case
TaskType
TaskType'TASK_TYPE_UNSPECIFIED -> Text
"TASK_TYPE_UNSPECIFIED"
TaskType
TaskType'RETRIEVAL_QUERY -> Text
"RETRIEVAL_QUERY"
TaskType
TaskType'RETRIEVAL_DOCUMENT -> Text
"RETRIEVAL_DOCUMENT"
TaskType
TaskType'SEMANTIC_SIMILARITY -> Text
"SEMANTIC_SIMILARITY"
TaskType
TaskType'CLASSIFICATION -> Text
"CLASSIFICATION"
TaskType
TaskType'CLUSTERING -> Text
"CLUSTERING"
TaskType
TaskType'QUESTION_ANSWERING -> Text
"QUESTION_ANSWERING"
TaskType
TaskType'FACT_VERIFICATION -> Text
"FACT_VERIFICATION"
TaskType
TaskType'CODE_RETRIEVAL_QUERY -> Text
"CODE_RETRIEVAL_QUERY"
toTaskType :: Text -> P.Either String TaskType
toTaskType :: Text -> Either [Char] TaskType
toTaskType = \case
Text
"TASK_TYPE_UNSPECIFIED" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'TASK_TYPE_UNSPECIFIED
Text
"RETRIEVAL_QUERY" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'RETRIEVAL_QUERY
Text
"RETRIEVAL_DOCUMENT" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'RETRIEVAL_DOCUMENT
Text
"SEMANTIC_SIMILARITY" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'SEMANTIC_SIMILARITY
Text
"CLASSIFICATION" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'CLASSIFICATION
Text
"CLUSTERING" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'CLUSTERING
Text
"QUESTION_ANSWERING" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'QUESTION_ANSWERING
Text
"FACT_VERIFICATION" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'FACT_VERIFICATION
Text
"CODE_RETRIEVAL_QUERY" -> TaskType -> Either [Char] TaskType
forall a b. b -> Either a b
P.Right TaskType
TaskType'CODE_RETRIEVAL_QUERY
Text
s -> [Char] -> Either [Char] TaskType
forall a b. a -> Either a b
P.Left ([Char] -> Either [Char] TaskType)
-> [Char] -> Either [Char] TaskType
forall a b. (a -> b) -> a -> b
$ [Char]
"toTaskType: enum parse failure: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
P.++ Text -> [Char]
forall a. Show a => a -> [Char]
P.show Text
s