{-# 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.ECS.Types.DockerVolumeConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.Scope
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DockerVolumeConfiguration = DockerVolumeConfiguration'
{
DockerVolumeConfiguration -> Maybe (HashMap Text Text)
driverOpts :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DockerVolumeConfiguration -> Maybe Text
driver :: Prelude.Maybe Prelude.Text,
DockerVolumeConfiguration -> Maybe Scope
scope :: Prelude.Maybe Scope,
DockerVolumeConfiguration -> Maybe (HashMap Text Text)
labels :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DockerVolumeConfiguration -> Maybe Bool
autoprovision :: Prelude.Maybe Prelude.Bool
}
deriving (DockerVolumeConfiguration -> DockerVolumeConfiguration -> Bool
(DockerVolumeConfiguration -> DockerVolumeConfiguration -> Bool)
-> (DockerVolumeConfiguration -> DockerVolumeConfiguration -> Bool)
-> Eq DockerVolumeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DockerVolumeConfiguration -> DockerVolumeConfiguration -> Bool
$c/= :: DockerVolumeConfiguration -> DockerVolumeConfiguration -> Bool
== :: DockerVolumeConfiguration -> DockerVolumeConfiguration -> Bool
$c== :: DockerVolumeConfiguration -> DockerVolumeConfiguration -> Bool
Prelude.Eq, ReadPrec [DockerVolumeConfiguration]
ReadPrec DockerVolumeConfiguration
Int -> ReadS DockerVolumeConfiguration
ReadS [DockerVolumeConfiguration]
(Int -> ReadS DockerVolumeConfiguration)
-> ReadS [DockerVolumeConfiguration]
-> ReadPrec DockerVolumeConfiguration
-> ReadPrec [DockerVolumeConfiguration]
-> Read DockerVolumeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DockerVolumeConfiguration]
$creadListPrec :: ReadPrec [DockerVolumeConfiguration]
readPrec :: ReadPrec DockerVolumeConfiguration
$creadPrec :: ReadPrec DockerVolumeConfiguration
readList :: ReadS [DockerVolumeConfiguration]
$creadList :: ReadS [DockerVolumeConfiguration]
readsPrec :: Int -> ReadS DockerVolumeConfiguration
$creadsPrec :: Int -> ReadS DockerVolumeConfiguration
Prelude.Read, Int -> DockerVolumeConfiguration -> ShowS
[DockerVolumeConfiguration] -> ShowS
DockerVolumeConfiguration -> String
(Int -> DockerVolumeConfiguration -> ShowS)
-> (DockerVolumeConfiguration -> String)
-> ([DockerVolumeConfiguration] -> ShowS)
-> Show DockerVolumeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DockerVolumeConfiguration] -> ShowS
$cshowList :: [DockerVolumeConfiguration] -> ShowS
show :: DockerVolumeConfiguration -> String
$cshow :: DockerVolumeConfiguration -> String
showsPrec :: Int -> DockerVolumeConfiguration -> ShowS
$cshowsPrec :: Int -> DockerVolumeConfiguration -> ShowS
Prelude.Show, (forall x.
DockerVolumeConfiguration -> Rep DockerVolumeConfiguration x)
-> (forall x.
Rep DockerVolumeConfiguration x -> DockerVolumeConfiguration)
-> Generic DockerVolumeConfiguration
forall x.
Rep DockerVolumeConfiguration x -> DockerVolumeConfiguration
forall x.
DockerVolumeConfiguration -> Rep DockerVolumeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DockerVolumeConfiguration x -> DockerVolumeConfiguration
$cfrom :: forall x.
DockerVolumeConfiguration -> Rep DockerVolumeConfiguration x
Prelude.Generic)
newDockerVolumeConfiguration ::
DockerVolumeConfiguration
newDockerVolumeConfiguration :: DockerVolumeConfiguration
newDockerVolumeConfiguration =
DockerVolumeConfiguration' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Scope
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> DockerVolumeConfiguration
DockerVolumeConfiguration'
{ $sel:driverOpts:DockerVolumeConfiguration' :: Maybe (HashMap Text Text)
driverOpts =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:driver:DockerVolumeConfiguration' :: Maybe Text
driver = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scope:DockerVolumeConfiguration' :: Maybe Scope
scope = Maybe Scope
forall a. Maybe a
Prelude.Nothing,
$sel:labels:DockerVolumeConfiguration' :: Maybe (HashMap Text Text)
labels = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:autoprovision:DockerVolumeConfiguration' :: Maybe Bool
autoprovision = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
dockerVolumeConfiguration_driverOpts :: Lens.Lens' DockerVolumeConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
dockerVolumeConfiguration_driverOpts :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DockerVolumeConfiguration -> f DockerVolumeConfiguration
dockerVolumeConfiguration_driverOpts = (DockerVolumeConfiguration -> Maybe (HashMap Text Text))
-> (DockerVolumeConfiguration
-> Maybe (HashMap Text Text) -> DockerVolumeConfiguration)
-> Lens
DockerVolumeConfiguration
DockerVolumeConfiguration
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DockerVolumeConfiguration' {Maybe (HashMap Text Text)
driverOpts :: Maybe (HashMap Text Text)
$sel:driverOpts:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe (HashMap Text Text)
driverOpts} -> Maybe (HashMap Text Text)
driverOpts) (\s :: DockerVolumeConfiguration
s@DockerVolumeConfiguration' {} Maybe (HashMap Text Text)
a -> DockerVolumeConfiguration
s {$sel:driverOpts:DockerVolumeConfiguration' :: Maybe (HashMap Text Text)
driverOpts = Maybe (HashMap Text Text)
a} :: DockerVolumeConfiguration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DockerVolumeConfiguration -> f DockerVolumeConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DockerVolumeConfiguration
-> f DockerVolumeConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dockerVolumeConfiguration_driver :: Lens.Lens' DockerVolumeConfiguration (Prelude.Maybe Prelude.Text)
dockerVolumeConfiguration_driver :: (Maybe Text -> f (Maybe Text))
-> DockerVolumeConfiguration -> f DockerVolumeConfiguration
dockerVolumeConfiguration_driver = (DockerVolumeConfiguration -> Maybe Text)
-> (DockerVolumeConfiguration
-> Maybe Text -> DockerVolumeConfiguration)
-> Lens
DockerVolumeConfiguration
DockerVolumeConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DockerVolumeConfiguration' {Maybe Text
driver :: Maybe Text
$sel:driver:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe Text
driver} -> Maybe Text
driver) (\s :: DockerVolumeConfiguration
s@DockerVolumeConfiguration' {} Maybe Text
a -> DockerVolumeConfiguration
s {$sel:driver:DockerVolumeConfiguration' :: Maybe Text
driver = Maybe Text
a} :: DockerVolumeConfiguration)
dockerVolumeConfiguration_scope :: Lens.Lens' DockerVolumeConfiguration (Prelude.Maybe Scope)
dockerVolumeConfiguration_scope :: (Maybe Scope -> f (Maybe Scope))
-> DockerVolumeConfiguration -> f DockerVolumeConfiguration
dockerVolumeConfiguration_scope = (DockerVolumeConfiguration -> Maybe Scope)
-> (DockerVolumeConfiguration
-> Maybe Scope -> DockerVolumeConfiguration)
-> Lens
DockerVolumeConfiguration
DockerVolumeConfiguration
(Maybe Scope)
(Maybe Scope)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DockerVolumeConfiguration' {Maybe Scope
scope :: Maybe Scope
$sel:scope:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe Scope
scope} -> Maybe Scope
scope) (\s :: DockerVolumeConfiguration
s@DockerVolumeConfiguration' {} Maybe Scope
a -> DockerVolumeConfiguration
s {$sel:scope:DockerVolumeConfiguration' :: Maybe Scope
scope = Maybe Scope
a} :: DockerVolumeConfiguration)
dockerVolumeConfiguration_labels :: Lens.Lens' DockerVolumeConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
dockerVolumeConfiguration_labels :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DockerVolumeConfiguration -> f DockerVolumeConfiguration
dockerVolumeConfiguration_labels = (DockerVolumeConfiguration -> Maybe (HashMap Text Text))
-> (DockerVolumeConfiguration
-> Maybe (HashMap Text Text) -> DockerVolumeConfiguration)
-> Lens
DockerVolumeConfiguration
DockerVolumeConfiguration
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DockerVolumeConfiguration' {Maybe (HashMap Text Text)
labels :: Maybe (HashMap Text Text)
$sel:labels:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe (HashMap Text Text)
labels} -> Maybe (HashMap Text Text)
labels) (\s :: DockerVolumeConfiguration
s@DockerVolumeConfiguration' {} Maybe (HashMap Text Text)
a -> DockerVolumeConfiguration
s {$sel:labels:DockerVolumeConfiguration' :: Maybe (HashMap Text Text)
labels = Maybe (HashMap Text Text)
a} :: DockerVolumeConfiguration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DockerVolumeConfiguration -> f DockerVolumeConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DockerVolumeConfiguration
-> f DockerVolumeConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dockerVolumeConfiguration_autoprovision :: Lens.Lens' DockerVolumeConfiguration (Prelude.Maybe Prelude.Bool)
dockerVolumeConfiguration_autoprovision :: (Maybe Bool -> f (Maybe Bool))
-> DockerVolumeConfiguration -> f DockerVolumeConfiguration
dockerVolumeConfiguration_autoprovision = (DockerVolumeConfiguration -> Maybe Bool)
-> (DockerVolumeConfiguration
-> Maybe Bool -> DockerVolumeConfiguration)
-> Lens
DockerVolumeConfiguration
DockerVolumeConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DockerVolumeConfiguration' {Maybe Bool
autoprovision :: Maybe Bool
$sel:autoprovision:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe Bool
autoprovision} -> Maybe Bool
autoprovision) (\s :: DockerVolumeConfiguration
s@DockerVolumeConfiguration' {} Maybe Bool
a -> DockerVolumeConfiguration
s {$sel:autoprovision:DockerVolumeConfiguration' :: Maybe Bool
autoprovision = Maybe Bool
a} :: DockerVolumeConfiguration)
instance Core.FromJSON DockerVolumeConfiguration where
parseJSON :: Value -> Parser DockerVolumeConfiguration
parseJSON =
String
-> (Object -> Parser DockerVolumeConfiguration)
-> Value
-> Parser DockerVolumeConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DockerVolumeConfiguration"
( \Object
x ->
Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Scope
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> DockerVolumeConfiguration
DockerVolumeConfiguration'
(Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Scope
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> DockerVolumeConfiguration)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Maybe Text
-> Maybe Scope
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> DockerVolumeConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"driverOpts" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Scope
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> DockerVolumeConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Scope
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> DockerVolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"driver")
Parser
(Maybe Scope
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> DockerVolumeConfiguration)
-> Parser (Maybe Scope)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe Bool -> DockerVolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Scope)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scope")
Parser
(Maybe (HashMap Text Text)
-> Maybe Bool -> DockerVolumeConfiguration)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Bool -> DockerVolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"labels" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Bool -> DockerVolumeConfiguration)
-> Parser (Maybe Bool) -> Parser DockerVolumeConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"autoprovision")
)
instance Prelude.Hashable DockerVolumeConfiguration
instance Prelude.NFData DockerVolumeConfiguration
instance Core.ToJSON DockerVolumeConfiguration where
toJSON :: DockerVolumeConfiguration -> Value
toJSON DockerVolumeConfiguration' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe Scope
autoprovision :: Maybe Bool
labels :: Maybe (HashMap Text Text)
scope :: Maybe Scope
driver :: Maybe Text
driverOpts :: Maybe (HashMap Text Text)
$sel:autoprovision:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe Bool
$sel:labels:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe (HashMap Text Text)
$sel:scope:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe Scope
$sel:driver:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe Text
$sel:driverOpts:DockerVolumeConfiguration' :: DockerVolumeConfiguration -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"driverOpts" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
driverOpts,
(Text
"driver" 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
driver,
(Text
"scope" Text -> Scope -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Scope -> Pair) -> Maybe Scope -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Scope
scope,
(Text
"labels" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
labels,
(Text
"autoprovision" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
autoprovision
]
)