{-# 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.NetworkManager.Types.NetworkResourceCount 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
data NetworkResourceCount = NetworkResourceCount'
{
NetworkResourceCount -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
NetworkResourceCount -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text
}
deriving (NetworkResourceCount -> NetworkResourceCount -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkResourceCount -> NetworkResourceCount -> Bool
$c/= :: NetworkResourceCount -> NetworkResourceCount -> Bool
== :: NetworkResourceCount -> NetworkResourceCount -> Bool
$c== :: NetworkResourceCount -> NetworkResourceCount -> Bool
Prelude.Eq, ReadPrec [NetworkResourceCount]
ReadPrec NetworkResourceCount
Int -> ReadS NetworkResourceCount
ReadS [NetworkResourceCount]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkResourceCount]
$creadListPrec :: ReadPrec [NetworkResourceCount]
readPrec :: ReadPrec NetworkResourceCount
$creadPrec :: ReadPrec NetworkResourceCount
readList :: ReadS [NetworkResourceCount]
$creadList :: ReadS [NetworkResourceCount]
readsPrec :: Int -> ReadS NetworkResourceCount
$creadsPrec :: Int -> ReadS NetworkResourceCount
Prelude.Read, Int -> NetworkResourceCount -> ShowS
[NetworkResourceCount] -> ShowS
NetworkResourceCount -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkResourceCount] -> ShowS
$cshowList :: [NetworkResourceCount] -> ShowS
show :: NetworkResourceCount -> String
$cshow :: NetworkResourceCount -> String
showsPrec :: Int -> NetworkResourceCount -> ShowS
$cshowsPrec :: Int -> NetworkResourceCount -> ShowS
Prelude.Show, forall x. Rep NetworkResourceCount x -> NetworkResourceCount
forall x. NetworkResourceCount -> Rep NetworkResourceCount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkResourceCount x -> NetworkResourceCount
$cfrom :: forall x. NetworkResourceCount -> Rep NetworkResourceCount x
Prelude.Generic)
newNetworkResourceCount ::
NetworkResourceCount
newNetworkResourceCount :: NetworkResourceCount
newNetworkResourceCount =
NetworkResourceCount'
{ $sel:count:NetworkResourceCount' :: Maybe Int
count = forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:NetworkResourceCount' :: Maybe Text
resourceType = forall a. Maybe a
Prelude.Nothing
}
networkResourceCount_count :: Lens.Lens' NetworkResourceCount (Prelude.Maybe Prelude.Int)
networkResourceCount_count :: Lens' NetworkResourceCount (Maybe Int)
networkResourceCount_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceCount' {Maybe Int
count :: Maybe Int
$sel:count:NetworkResourceCount' :: NetworkResourceCount -> Maybe Int
count} -> Maybe Int
count) (\s :: NetworkResourceCount
s@NetworkResourceCount' {} Maybe Int
a -> NetworkResourceCount
s {$sel:count:NetworkResourceCount' :: Maybe Int
count = Maybe Int
a} :: NetworkResourceCount)
networkResourceCount_resourceType :: Lens.Lens' NetworkResourceCount (Prelude.Maybe Prelude.Text)
networkResourceCount_resourceType :: Lens' NetworkResourceCount (Maybe Text)
networkResourceCount_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceCount' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:NetworkResourceCount' :: NetworkResourceCount -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: NetworkResourceCount
s@NetworkResourceCount' {} Maybe Text
a -> NetworkResourceCount
s {$sel:resourceType:NetworkResourceCount' :: Maybe Text
resourceType = Maybe Text
a} :: NetworkResourceCount)
instance Data.FromJSON NetworkResourceCount where
parseJSON :: Value -> Parser NetworkResourceCount
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NetworkResourceCount"
( \Object
x ->
Maybe Int -> Maybe Text -> NetworkResourceCount
NetworkResourceCount'
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
"Count")
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
"ResourceType")
)
instance Prelude.Hashable NetworkResourceCount where
hashWithSalt :: Int -> NetworkResourceCount -> Int
hashWithSalt Int
_salt NetworkResourceCount' {Maybe Int
Maybe Text
resourceType :: Maybe Text
count :: Maybe Int
$sel:resourceType:NetworkResourceCount' :: NetworkResourceCount -> Maybe Text
$sel:count:NetworkResourceCount' :: NetworkResourceCount -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
count
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceType
instance Prelude.NFData NetworkResourceCount where
rnf :: NetworkResourceCount -> ()
rnf NetworkResourceCount' {Maybe Int
Maybe Text
resourceType :: Maybe Text
count :: Maybe Int
$sel:resourceType:NetworkResourceCount' :: NetworkResourceCount -> Maybe Text
$sel:count:NetworkResourceCount' :: NetworkResourceCount -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
count
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceType