{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ECS.Types.CapacityProvider
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The details of a capacity provider.
--
-- /See:/ 'newCapacityProvider' smart constructor.
data CapacityProvider = CapacityProvider'
  { -- | The current status of the capacity provider. Only capacity providers in
    -- an @ACTIVE@ state can be used in a cluster. When a capacity provider is
    -- successfully deleted, it will have an @INACTIVE@ status.
    CapacityProvider -> Maybe CapacityProviderStatus
status :: Prelude.Maybe CapacityProviderStatus,
    -- | The update status reason. This provides further details about the update
    -- status for the capacity provider.
    CapacityProvider -> Maybe Text
updateStatusReason :: Prelude.Maybe Prelude.Text,
    -- | The Auto Scaling group settings for the capacity provider.
    CapacityProvider -> Maybe AutoScalingGroupProvider
autoScalingGroupProvider :: Prelude.Maybe AutoScalingGroupProvider,
    -- | The name of the capacity provider.
    CapacityProvider -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The update status of the capacity provider. The following are the
    -- possible states that will be returned.
    --
    -- [DELETE_IN_PROGRESS]
    --     The capacity provider is in the process of being deleted.
    --
    -- [DELETE_COMPLETE]
    --     The capacity provider has been successfully deleted and will have an
    --     @INACTIVE@ status.
    --
    -- [DELETE_FAILED]
    --     The capacity provider was unable to be deleted. The update status
    --     reason will provide further details about why the delete failed.
    CapacityProvider -> Maybe CapacityProviderUpdateStatus
updateStatus :: Prelude.Maybe CapacityProviderUpdateStatus,
    -- | The Amazon Resource Name (ARN) that identifies the capacity provider.
    CapacityProvider -> Maybe Text
capacityProviderArn :: Prelude.Maybe Prelude.Text,
    -- | The metadata that you apply to the capacity provider to help you
    -- categorize and organize it. Each tag consists of a key and an optional
    -- value, both of which you define.
    --
    -- The following basic restrictions apply to tags:
    --
    -- -   Maximum number of tags per resource - 50
    --
    -- -   For each resource, each tag key must be unique, and each tag key can
    --     have only one value.
    --
    -- -   Maximum key length - 128 Unicode characters in UTF-8
    --
    -- -   Maximum value length - 256 Unicode characters in UTF-8
    --
    -- -   If your tagging schema is used across multiple services and
    --     resources, remember that other services may have restrictions on
    --     allowed characters. Generally allowed characters are: letters,
    --     numbers, and spaces representable in UTF-8, and the following
    --     characters: + - = . _ : \/ \@.
    --
    -- -   Tag keys and values are case-sensitive.
    --
    -- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
    --     such as a prefix for either keys or values as it is reserved for
    --     Amazon Web Services use. You cannot edit or delete tag keys or
    --     values with this prefix. Tags with this prefix do not count against
    --     your tags per resource limit.
    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)

-- |
-- Create a value of 'CapacityProvider' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'capacityProvider_status' - The current status of the capacity provider. Only capacity providers in
-- an @ACTIVE@ state can be used in a cluster. When a capacity provider is
-- successfully deleted, it will have an @INACTIVE@ status.
--
-- 'updateStatusReason', 'capacityProvider_updateStatusReason' - The update status reason. This provides further details about the update
-- status for the capacity provider.
--
-- 'autoScalingGroupProvider', 'capacityProvider_autoScalingGroupProvider' - The Auto Scaling group settings for the capacity provider.
--
-- 'name', 'capacityProvider_name' - The name of the capacity provider.
--
-- 'updateStatus', 'capacityProvider_updateStatus' - The update status of the capacity provider. The following are the
-- possible states that will be returned.
--
-- [DELETE_IN_PROGRESS]
--     The capacity provider is in the process of being deleted.
--
-- [DELETE_COMPLETE]
--     The capacity provider has been successfully deleted and will have an
--     @INACTIVE@ status.
--
-- [DELETE_FAILED]
--     The capacity provider was unable to be deleted. The update status
--     reason will provide further details about why the delete failed.
--
-- 'capacityProviderArn', 'capacityProvider_capacityProviderArn' - The Amazon Resource Name (ARN) that identifies the capacity provider.
--
-- 'tags', 'capacityProvider_tags' - The metadata that you apply to the capacity provider to help you
-- categorize and organize it. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8
--
-- -   Maximum value length - 256 Unicode characters in UTF-8
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case-sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for either keys or values as it is reserved for
--     Amazon Web Services use. You cannot edit or delete tag keys or
--     values with this prefix. Tags with this prefix do not count against
--     your tags per resource limit.
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
    }

-- | The current status of the capacity provider. Only capacity providers in
-- an @ACTIVE@ state can be used in a cluster. When a capacity provider is
-- successfully deleted, it will have an @INACTIVE@ status.
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)

-- | The update status reason. This provides further details about the update
-- status for the capacity provider.
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)

-- | The Auto Scaling group settings for the capacity provider.
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)

-- | The name of the capacity provider.
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)

-- | The update status of the capacity provider. The following are the
-- possible states that will be returned.
--
-- [DELETE_IN_PROGRESS]
--     The capacity provider is in the process of being deleted.
--
-- [DELETE_COMPLETE]
--     The capacity provider has been successfully deleted and will have an
--     @INACTIVE@ status.
--
-- [DELETE_FAILED]
--     The capacity provider was unable to be deleted. The update status
--     reason will provide further details about why the delete failed.
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)

-- | The Amazon Resource Name (ARN) that identifies the capacity provider.
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)

-- | The metadata that you apply to the capacity provider to help you
-- categorize and organize it. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8
--
-- -   Maximum value length - 256 Unicode characters in UTF-8
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case-sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for either keys or values as it is reserved for
--     Amazon Web Services use. You cannot edit or delete tag keys or
--     values with this prefix. Tags with this prefix do not count against
--     your tags per resource limit.
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