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