{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.RDSData.Types.Field where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDSData.Types.ArrayValue
data Field = Field'
{
Field -> Maybe ArrayValue
arrayValue :: Prelude.Maybe ArrayValue,
Field -> Maybe Base64
blobValue :: Prelude.Maybe Data.Base64,
Field -> Maybe Bool
booleanValue :: Prelude.Maybe Prelude.Bool,
Field -> Maybe Double
doubleValue :: Prelude.Maybe Prelude.Double,
Field -> Maybe Bool
isNull :: Prelude.Maybe Prelude.Bool,
Field -> Maybe Integer
longValue :: Prelude.Maybe Prelude.Integer,
Field -> Maybe Text
stringValue :: Prelude.Maybe Prelude.Text
}
deriving (Field -> Field -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Field -> Field -> Bool
$c/= :: Field -> Field -> Bool
== :: Field -> Field -> Bool
$c== :: Field -> Field -> Bool
Prelude.Eq, ReadPrec [Field]
ReadPrec Field
Int -> ReadS Field
ReadS [Field]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Field]
$creadListPrec :: ReadPrec [Field]
readPrec :: ReadPrec Field
$creadPrec :: ReadPrec Field
readList :: ReadS [Field]
$creadList :: ReadS [Field]
readsPrec :: Int -> ReadS Field
$creadsPrec :: Int -> ReadS Field
Prelude.Read, Int -> Field -> ShowS
[Field] -> ShowS
Field -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Field] -> ShowS
$cshowList :: [Field] -> ShowS
show :: Field -> String
$cshow :: Field -> String
showsPrec :: Int -> Field -> ShowS
$cshowsPrec :: Int -> Field -> ShowS
Prelude.Show, forall x. Rep Field x -> Field
forall x. Field -> Rep Field x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Field x -> Field
$cfrom :: forall x. Field -> Rep Field x
Prelude.Generic)
newField ::
Field
newField :: Field
newField =
Field'
{ $sel:arrayValue:Field' :: Maybe ArrayValue
arrayValue = forall a. Maybe a
Prelude.Nothing,
$sel:blobValue:Field' :: Maybe Base64
blobValue = forall a. Maybe a
Prelude.Nothing,
$sel:booleanValue:Field' :: Maybe Bool
booleanValue = forall a. Maybe a
Prelude.Nothing,
$sel:doubleValue:Field' :: Maybe Double
doubleValue = forall a. Maybe a
Prelude.Nothing,
$sel:isNull:Field' :: Maybe Bool
isNull = forall a. Maybe a
Prelude.Nothing,
$sel:longValue:Field' :: Maybe Integer
longValue = forall a. Maybe a
Prelude.Nothing,
$sel:stringValue:Field' :: Maybe Text
stringValue = forall a. Maybe a
Prelude.Nothing
}
field_arrayValue :: Lens.Lens' Field (Prelude.Maybe ArrayValue)
field_arrayValue :: Lens' Field (Maybe ArrayValue)
field_arrayValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Field' {Maybe ArrayValue
arrayValue :: Maybe ArrayValue
$sel:arrayValue:Field' :: Field -> Maybe ArrayValue
arrayValue} -> Maybe ArrayValue
arrayValue) (\s :: Field
s@Field' {} Maybe ArrayValue
a -> Field
s {$sel:arrayValue:Field' :: Maybe ArrayValue
arrayValue = Maybe ArrayValue
a} :: Field)
field_blobValue :: Lens.Lens' Field (Prelude.Maybe Prelude.ByteString)
field_blobValue :: Lens' Field (Maybe ByteString)
field_blobValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Field' {Maybe Base64
blobValue :: Maybe Base64
$sel:blobValue:Field' :: Field -> Maybe Base64
blobValue} -> Maybe Base64
blobValue) (\s :: Field
s@Field' {} Maybe Base64
a -> Field
s {$sel:blobValue:Field' :: Maybe Base64
blobValue = Maybe Base64
a} :: Field) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping Iso' Base64 ByteString
Data._Base64
field_booleanValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Bool)
field_booleanValue :: Lens' Field (Maybe Bool)
field_booleanValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Field' {Maybe Bool
booleanValue :: Maybe Bool
$sel:booleanValue:Field' :: Field -> Maybe Bool
booleanValue} -> Maybe Bool
booleanValue) (\s :: Field
s@Field' {} Maybe Bool
a -> Field
s {$sel:booleanValue:Field' :: Maybe Bool
booleanValue = Maybe Bool
a} :: Field)
field_doubleValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Double)
field_doubleValue :: Lens' Field (Maybe Double)
field_doubleValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Field' {Maybe Double
doubleValue :: Maybe Double
$sel:doubleValue:Field' :: Field -> Maybe Double
doubleValue} -> Maybe Double
doubleValue) (\s :: Field
s@Field' {} Maybe Double
a -> Field
s {$sel:doubleValue:Field' :: Maybe Double
doubleValue = Maybe Double
a} :: Field)
field_isNull :: Lens.Lens' Field (Prelude.Maybe Prelude.Bool)
field_isNull :: Lens' Field (Maybe Bool)
field_isNull = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Field' {Maybe Bool
isNull :: Maybe Bool
$sel:isNull:Field' :: Field -> Maybe Bool
isNull} -> Maybe Bool
isNull) (\s :: Field
s@Field' {} Maybe Bool
a -> Field
s {$sel:isNull:Field' :: Maybe Bool
isNull = Maybe Bool
a} :: Field)
field_longValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Integer)
field_longValue :: Lens' Field (Maybe Integer)
field_longValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Field' {Maybe Integer
longValue :: Maybe Integer
$sel:longValue:Field' :: Field -> Maybe Integer
longValue} -> Maybe Integer
longValue) (\s :: Field
s@Field' {} Maybe Integer
a -> Field
s {$sel:longValue:Field' :: Maybe Integer
longValue = Maybe Integer
a} :: Field)
field_stringValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Text)
field_stringValue :: Lens' Field (Maybe Text)
field_stringValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Field' {Maybe Text
stringValue :: Maybe Text
$sel:stringValue:Field' :: Field -> Maybe Text
stringValue} -> Maybe Text
stringValue) (\s :: Field
s@Field' {} Maybe Text
a -> Field
s {$sel:stringValue:Field' :: Maybe Text
stringValue = Maybe Text
a} :: Field)
instance Data.FromJSON Field where
parseJSON :: Value -> Parser Field
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Field"
( \Object
x ->
Maybe ArrayValue
-> Maybe Base64
-> Maybe Bool
-> Maybe Double
-> Maybe Bool
-> Maybe Integer
-> Maybe Text
-> Field
Field'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arrayValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"blobValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"booleanValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"doubleValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"isNull")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"longValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"stringValue")
)
instance Prelude.Hashable Field where
hashWithSalt :: Int -> Field -> Int
hashWithSalt Int
_salt Field' {Maybe Bool
Maybe Double
Maybe Integer
Maybe Text
Maybe Base64
Maybe ArrayValue
stringValue :: Maybe Text
longValue :: Maybe Integer
isNull :: Maybe Bool
doubleValue :: Maybe Double
booleanValue :: Maybe Bool
blobValue :: Maybe Base64
arrayValue :: Maybe ArrayValue
$sel:stringValue:Field' :: Field -> Maybe Text
$sel:longValue:Field' :: Field -> Maybe Integer
$sel:isNull:Field' :: Field -> Maybe Bool
$sel:doubleValue:Field' :: Field -> Maybe Double
$sel:booleanValue:Field' :: Field -> Maybe Bool
$sel:blobValue:Field' :: Field -> Maybe Base64
$sel:arrayValue:Field' :: Field -> Maybe ArrayValue
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ArrayValue
arrayValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Base64
blobValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
booleanValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
doubleValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isNull
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
longValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stringValue
instance Prelude.NFData Field where
rnf :: Field -> ()
rnf Field' {Maybe Bool
Maybe Double
Maybe Integer
Maybe Text
Maybe Base64
Maybe ArrayValue
stringValue :: Maybe Text
longValue :: Maybe Integer
isNull :: Maybe Bool
doubleValue :: Maybe Double
booleanValue :: Maybe Bool
blobValue :: Maybe Base64
arrayValue :: Maybe ArrayValue
$sel:stringValue:Field' :: Field -> Maybe Text
$sel:longValue:Field' :: Field -> Maybe Integer
$sel:isNull:Field' :: Field -> Maybe Bool
$sel:doubleValue:Field' :: Field -> Maybe Double
$sel:booleanValue:Field' :: Field -> Maybe Bool
$sel:blobValue:Field' :: Field -> Maybe Base64
$sel:arrayValue:Field' :: Field -> Maybe ArrayValue
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ArrayValue
arrayValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Base64
blobValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
booleanValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
doubleValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isNull
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
longValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stringValue
instance Data.ToJSON Field where
toJSON :: Field -> Value
toJSON Field' {Maybe Bool
Maybe Double
Maybe Integer
Maybe Text
Maybe Base64
Maybe ArrayValue
stringValue :: Maybe Text
longValue :: Maybe Integer
isNull :: Maybe Bool
doubleValue :: Maybe Double
booleanValue :: Maybe Bool
blobValue :: Maybe Base64
arrayValue :: Maybe ArrayValue
$sel:stringValue:Field' :: Field -> Maybe Text
$sel:longValue:Field' :: Field -> Maybe Integer
$sel:isNull:Field' :: Field -> Maybe Bool
$sel:doubleValue:Field' :: Field -> Maybe Double
$sel:booleanValue:Field' :: Field -> Maybe Bool
$sel:blobValue:Field' :: Field -> Maybe Base64
$sel:arrayValue:Field' :: Field -> Maybe ArrayValue
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"arrayValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArrayValue
arrayValue,
(Key
"blobValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Base64
blobValue,
(Key
"booleanValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
booleanValue,
(Key
"doubleValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
doubleValue,
(Key
"isNull" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isNull,
(Key
"longValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
longValue,
(Key
"stringValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
stringValue
]
)