{-# 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.IoTAnalytics.Types.ResourceConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.ComputeType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourceConfiguration = ResourceConfiguration'
{
ResourceConfiguration -> ComputeType
computeType :: ComputeType,
ResourceConfiguration -> Natural
volumeSizeInGB :: Prelude.Natural
}
deriving (ResourceConfiguration -> ResourceConfiguration -> Bool
(ResourceConfiguration -> ResourceConfiguration -> Bool)
-> (ResourceConfiguration -> ResourceConfiguration -> Bool)
-> Eq ResourceConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceConfiguration -> ResourceConfiguration -> Bool
$c/= :: ResourceConfiguration -> ResourceConfiguration -> Bool
== :: ResourceConfiguration -> ResourceConfiguration -> Bool
$c== :: ResourceConfiguration -> ResourceConfiguration -> Bool
Prelude.Eq, ReadPrec [ResourceConfiguration]
ReadPrec ResourceConfiguration
Int -> ReadS ResourceConfiguration
ReadS [ResourceConfiguration]
(Int -> ReadS ResourceConfiguration)
-> ReadS [ResourceConfiguration]
-> ReadPrec ResourceConfiguration
-> ReadPrec [ResourceConfiguration]
-> Read ResourceConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceConfiguration]
$creadListPrec :: ReadPrec [ResourceConfiguration]
readPrec :: ReadPrec ResourceConfiguration
$creadPrec :: ReadPrec ResourceConfiguration
readList :: ReadS [ResourceConfiguration]
$creadList :: ReadS [ResourceConfiguration]
readsPrec :: Int -> ReadS ResourceConfiguration
$creadsPrec :: Int -> ReadS ResourceConfiguration
Prelude.Read, Int -> ResourceConfiguration -> ShowS
[ResourceConfiguration] -> ShowS
ResourceConfiguration -> String
(Int -> ResourceConfiguration -> ShowS)
-> (ResourceConfiguration -> String)
-> ([ResourceConfiguration] -> ShowS)
-> Show ResourceConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceConfiguration] -> ShowS
$cshowList :: [ResourceConfiguration] -> ShowS
show :: ResourceConfiguration -> String
$cshow :: ResourceConfiguration -> String
showsPrec :: Int -> ResourceConfiguration -> ShowS
$cshowsPrec :: Int -> ResourceConfiguration -> ShowS
Prelude.Show, (forall x. ResourceConfiguration -> Rep ResourceConfiguration x)
-> (forall x. Rep ResourceConfiguration x -> ResourceConfiguration)
-> Generic ResourceConfiguration
forall x. Rep ResourceConfiguration x -> ResourceConfiguration
forall x. ResourceConfiguration -> Rep ResourceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceConfiguration x -> ResourceConfiguration
$cfrom :: forall x. ResourceConfiguration -> Rep ResourceConfiguration x
Prelude.Generic)
newResourceConfiguration ::
ComputeType ->
Prelude.Natural ->
ResourceConfiguration
newResourceConfiguration :: ComputeType -> Natural -> ResourceConfiguration
newResourceConfiguration
ComputeType
pComputeType_
Natural
pVolumeSizeInGB_ =
ResourceConfiguration' :: ComputeType -> Natural -> ResourceConfiguration
ResourceConfiguration'
{ $sel:computeType:ResourceConfiguration' :: ComputeType
computeType = ComputeType
pComputeType_,
$sel:volumeSizeInGB:ResourceConfiguration' :: Natural
volumeSizeInGB = Natural
pVolumeSizeInGB_
}
resourceConfiguration_computeType :: Lens.Lens' ResourceConfiguration ComputeType
resourceConfiguration_computeType :: (ComputeType -> f ComputeType)
-> ResourceConfiguration -> f ResourceConfiguration
resourceConfiguration_computeType = (ResourceConfiguration -> ComputeType)
-> (ResourceConfiguration -> ComputeType -> ResourceConfiguration)
-> Lens
ResourceConfiguration ResourceConfiguration ComputeType ComputeType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceConfiguration' {ComputeType
computeType :: ComputeType
$sel:computeType:ResourceConfiguration' :: ResourceConfiguration -> ComputeType
computeType} -> ComputeType
computeType) (\s :: ResourceConfiguration
s@ResourceConfiguration' {} ComputeType
a -> ResourceConfiguration
s {$sel:computeType:ResourceConfiguration' :: ComputeType
computeType = ComputeType
a} :: ResourceConfiguration)
resourceConfiguration_volumeSizeInGB :: Lens.Lens' ResourceConfiguration Prelude.Natural
resourceConfiguration_volumeSizeInGB :: (Natural -> f Natural)
-> ResourceConfiguration -> f ResourceConfiguration
resourceConfiguration_volumeSizeInGB = (ResourceConfiguration -> Natural)
-> (ResourceConfiguration -> Natural -> ResourceConfiguration)
-> Lens ResourceConfiguration ResourceConfiguration Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceConfiguration' {Natural
volumeSizeInGB :: Natural
$sel:volumeSizeInGB:ResourceConfiguration' :: ResourceConfiguration -> Natural
volumeSizeInGB} -> Natural
volumeSizeInGB) (\s :: ResourceConfiguration
s@ResourceConfiguration' {} Natural
a -> ResourceConfiguration
s {$sel:volumeSizeInGB:ResourceConfiguration' :: Natural
volumeSizeInGB = Natural
a} :: ResourceConfiguration)
instance Core.FromJSON ResourceConfiguration where
parseJSON :: Value -> Parser ResourceConfiguration
parseJSON =
String
-> (Object -> Parser ResourceConfiguration)
-> Value
-> Parser ResourceConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceConfiguration"
( \Object
x ->
ComputeType -> Natural -> ResourceConfiguration
ResourceConfiguration'
(ComputeType -> Natural -> ResourceConfiguration)
-> Parser ComputeType -> Parser (Natural -> ResourceConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser ComputeType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"computeType")
Parser (Natural -> ResourceConfiguration)
-> Parser Natural -> Parser ResourceConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"volumeSizeInGB")
)
instance Prelude.Hashable ResourceConfiguration
instance Prelude.NFData ResourceConfiguration
instance Core.ToJSON ResourceConfiguration where
toJSON :: ResourceConfiguration -> Value
toJSON ResourceConfiguration' {Natural
ComputeType
volumeSizeInGB :: Natural
computeType :: ComputeType
$sel:volumeSizeInGB:ResourceConfiguration' :: ResourceConfiguration -> Natural
$sel:computeType:ResourceConfiguration' :: ResourceConfiguration -> ComputeType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"computeType" Text -> ComputeType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ComputeType
computeType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"volumeSizeInGB" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
volumeSizeInGB)
]
)