{-# 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.Config.Types.StoredQueryMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StoredQueryMetadata = StoredQueryMetadata'
{
StoredQueryMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
StoredQueryMetadata -> Text
queryId :: Prelude.Text,
StoredQueryMetadata -> Text
queryArn :: Prelude.Text,
StoredQueryMetadata -> Text
queryName :: Prelude.Text
}
deriving (StoredQueryMetadata -> StoredQueryMetadata -> Bool
(StoredQueryMetadata -> StoredQueryMetadata -> Bool)
-> (StoredQueryMetadata -> StoredQueryMetadata -> Bool)
-> Eq StoredQueryMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StoredQueryMetadata -> StoredQueryMetadata -> Bool
$c/= :: StoredQueryMetadata -> StoredQueryMetadata -> Bool
== :: StoredQueryMetadata -> StoredQueryMetadata -> Bool
$c== :: StoredQueryMetadata -> StoredQueryMetadata -> Bool
Prelude.Eq, ReadPrec [StoredQueryMetadata]
ReadPrec StoredQueryMetadata
Int -> ReadS StoredQueryMetadata
ReadS [StoredQueryMetadata]
(Int -> ReadS StoredQueryMetadata)
-> ReadS [StoredQueryMetadata]
-> ReadPrec StoredQueryMetadata
-> ReadPrec [StoredQueryMetadata]
-> Read StoredQueryMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StoredQueryMetadata]
$creadListPrec :: ReadPrec [StoredQueryMetadata]
readPrec :: ReadPrec StoredQueryMetadata
$creadPrec :: ReadPrec StoredQueryMetadata
readList :: ReadS [StoredQueryMetadata]
$creadList :: ReadS [StoredQueryMetadata]
readsPrec :: Int -> ReadS StoredQueryMetadata
$creadsPrec :: Int -> ReadS StoredQueryMetadata
Prelude.Read, Int -> StoredQueryMetadata -> ShowS
[StoredQueryMetadata] -> ShowS
StoredQueryMetadata -> String
(Int -> StoredQueryMetadata -> ShowS)
-> (StoredQueryMetadata -> String)
-> ([StoredQueryMetadata] -> ShowS)
-> Show StoredQueryMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StoredQueryMetadata] -> ShowS
$cshowList :: [StoredQueryMetadata] -> ShowS
show :: StoredQueryMetadata -> String
$cshow :: StoredQueryMetadata -> String
showsPrec :: Int -> StoredQueryMetadata -> ShowS
$cshowsPrec :: Int -> StoredQueryMetadata -> ShowS
Prelude.Show, (forall x. StoredQueryMetadata -> Rep StoredQueryMetadata x)
-> (forall x. Rep StoredQueryMetadata x -> StoredQueryMetadata)
-> Generic StoredQueryMetadata
forall x. Rep StoredQueryMetadata x -> StoredQueryMetadata
forall x. StoredQueryMetadata -> Rep StoredQueryMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StoredQueryMetadata x -> StoredQueryMetadata
$cfrom :: forall x. StoredQueryMetadata -> Rep StoredQueryMetadata x
Prelude.Generic)
newStoredQueryMetadata ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StoredQueryMetadata
newStoredQueryMetadata :: Text -> Text -> Text -> StoredQueryMetadata
newStoredQueryMetadata
Text
pQueryId_
Text
pQueryArn_
Text
pQueryName_ =
StoredQueryMetadata' :: Maybe Text -> Text -> Text -> Text -> StoredQueryMetadata
StoredQueryMetadata'
{ $sel:description:StoredQueryMetadata' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:queryId:StoredQueryMetadata' :: Text
queryId = Text
pQueryId_,
$sel:queryArn:StoredQueryMetadata' :: Text
queryArn = Text
pQueryArn_,
$sel:queryName:StoredQueryMetadata' :: Text
queryName = Text
pQueryName_
}
storedQueryMetadata_description :: Lens.Lens' StoredQueryMetadata (Prelude.Maybe Prelude.Text)
storedQueryMetadata_description :: (Maybe Text -> f (Maybe Text))
-> StoredQueryMetadata -> f StoredQueryMetadata
storedQueryMetadata_description = (StoredQueryMetadata -> Maybe Text)
-> (StoredQueryMetadata -> Maybe Text -> StoredQueryMetadata)
-> Lens
StoredQueryMetadata StoredQueryMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StoredQueryMetadata' {Maybe Text
description :: Maybe Text
$sel:description:StoredQueryMetadata' :: StoredQueryMetadata -> Maybe Text
description} -> Maybe Text
description) (\s :: StoredQueryMetadata
s@StoredQueryMetadata' {} Maybe Text
a -> StoredQueryMetadata
s {$sel:description:StoredQueryMetadata' :: Maybe Text
description = Maybe Text
a} :: StoredQueryMetadata)
storedQueryMetadata_queryId :: Lens.Lens' StoredQueryMetadata Prelude.Text
storedQueryMetadata_queryId :: (Text -> f Text) -> StoredQueryMetadata -> f StoredQueryMetadata
storedQueryMetadata_queryId = (StoredQueryMetadata -> Text)
-> (StoredQueryMetadata -> Text -> StoredQueryMetadata)
-> Lens StoredQueryMetadata StoredQueryMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StoredQueryMetadata' {Text
queryId :: Text
$sel:queryId:StoredQueryMetadata' :: StoredQueryMetadata -> Text
queryId} -> Text
queryId) (\s :: StoredQueryMetadata
s@StoredQueryMetadata' {} Text
a -> StoredQueryMetadata
s {$sel:queryId:StoredQueryMetadata' :: Text
queryId = Text
a} :: StoredQueryMetadata)
storedQueryMetadata_queryArn :: Lens.Lens' StoredQueryMetadata Prelude.Text
storedQueryMetadata_queryArn :: (Text -> f Text) -> StoredQueryMetadata -> f StoredQueryMetadata
storedQueryMetadata_queryArn = (StoredQueryMetadata -> Text)
-> (StoredQueryMetadata -> Text -> StoredQueryMetadata)
-> Lens StoredQueryMetadata StoredQueryMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StoredQueryMetadata' {Text
queryArn :: Text
$sel:queryArn:StoredQueryMetadata' :: StoredQueryMetadata -> Text
queryArn} -> Text
queryArn) (\s :: StoredQueryMetadata
s@StoredQueryMetadata' {} Text
a -> StoredQueryMetadata
s {$sel:queryArn:StoredQueryMetadata' :: Text
queryArn = Text
a} :: StoredQueryMetadata)
storedQueryMetadata_queryName :: Lens.Lens' StoredQueryMetadata Prelude.Text
storedQueryMetadata_queryName :: (Text -> f Text) -> StoredQueryMetadata -> f StoredQueryMetadata
storedQueryMetadata_queryName = (StoredQueryMetadata -> Text)
-> (StoredQueryMetadata -> Text -> StoredQueryMetadata)
-> Lens StoredQueryMetadata StoredQueryMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StoredQueryMetadata' {Text
queryName :: Text
$sel:queryName:StoredQueryMetadata' :: StoredQueryMetadata -> Text
queryName} -> Text
queryName) (\s :: StoredQueryMetadata
s@StoredQueryMetadata' {} Text
a -> StoredQueryMetadata
s {$sel:queryName:StoredQueryMetadata' :: Text
queryName = Text
a} :: StoredQueryMetadata)
instance Core.FromJSON StoredQueryMetadata where
parseJSON :: Value -> Parser StoredQueryMetadata
parseJSON =
String
-> (Object -> Parser StoredQueryMetadata)
-> Value
-> Parser StoredQueryMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StoredQueryMetadata"
( \Object
x ->
Maybe Text -> Text -> Text -> Text -> StoredQueryMetadata
StoredQueryMetadata'
(Maybe Text -> Text -> Text -> Text -> StoredQueryMetadata)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> Text -> StoredQueryMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
Parser (Text -> Text -> Text -> StoredQueryMetadata)
-> Parser Text -> Parser (Text -> Text -> StoredQueryMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"QueryId")
Parser (Text -> Text -> StoredQueryMetadata)
-> Parser Text -> Parser (Text -> StoredQueryMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"QueryArn")
Parser (Text -> StoredQueryMetadata)
-> Parser Text -> Parser StoredQueryMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"QueryName")
)
instance Prelude.Hashable StoredQueryMetadata
instance Prelude.NFData StoredQueryMetadata