{-# 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.EMR.Types.PlacementType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PlacementType = PlacementType'
{
PlacementType -> Maybe [Text]
availabilityZones :: Prelude.Maybe [Prelude.Text],
PlacementType -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text
}
deriving (PlacementType -> PlacementType -> Bool
(PlacementType -> PlacementType -> Bool)
-> (PlacementType -> PlacementType -> Bool) -> Eq PlacementType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlacementType -> PlacementType -> Bool
$c/= :: PlacementType -> PlacementType -> Bool
== :: PlacementType -> PlacementType -> Bool
$c== :: PlacementType -> PlacementType -> Bool
Prelude.Eq, ReadPrec [PlacementType]
ReadPrec PlacementType
Int -> ReadS PlacementType
ReadS [PlacementType]
(Int -> ReadS PlacementType)
-> ReadS [PlacementType]
-> ReadPrec PlacementType
-> ReadPrec [PlacementType]
-> Read PlacementType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlacementType]
$creadListPrec :: ReadPrec [PlacementType]
readPrec :: ReadPrec PlacementType
$creadPrec :: ReadPrec PlacementType
readList :: ReadS [PlacementType]
$creadList :: ReadS [PlacementType]
readsPrec :: Int -> ReadS PlacementType
$creadsPrec :: Int -> ReadS PlacementType
Prelude.Read, Int -> PlacementType -> ShowS
[PlacementType] -> ShowS
PlacementType -> String
(Int -> PlacementType -> ShowS)
-> (PlacementType -> String)
-> ([PlacementType] -> ShowS)
-> Show PlacementType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlacementType] -> ShowS
$cshowList :: [PlacementType] -> ShowS
show :: PlacementType -> String
$cshow :: PlacementType -> String
showsPrec :: Int -> PlacementType -> ShowS
$cshowsPrec :: Int -> PlacementType -> ShowS
Prelude.Show, (forall x. PlacementType -> Rep PlacementType x)
-> (forall x. Rep PlacementType x -> PlacementType)
-> Generic PlacementType
forall x. Rep PlacementType x -> PlacementType
forall x. PlacementType -> Rep PlacementType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlacementType x -> PlacementType
$cfrom :: forall x. PlacementType -> Rep PlacementType x
Prelude.Generic)
newPlacementType ::
PlacementType
newPlacementType :: PlacementType
newPlacementType =
PlacementType' :: Maybe [Text] -> Maybe Text -> PlacementType
PlacementType'
{ $sel:availabilityZones:PlacementType' :: Maybe [Text]
availabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:PlacementType' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
placementType_availabilityZones :: Lens.Lens' PlacementType (Prelude.Maybe [Prelude.Text])
placementType_availabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> PlacementType -> f PlacementType
placementType_availabilityZones = (PlacementType -> Maybe [Text])
-> (PlacementType -> Maybe [Text] -> PlacementType)
-> Lens PlacementType PlacementType (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementType' {Maybe [Text]
availabilityZones :: Maybe [Text]
$sel:availabilityZones:PlacementType' :: PlacementType -> Maybe [Text]
availabilityZones} -> Maybe [Text]
availabilityZones) (\s :: PlacementType
s@PlacementType' {} Maybe [Text]
a -> PlacementType
s {$sel:availabilityZones:PlacementType' :: Maybe [Text]
availabilityZones = Maybe [Text]
a} :: PlacementType) ((Maybe [Text] -> f (Maybe [Text]))
-> PlacementType -> f PlacementType)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PlacementType
-> f PlacementType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
placementType_availabilityZone :: Lens.Lens' PlacementType (Prelude.Maybe Prelude.Text)
placementType_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> PlacementType -> f PlacementType
placementType_availabilityZone = (PlacementType -> Maybe Text)
-> (PlacementType -> Maybe Text -> PlacementType)
-> Lens PlacementType PlacementType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementType' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:PlacementType' :: PlacementType -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: PlacementType
s@PlacementType' {} Maybe Text
a -> PlacementType
s {$sel:availabilityZone:PlacementType' :: Maybe Text
availabilityZone = Maybe Text
a} :: PlacementType)
instance Prelude.Hashable PlacementType
instance Prelude.NFData PlacementType
instance Core.ToJSON PlacementType where
toJSON :: PlacementType -> Value
toJSON PlacementType' {Maybe [Text]
Maybe Text
availabilityZone :: Maybe Text
availabilityZones :: Maybe [Text]
$sel:availabilityZone:PlacementType' :: PlacementType -> Maybe Text
$sel:availabilityZones:PlacementType' :: PlacementType -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AvailabilityZones" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
availabilityZones,
(Text
"AvailabilityZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
availabilityZone
]
)