{-# 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.Inspector.Types.ResourceGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector.Types.ResourceGroupTag
import qualified Amazonka.Prelude as Prelude
data ResourceGroup = ResourceGroup'
{
ResourceGroup -> Text
arn :: Prelude.Text,
ResourceGroup -> NonEmpty ResourceGroupTag
tags :: Prelude.NonEmpty ResourceGroupTag,
ResourceGroup -> POSIX
createdAt :: Data.POSIX
}
deriving (ResourceGroup -> ResourceGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceGroup -> ResourceGroup -> Bool
$c/= :: ResourceGroup -> ResourceGroup -> Bool
== :: ResourceGroup -> ResourceGroup -> Bool
$c== :: ResourceGroup -> ResourceGroup -> Bool
Prelude.Eq, ReadPrec [ResourceGroup]
ReadPrec ResourceGroup
Int -> ReadS ResourceGroup
ReadS [ResourceGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceGroup]
$creadListPrec :: ReadPrec [ResourceGroup]
readPrec :: ReadPrec ResourceGroup
$creadPrec :: ReadPrec ResourceGroup
readList :: ReadS [ResourceGroup]
$creadList :: ReadS [ResourceGroup]
readsPrec :: Int -> ReadS ResourceGroup
$creadsPrec :: Int -> ReadS ResourceGroup
Prelude.Read, Int -> ResourceGroup -> ShowS
[ResourceGroup] -> ShowS
ResourceGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceGroup] -> ShowS
$cshowList :: [ResourceGroup] -> ShowS
show :: ResourceGroup -> String
$cshow :: ResourceGroup -> String
showsPrec :: Int -> ResourceGroup -> ShowS
$cshowsPrec :: Int -> ResourceGroup -> ShowS
Prelude.Show, forall x. Rep ResourceGroup x -> ResourceGroup
forall x. ResourceGroup -> Rep ResourceGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceGroup x -> ResourceGroup
$cfrom :: forall x. ResourceGroup -> Rep ResourceGroup x
Prelude.Generic)
newResourceGroup ::
Prelude.Text ->
Prelude.NonEmpty ResourceGroupTag ->
Prelude.UTCTime ->
ResourceGroup
newResourceGroup :: Text -> NonEmpty ResourceGroupTag -> UTCTime -> ResourceGroup
newResourceGroup Text
pArn_ NonEmpty ResourceGroupTag
pTags_ UTCTime
pCreatedAt_ =
ResourceGroup'
{ $sel:arn:ResourceGroup' :: Text
arn = Text
pArn_,
$sel:tags:ResourceGroup' :: NonEmpty ResourceGroupTag
tags = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty ResourceGroupTag
pTags_,
$sel:createdAt:ResourceGroup' :: POSIX
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_
}
resourceGroup_arn :: Lens.Lens' ResourceGroup Prelude.Text
resourceGroup_arn :: Lens' ResourceGroup Text
resourceGroup_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceGroup' {Text
arn :: Text
$sel:arn:ResourceGroup' :: ResourceGroup -> Text
arn} -> Text
arn) (\s :: ResourceGroup
s@ResourceGroup' {} Text
a -> ResourceGroup
s {$sel:arn:ResourceGroup' :: Text
arn = Text
a} :: ResourceGroup)
resourceGroup_tags :: Lens.Lens' ResourceGroup (Prelude.NonEmpty ResourceGroupTag)
resourceGroup_tags :: Lens' ResourceGroup (NonEmpty ResourceGroupTag)
resourceGroup_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceGroup' {NonEmpty ResourceGroupTag
tags :: NonEmpty ResourceGroupTag
$sel:tags:ResourceGroup' :: ResourceGroup -> NonEmpty ResourceGroupTag
tags} -> NonEmpty ResourceGroupTag
tags) (\s :: ResourceGroup
s@ResourceGroup' {} NonEmpty ResourceGroupTag
a -> ResourceGroup
s {$sel:tags:ResourceGroup' :: NonEmpty ResourceGroupTag
tags = NonEmpty ResourceGroupTag
a} :: ResourceGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
resourceGroup_createdAt :: Lens.Lens' ResourceGroup Prelude.UTCTime
resourceGroup_createdAt :: Lens' ResourceGroup UTCTime
resourceGroup_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceGroup' {POSIX
createdAt :: POSIX
$sel:createdAt:ResourceGroup' :: ResourceGroup -> POSIX
createdAt} -> POSIX
createdAt) (\s :: ResourceGroup
s@ResourceGroup' {} POSIX
a -> ResourceGroup
s {$sel:createdAt:ResourceGroup' :: POSIX
createdAt = POSIX
a} :: ResourceGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON ResourceGroup where
parseJSON :: Value -> Parser ResourceGroup
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResourceGroup"
( \Object
x ->
Text -> NonEmpty ResourceGroupTag -> POSIX -> ResourceGroup
ResourceGroup'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"tags")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"createdAt")
)
instance Prelude.Hashable ResourceGroup where
hashWithSalt :: Int -> ResourceGroup -> Int
hashWithSalt Int
_salt ResourceGroup' {NonEmpty ResourceGroupTag
Text
POSIX
createdAt :: POSIX
tags :: NonEmpty ResourceGroupTag
arn :: Text
$sel:createdAt:ResourceGroup' :: ResourceGroup -> POSIX
$sel:tags:ResourceGroup' :: ResourceGroup -> NonEmpty ResourceGroupTag
$sel:arn:ResourceGroup' :: ResourceGroup -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty ResourceGroupTag
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdAt
instance Prelude.NFData ResourceGroup where
rnf :: ResourceGroup -> ()
rnf ResourceGroup' {NonEmpty ResourceGroupTag
Text
POSIX
createdAt :: POSIX
tags :: NonEmpty ResourceGroupTag
arn :: Text
$sel:createdAt:ResourceGroup' :: ResourceGroup -> POSIX
$sel:tags:ResourceGroup' :: ResourceGroup -> NonEmpty ResourceGroupTag
$sel:arn:ResourceGroup' :: ResourceGroup -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty ResourceGroupTag
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdAt