{-# 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.CapacityProvider where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.AutoScalingGroupProvider
import Amazonka.ECS.Types.CapacityProviderStatus
import Amazonka.ECS.Types.CapacityProviderUpdateStatus
import Amazonka.ECS.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CapacityProvider = CapacityProvider'
{
CapacityProvider -> Maybe CapacityProviderStatus
status :: Prelude.Maybe CapacityProviderStatus,
CapacityProvider -> Maybe Text
updateStatusReason :: Prelude.Maybe Prelude.Text,
CapacityProvider -> Maybe AutoScalingGroupProvider
autoScalingGroupProvider :: Prelude.Maybe AutoScalingGroupProvider,
CapacityProvider -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CapacityProvider -> Maybe CapacityProviderUpdateStatus
updateStatus :: Prelude.Maybe CapacityProviderUpdateStatus,
CapacityProvider -> Maybe Text
capacityProviderArn :: Prelude.Maybe Prelude.Text,
CapacityProvider -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (CapacityProvider -> CapacityProvider -> Bool
(CapacityProvider -> CapacityProvider -> Bool)
-> (CapacityProvider -> CapacityProvider -> Bool)
-> Eq CapacityProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CapacityProvider -> CapacityProvider -> Bool
$c/= :: CapacityProvider -> CapacityProvider -> Bool
== :: CapacityProvider -> CapacityProvider -> Bool
$c== :: CapacityProvider -> CapacityProvider -> Bool
Prelude.Eq, ReadPrec [CapacityProvider]
ReadPrec CapacityProvider
Int -> ReadS CapacityProvider
ReadS [CapacityProvider]
(Int -> ReadS CapacityProvider)
-> ReadS [CapacityProvider]
-> ReadPrec CapacityProvider
-> ReadPrec [CapacityProvider]
-> Read CapacityProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CapacityProvider]
$creadListPrec :: ReadPrec [CapacityProvider]
readPrec :: ReadPrec CapacityProvider
$creadPrec :: ReadPrec CapacityProvider
readList :: ReadS [CapacityProvider]
$creadList :: ReadS [CapacityProvider]
readsPrec :: Int -> ReadS CapacityProvider
$creadsPrec :: Int -> ReadS CapacityProvider
Prelude.Read, Int -> CapacityProvider -> ShowS
[CapacityProvider] -> ShowS
CapacityProvider -> String
(Int -> CapacityProvider -> ShowS)
-> (CapacityProvider -> String)
-> ([CapacityProvider] -> ShowS)
-> Show CapacityProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CapacityProvider] -> ShowS
$cshowList :: [CapacityProvider] -> ShowS
show :: CapacityProvider -> String
$cshow :: CapacityProvider -> String
showsPrec :: Int -> CapacityProvider -> ShowS
$cshowsPrec :: Int -> CapacityProvider -> ShowS
Prelude.Show, (forall x. CapacityProvider -> Rep CapacityProvider x)
-> (forall x. Rep CapacityProvider x -> CapacityProvider)
-> Generic CapacityProvider
forall x. Rep CapacityProvider x -> CapacityProvider
forall x. CapacityProvider -> Rep CapacityProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CapacityProvider x -> CapacityProvider
$cfrom :: forall x. CapacityProvider -> Rep CapacityProvider x
Prelude.Generic)
newCapacityProvider ::
CapacityProvider
newCapacityProvider :: CapacityProvider
newCapacityProvider =
CapacityProvider' :: Maybe CapacityProviderStatus
-> Maybe Text
-> Maybe AutoScalingGroupProvider
-> Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider
CapacityProvider'
{ $sel:status:CapacityProvider' :: Maybe CapacityProviderStatus
status = Maybe CapacityProviderStatus
forall a. Maybe a
Prelude.Nothing,
$sel:updateStatusReason:CapacityProvider' :: Maybe Text
updateStatusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupProvider:CapacityProvider' :: Maybe AutoScalingGroupProvider
autoScalingGroupProvider = Maybe AutoScalingGroupProvider
forall a. Maybe a
Prelude.Nothing,
$sel:name:CapacityProvider' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:updateStatus:CapacityProvider' :: Maybe CapacityProviderUpdateStatus
updateStatus = Maybe CapacityProviderUpdateStatus
forall a. Maybe a
Prelude.Nothing,
$sel:capacityProviderArn:CapacityProvider' :: Maybe Text
capacityProviderArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CapacityProvider' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
capacityProvider_status :: Lens.Lens' CapacityProvider (Prelude.Maybe CapacityProviderStatus)
capacityProvider_status :: (Maybe CapacityProviderStatus -> f (Maybe CapacityProviderStatus))
-> CapacityProvider -> f CapacityProvider
capacityProvider_status = (CapacityProvider -> Maybe CapacityProviderStatus)
-> (CapacityProvider
-> Maybe CapacityProviderStatus -> CapacityProvider)
-> Lens
CapacityProvider
CapacityProvider
(Maybe CapacityProviderStatus)
(Maybe CapacityProviderStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityProvider' {Maybe CapacityProviderStatus
status :: Maybe CapacityProviderStatus
$sel:status:CapacityProvider' :: CapacityProvider -> Maybe CapacityProviderStatus
status} -> Maybe CapacityProviderStatus
status) (\s :: CapacityProvider
s@CapacityProvider' {} Maybe CapacityProviderStatus
a -> CapacityProvider
s {$sel:status:CapacityProvider' :: Maybe CapacityProviderStatus
status = Maybe CapacityProviderStatus
a} :: CapacityProvider)
capacityProvider_updateStatusReason :: Lens.Lens' CapacityProvider (Prelude.Maybe Prelude.Text)
capacityProvider_updateStatusReason :: (Maybe Text -> f (Maybe Text))
-> CapacityProvider -> f CapacityProvider
capacityProvider_updateStatusReason = (CapacityProvider -> Maybe Text)
-> (CapacityProvider -> Maybe Text -> CapacityProvider)
-> Lens CapacityProvider CapacityProvider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityProvider' {Maybe Text
updateStatusReason :: Maybe Text
$sel:updateStatusReason:CapacityProvider' :: CapacityProvider -> Maybe Text
updateStatusReason} -> Maybe Text
updateStatusReason) (\s :: CapacityProvider
s@CapacityProvider' {} Maybe Text
a -> CapacityProvider
s {$sel:updateStatusReason:CapacityProvider' :: Maybe Text
updateStatusReason = Maybe Text
a} :: CapacityProvider)
capacityProvider_autoScalingGroupProvider :: Lens.Lens' CapacityProvider (Prelude.Maybe AutoScalingGroupProvider)
capacityProvider_autoScalingGroupProvider :: (Maybe AutoScalingGroupProvider
-> f (Maybe AutoScalingGroupProvider))
-> CapacityProvider -> f CapacityProvider
capacityProvider_autoScalingGroupProvider = (CapacityProvider -> Maybe AutoScalingGroupProvider)
-> (CapacityProvider
-> Maybe AutoScalingGroupProvider -> CapacityProvider)
-> Lens
CapacityProvider
CapacityProvider
(Maybe AutoScalingGroupProvider)
(Maybe AutoScalingGroupProvider)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityProvider' {Maybe AutoScalingGroupProvider
autoScalingGroupProvider :: Maybe AutoScalingGroupProvider
$sel:autoScalingGroupProvider:CapacityProvider' :: CapacityProvider -> Maybe AutoScalingGroupProvider
autoScalingGroupProvider} -> Maybe AutoScalingGroupProvider
autoScalingGroupProvider) (\s :: CapacityProvider
s@CapacityProvider' {} Maybe AutoScalingGroupProvider
a -> CapacityProvider
s {$sel:autoScalingGroupProvider:CapacityProvider' :: Maybe AutoScalingGroupProvider
autoScalingGroupProvider = Maybe AutoScalingGroupProvider
a} :: CapacityProvider)
capacityProvider_name :: Lens.Lens' CapacityProvider (Prelude.Maybe Prelude.Text)
capacityProvider_name :: (Maybe Text -> f (Maybe Text))
-> CapacityProvider -> f CapacityProvider
capacityProvider_name = (CapacityProvider -> Maybe Text)
-> (CapacityProvider -> Maybe Text -> CapacityProvider)
-> Lens CapacityProvider CapacityProvider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityProvider' {Maybe Text
name :: Maybe Text
$sel:name:CapacityProvider' :: CapacityProvider -> Maybe Text
name} -> Maybe Text
name) (\s :: CapacityProvider
s@CapacityProvider' {} Maybe Text
a -> CapacityProvider
s {$sel:name:CapacityProvider' :: Maybe Text
name = Maybe Text
a} :: CapacityProvider)
capacityProvider_updateStatus :: Lens.Lens' CapacityProvider (Prelude.Maybe CapacityProviderUpdateStatus)
capacityProvider_updateStatus :: (Maybe CapacityProviderUpdateStatus
-> f (Maybe CapacityProviderUpdateStatus))
-> CapacityProvider -> f CapacityProvider
capacityProvider_updateStatus = (CapacityProvider -> Maybe CapacityProviderUpdateStatus)
-> (CapacityProvider
-> Maybe CapacityProviderUpdateStatus -> CapacityProvider)
-> Lens
CapacityProvider
CapacityProvider
(Maybe CapacityProviderUpdateStatus)
(Maybe CapacityProviderUpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityProvider' {Maybe CapacityProviderUpdateStatus
updateStatus :: Maybe CapacityProviderUpdateStatus
$sel:updateStatus:CapacityProvider' :: CapacityProvider -> Maybe CapacityProviderUpdateStatus
updateStatus} -> Maybe CapacityProviderUpdateStatus
updateStatus) (\s :: CapacityProvider
s@CapacityProvider' {} Maybe CapacityProviderUpdateStatus
a -> CapacityProvider
s {$sel:updateStatus:CapacityProvider' :: Maybe CapacityProviderUpdateStatus
updateStatus = Maybe CapacityProviderUpdateStatus
a} :: CapacityProvider)
capacityProvider_capacityProviderArn :: Lens.Lens' CapacityProvider (Prelude.Maybe Prelude.Text)
capacityProvider_capacityProviderArn :: (Maybe Text -> f (Maybe Text))
-> CapacityProvider -> f CapacityProvider
capacityProvider_capacityProviderArn = (CapacityProvider -> Maybe Text)
-> (CapacityProvider -> Maybe Text -> CapacityProvider)
-> Lens CapacityProvider CapacityProvider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityProvider' {Maybe Text
capacityProviderArn :: Maybe Text
$sel:capacityProviderArn:CapacityProvider' :: CapacityProvider -> Maybe Text
capacityProviderArn} -> Maybe Text
capacityProviderArn) (\s :: CapacityProvider
s@CapacityProvider' {} Maybe Text
a -> CapacityProvider
s {$sel:capacityProviderArn:CapacityProvider' :: Maybe Text
capacityProviderArn = Maybe Text
a} :: CapacityProvider)
capacityProvider_tags :: Lens.Lens' CapacityProvider (Prelude.Maybe [Tag])
capacityProvider_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CapacityProvider -> f CapacityProvider
capacityProvider_tags = (CapacityProvider -> Maybe [Tag])
-> (CapacityProvider -> Maybe [Tag] -> CapacityProvider)
-> Lens
CapacityProvider CapacityProvider (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CapacityProvider' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CapacityProvider' :: CapacityProvider -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CapacityProvider
s@CapacityProvider' {} Maybe [Tag]
a -> CapacityProvider
s {$sel:tags:CapacityProvider' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CapacityProvider) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CapacityProvider -> f CapacityProvider)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CapacityProvider
-> f CapacityProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CapacityProvider where
parseJSON :: Value -> Parser CapacityProvider
parseJSON =
String
-> (Object -> Parser CapacityProvider)
-> Value
-> Parser CapacityProvider
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CapacityProvider"
( \Object
x ->
Maybe CapacityProviderStatus
-> Maybe Text
-> Maybe AutoScalingGroupProvider
-> Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider
CapacityProvider'
(Maybe CapacityProviderStatus
-> Maybe Text
-> Maybe AutoScalingGroupProvider
-> Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider)
-> Parser (Maybe CapacityProviderStatus)
-> Parser
(Maybe Text
-> Maybe AutoScalingGroupProvider
-> Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CapacityProviderStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Text
-> Maybe AutoScalingGroupProvider
-> Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider)
-> Parser (Maybe Text)
-> Parser
(Maybe AutoScalingGroupProvider
-> Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider)
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
"updateStatusReason")
Parser
(Maybe AutoScalingGroupProvider
-> Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider)
-> Parser (Maybe AutoScalingGroupProvider)
-> Parser
(Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoScalingGroupProvider)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"autoScalingGroupProvider")
Parser
(Maybe Text
-> Maybe CapacityProviderUpdateStatus
-> Maybe Text
-> Maybe [Tag]
-> CapacityProvider)
-> Parser (Maybe Text)
-> Parser
(Maybe CapacityProviderUpdateStatus
-> Maybe Text -> Maybe [Tag] -> CapacityProvider)
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
"name")
Parser
(Maybe CapacityProviderUpdateStatus
-> Maybe Text -> Maybe [Tag] -> CapacityProvider)
-> Parser (Maybe CapacityProviderUpdateStatus)
-> Parser (Maybe Text -> Maybe [Tag] -> CapacityProvider)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CapacityProviderUpdateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"updateStatus")
Parser (Maybe Text -> Maybe [Tag] -> CapacityProvider)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> CapacityProvider)
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
"capacityProviderArn")
Parser (Maybe [Tag] -> CapacityProvider)
-> Parser (Maybe [Tag]) -> Parser CapacityProvider
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable CapacityProvider
instance Prelude.NFData CapacityProvider