{-# 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.ResourceGroups.Types.GroupQuery where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ResourceGroups.Types.ResourceQuery
data GroupQuery = GroupQuery'
{
GroupQuery -> Text
groupName :: Prelude.Text,
GroupQuery -> ResourceQuery
resourceQuery :: ResourceQuery
}
deriving (GroupQuery -> GroupQuery -> Bool
(GroupQuery -> GroupQuery -> Bool)
-> (GroupQuery -> GroupQuery -> Bool) -> Eq GroupQuery
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupQuery -> GroupQuery -> Bool
$c/= :: GroupQuery -> GroupQuery -> Bool
== :: GroupQuery -> GroupQuery -> Bool
$c== :: GroupQuery -> GroupQuery -> Bool
Prelude.Eq, ReadPrec [GroupQuery]
ReadPrec GroupQuery
Int -> ReadS GroupQuery
ReadS [GroupQuery]
(Int -> ReadS GroupQuery)
-> ReadS [GroupQuery]
-> ReadPrec GroupQuery
-> ReadPrec [GroupQuery]
-> Read GroupQuery
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupQuery]
$creadListPrec :: ReadPrec [GroupQuery]
readPrec :: ReadPrec GroupQuery
$creadPrec :: ReadPrec GroupQuery
readList :: ReadS [GroupQuery]
$creadList :: ReadS [GroupQuery]
readsPrec :: Int -> ReadS GroupQuery
$creadsPrec :: Int -> ReadS GroupQuery
Prelude.Read, Int -> GroupQuery -> ShowS
[GroupQuery] -> ShowS
GroupQuery -> String
(Int -> GroupQuery -> ShowS)
-> (GroupQuery -> String)
-> ([GroupQuery] -> ShowS)
-> Show GroupQuery
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupQuery] -> ShowS
$cshowList :: [GroupQuery] -> ShowS
show :: GroupQuery -> String
$cshow :: GroupQuery -> String
showsPrec :: Int -> GroupQuery -> ShowS
$cshowsPrec :: Int -> GroupQuery -> ShowS
Prelude.Show, (forall x. GroupQuery -> Rep GroupQuery x)
-> (forall x. Rep GroupQuery x -> GroupQuery) -> Generic GroupQuery
forall x. Rep GroupQuery x -> GroupQuery
forall x. GroupQuery -> Rep GroupQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupQuery x -> GroupQuery
$cfrom :: forall x. GroupQuery -> Rep GroupQuery x
Prelude.Generic)
newGroupQuery ::
Prelude.Text ->
ResourceQuery ->
GroupQuery
newGroupQuery :: Text -> ResourceQuery -> GroupQuery
newGroupQuery Text
pGroupName_ ResourceQuery
pResourceQuery_ =
GroupQuery' :: Text -> ResourceQuery -> GroupQuery
GroupQuery'
{ $sel:groupName:GroupQuery' :: Text
groupName = Text
pGroupName_,
$sel:resourceQuery:GroupQuery' :: ResourceQuery
resourceQuery = ResourceQuery
pResourceQuery_
}
groupQuery_groupName :: Lens.Lens' GroupQuery Prelude.Text
groupQuery_groupName :: (Text -> f Text) -> GroupQuery -> f GroupQuery
groupQuery_groupName = (GroupQuery -> Text)
-> (GroupQuery -> Text -> GroupQuery)
-> Lens GroupQuery GroupQuery Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupQuery' {Text
groupName :: Text
$sel:groupName:GroupQuery' :: GroupQuery -> Text
groupName} -> Text
groupName) (\s :: GroupQuery
s@GroupQuery' {} Text
a -> GroupQuery
s {$sel:groupName:GroupQuery' :: Text
groupName = Text
a} :: GroupQuery)
groupQuery_resourceQuery :: Lens.Lens' GroupQuery ResourceQuery
groupQuery_resourceQuery :: (ResourceQuery -> f ResourceQuery) -> GroupQuery -> f GroupQuery
groupQuery_resourceQuery = (GroupQuery -> ResourceQuery)
-> (GroupQuery -> ResourceQuery -> GroupQuery)
-> Lens GroupQuery GroupQuery ResourceQuery ResourceQuery
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupQuery' {ResourceQuery
resourceQuery :: ResourceQuery
$sel:resourceQuery:GroupQuery' :: GroupQuery -> ResourceQuery
resourceQuery} -> ResourceQuery
resourceQuery) (\s :: GroupQuery
s@GroupQuery' {} ResourceQuery
a -> GroupQuery
s {$sel:resourceQuery:GroupQuery' :: ResourceQuery
resourceQuery = ResourceQuery
a} :: GroupQuery)
instance Core.FromJSON GroupQuery where
parseJSON :: Value -> Parser GroupQuery
parseJSON =
String
-> (Object -> Parser GroupQuery) -> Value -> Parser GroupQuery
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GroupQuery"
( \Object
x ->
Text -> ResourceQuery -> GroupQuery
GroupQuery'
(Text -> ResourceQuery -> GroupQuery)
-> Parser Text -> Parser (ResourceQuery -> GroupQuery)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"GroupName")
Parser (ResourceQuery -> GroupQuery)
-> Parser ResourceQuery -> Parser GroupQuery
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResourceQuery
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ResourceQuery")
)
instance Prelude.Hashable GroupQuery
instance Prelude.NFData GroupQuery