{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.PutClusterCapacityProviders
-- 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)
--
-- Modifies the available capacity providers and the default capacity
-- provider strategy for a cluster.
--
-- You must specify both the available capacity providers and a default
-- capacity provider strategy for the cluster. If the specified cluster has
-- existing capacity providers associated with it, you must specify all
-- existing capacity providers in addition to any new ones you want to add.
-- Any existing capacity providers associated with a cluster that are
-- omitted from a PutClusterCapacityProviders API call will be
-- disassociated with the cluster. You can only disassociate an existing
-- capacity provider from a cluster if it\'s not being used by any existing
-- tasks.
--
-- When creating a service or running a task on a cluster, if no capacity
-- provider or launch type is specified, then the cluster\'s default
-- capacity provider strategy is used. It is recommended to define a
-- default capacity provider strategy for your cluster, however you may
-- specify an empty array (@[]@) to bypass defining a default strategy.
module Amazonka.ECS.PutClusterCapacityProviders
  ( -- * Creating a Request
    PutClusterCapacityProviders (..),
    newPutClusterCapacityProviders,

    -- * Request Lenses
    putClusterCapacityProviders_cluster,
    putClusterCapacityProviders_capacityProviders,
    putClusterCapacityProviders_defaultCapacityProviderStrategy,

    -- * Destructuring the Response
    PutClusterCapacityProvidersResponse (..),
    newPutClusterCapacityProvidersResponse,

    -- * Response Lenses
    putClusterCapacityProvidersResponse_cluster,
    putClusterCapacityProvidersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ECS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPutClusterCapacityProviders' smart constructor.
data PutClusterCapacityProviders = PutClusterCapacityProviders'
  { -- | The short name or full Amazon Resource Name (ARN) of the cluster to
    -- modify the capacity provider settings for. If you do not specify a
    -- cluster, the default cluster is assumed.
    PutClusterCapacityProviders -> Text
cluster :: Prelude.Text,
    -- | The name of one or more capacity providers to associate with the
    -- cluster.
    --
    -- If specifying a capacity provider that uses an Auto Scaling group, the
    -- capacity provider must already be created. New capacity providers can be
    -- created with the CreateCapacityProvider API operation.
    --
    -- To use a Fargate capacity provider, specify either the @FARGATE@ or
    -- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
    -- available to all accounts and only need to be associated with a cluster
    -- to be used.
    PutClusterCapacityProviders -> [Text]
capacityProviders :: [Prelude.Text],
    -- | The capacity provider strategy to use by default for the cluster.
    --
    -- When creating a service or running a task on a cluster, if no capacity
    -- provider or launch type is specified then the default capacity provider
    -- strategy for the cluster is used.
    --
    -- A capacity provider strategy consists of one or more capacity providers
    -- along with the @base@ and @weight@ to assign to them. A capacity
    -- provider must be associated with the cluster to be used in a capacity
    -- provider strategy. The PutClusterCapacityProviders API is used to
    -- associate a capacity provider with a cluster. Only capacity providers
    -- with an @ACTIVE@ or @UPDATING@ status can be used.
    --
    -- If specifying a capacity provider that uses an Auto Scaling group, the
    -- capacity provider must already be created. New capacity providers can be
    -- created with the CreateCapacityProvider API operation.
    --
    -- To use a Fargate capacity provider, specify either the @FARGATE@ or
    -- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
    -- available to all accounts and only need to be associated with a cluster
    -- to be used.
    PutClusterCapacityProviders -> [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy :: [CapacityProviderStrategyItem]
  }
  deriving (PutClusterCapacityProviders -> PutClusterCapacityProviders -> Bool
(PutClusterCapacityProviders
 -> PutClusterCapacityProviders -> Bool)
-> (PutClusterCapacityProviders
    -> PutClusterCapacityProviders -> Bool)
-> Eq PutClusterCapacityProviders
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutClusterCapacityProviders -> PutClusterCapacityProviders -> Bool
$c/= :: PutClusterCapacityProviders -> PutClusterCapacityProviders -> Bool
== :: PutClusterCapacityProviders -> PutClusterCapacityProviders -> Bool
$c== :: PutClusterCapacityProviders -> PutClusterCapacityProviders -> Bool
Prelude.Eq, ReadPrec [PutClusterCapacityProviders]
ReadPrec PutClusterCapacityProviders
Int -> ReadS PutClusterCapacityProviders
ReadS [PutClusterCapacityProviders]
(Int -> ReadS PutClusterCapacityProviders)
-> ReadS [PutClusterCapacityProviders]
-> ReadPrec PutClusterCapacityProviders
-> ReadPrec [PutClusterCapacityProviders]
-> Read PutClusterCapacityProviders
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutClusterCapacityProviders]
$creadListPrec :: ReadPrec [PutClusterCapacityProviders]
readPrec :: ReadPrec PutClusterCapacityProviders
$creadPrec :: ReadPrec PutClusterCapacityProviders
readList :: ReadS [PutClusterCapacityProviders]
$creadList :: ReadS [PutClusterCapacityProviders]
readsPrec :: Int -> ReadS PutClusterCapacityProviders
$creadsPrec :: Int -> ReadS PutClusterCapacityProviders
Prelude.Read, Int -> PutClusterCapacityProviders -> ShowS
[PutClusterCapacityProviders] -> ShowS
PutClusterCapacityProviders -> String
(Int -> PutClusterCapacityProviders -> ShowS)
-> (PutClusterCapacityProviders -> String)
-> ([PutClusterCapacityProviders] -> ShowS)
-> Show PutClusterCapacityProviders
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutClusterCapacityProviders] -> ShowS
$cshowList :: [PutClusterCapacityProviders] -> ShowS
show :: PutClusterCapacityProviders -> String
$cshow :: PutClusterCapacityProviders -> String
showsPrec :: Int -> PutClusterCapacityProviders -> ShowS
$cshowsPrec :: Int -> PutClusterCapacityProviders -> ShowS
Prelude.Show, (forall x.
 PutClusterCapacityProviders -> Rep PutClusterCapacityProviders x)
-> (forall x.
    Rep PutClusterCapacityProviders x -> PutClusterCapacityProviders)
-> Generic PutClusterCapacityProviders
forall x.
Rep PutClusterCapacityProviders x -> PutClusterCapacityProviders
forall x.
PutClusterCapacityProviders -> Rep PutClusterCapacityProviders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutClusterCapacityProviders x -> PutClusterCapacityProviders
$cfrom :: forall x.
PutClusterCapacityProviders -> Rep PutClusterCapacityProviders x
Prelude.Generic)

-- |
-- Create a value of 'PutClusterCapacityProviders' 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:
--
-- 'cluster', 'putClusterCapacityProviders_cluster' - The short name or full Amazon Resource Name (ARN) of the cluster to
-- modify the capacity provider settings for. If you do not specify a
-- cluster, the default cluster is assumed.
--
-- 'capacityProviders', 'putClusterCapacityProviders_capacityProviders' - The name of one or more capacity providers to associate with the
-- cluster.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
--
-- 'defaultCapacityProviderStrategy', 'putClusterCapacityProviders_defaultCapacityProviderStrategy' - The capacity provider strategy to use by default for the cluster.
--
-- When creating a service or running a task on a cluster, if no capacity
-- provider or launch type is specified then the default capacity provider
-- strategy for the cluster is used.
--
-- A capacity provider strategy consists of one or more capacity providers
-- along with the @base@ and @weight@ to assign to them. A capacity
-- provider must be associated with the cluster to be used in a capacity
-- provider strategy. The PutClusterCapacityProviders API is used to
-- associate a capacity provider with a cluster. Only capacity providers
-- with an @ACTIVE@ or @UPDATING@ status can be used.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
newPutClusterCapacityProviders ::
  -- | 'cluster'
  Prelude.Text ->
  PutClusterCapacityProviders
newPutClusterCapacityProviders :: Text -> PutClusterCapacityProviders
newPutClusterCapacityProviders Text
pCluster_ =
  PutClusterCapacityProviders' :: Text
-> [Text]
-> [CapacityProviderStrategyItem]
-> PutClusterCapacityProviders
PutClusterCapacityProviders'
    { $sel:cluster:PutClusterCapacityProviders' :: Text
cluster = Text
pCluster_,
      $sel:capacityProviders:PutClusterCapacityProviders' :: [Text]
capacityProviders = [Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:defaultCapacityProviderStrategy:PutClusterCapacityProviders' :: [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy =
        [CapacityProviderStrategyItem]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The short name or full Amazon Resource Name (ARN) of the cluster to
-- modify the capacity provider settings for. If you do not specify a
-- cluster, the default cluster is assumed.
putClusterCapacityProviders_cluster :: Lens.Lens' PutClusterCapacityProviders Prelude.Text
putClusterCapacityProviders_cluster :: (Text -> f Text)
-> PutClusterCapacityProviders -> f PutClusterCapacityProviders
putClusterCapacityProviders_cluster = (PutClusterCapacityProviders -> Text)
-> (PutClusterCapacityProviders
    -> Text -> PutClusterCapacityProviders)
-> Lens
     PutClusterCapacityProviders PutClusterCapacityProviders Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutClusterCapacityProviders' {Text
cluster :: Text
$sel:cluster:PutClusterCapacityProviders' :: PutClusterCapacityProviders -> Text
cluster} -> Text
cluster) (\s :: PutClusterCapacityProviders
s@PutClusterCapacityProviders' {} Text
a -> PutClusterCapacityProviders
s {$sel:cluster:PutClusterCapacityProviders' :: Text
cluster = Text
a} :: PutClusterCapacityProviders)

-- | The name of one or more capacity providers to associate with the
-- cluster.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
putClusterCapacityProviders_capacityProviders :: Lens.Lens' PutClusterCapacityProviders [Prelude.Text]
putClusterCapacityProviders_capacityProviders :: ([Text] -> f [Text])
-> PutClusterCapacityProviders -> f PutClusterCapacityProviders
putClusterCapacityProviders_capacityProviders = (PutClusterCapacityProviders -> [Text])
-> (PutClusterCapacityProviders
    -> [Text] -> PutClusterCapacityProviders)
-> Lens
     PutClusterCapacityProviders
     PutClusterCapacityProviders
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutClusterCapacityProviders' {[Text]
capacityProviders :: [Text]
$sel:capacityProviders:PutClusterCapacityProviders' :: PutClusterCapacityProviders -> [Text]
capacityProviders} -> [Text]
capacityProviders) (\s :: PutClusterCapacityProviders
s@PutClusterCapacityProviders' {} [Text]
a -> PutClusterCapacityProviders
s {$sel:capacityProviders:PutClusterCapacityProviders' :: [Text]
capacityProviders = [Text]
a} :: PutClusterCapacityProviders) (([Text] -> f [Text])
 -> PutClusterCapacityProviders -> f PutClusterCapacityProviders)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> PutClusterCapacityProviders
-> f PutClusterCapacityProviders
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The capacity provider strategy to use by default for the cluster.
--
-- When creating a service or running a task on a cluster, if no capacity
-- provider or launch type is specified then the default capacity provider
-- strategy for the cluster is used.
--
-- A capacity provider strategy consists of one or more capacity providers
-- along with the @base@ and @weight@ to assign to them. A capacity
-- provider must be associated with the cluster to be used in a capacity
-- provider strategy. The PutClusterCapacityProviders API is used to
-- associate a capacity provider with a cluster. Only capacity providers
-- with an @ACTIVE@ or @UPDATING@ status can be used.
--
-- If specifying a capacity provider that uses an Auto Scaling group, the
-- capacity provider must already be created. New capacity providers can be
-- created with the CreateCapacityProvider API operation.
--
-- To use a Fargate capacity provider, specify either the @FARGATE@ or
-- @FARGATE_SPOT@ capacity providers. The Fargate capacity providers are
-- available to all accounts and only need to be associated with a cluster
-- to be used.
putClusterCapacityProviders_defaultCapacityProviderStrategy :: Lens.Lens' PutClusterCapacityProviders [CapacityProviderStrategyItem]
putClusterCapacityProviders_defaultCapacityProviderStrategy :: ([CapacityProviderStrategyItem]
 -> f [CapacityProviderStrategyItem])
-> PutClusterCapacityProviders -> f PutClusterCapacityProviders
putClusterCapacityProviders_defaultCapacityProviderStrategy = (PutClusterCapacityProviders -> [CapacityProviderStrategyItem])
-> (PutClusterCapacityProviders
    -> [CapacityProviderStrategyItem] -> PutClusterCapacityProviders)
-> Lens
     PutClusterCapacityProviders
     PutClusterCapacityProviders
     [CapacityProviderStrategyItem]
     [CapacityProviderStrategyItem]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutClusterCapacityProviders' {[CapacityProviderStrategyItem]
defaultCapacityProviderStrategy :: [CapacityProviderStrategyItem]
$sel:defaultCapacityProviderStrategy:PutClusterCapacityProviders' :: PutClusterCapacityProviders -> [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy} -> [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy) (\s :: PutClusterCapacityProviders
s@PutClusterCapacityProviders' {} [CapacityProviderStrategyItem]
a -> PutClusterCapacityProviders
s {$sel:defaultCapacityProviderStrategy:PutClusterCapacityProviders' :: [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy = [CapacityProviderStrategyItem]
a} :: PutClusterCapacityProviders) (([CapacityProviderStrategyItem]
  -> f [CapacityProviderStrategyItem])
 -> PutClusterCapacityProviders -> f PutClusterCapacityProviders)
-> (([CapacityProviderStrategyItem]
     -> f [CapacityProviderStrategyItem])
    -> [CapacityProviderStrategyItem]
    -> f [CapacityProviderStrategyItem])
-> ([CapacityProviderStrategyItem]
    -> f [CapacityProviderStrategyItem])
-> PutClusterCapacityProviders
-> f PutClusterCapacityProviders
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CapacityProviderStrategyItem]
 -> f [CapacityProviderStrategyItem])
-> [CapacityProviderStrategyItem]
-> f [CapacityProviderStrategyItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest PutClusterCapacityProviders where
  type
    AWSResponse PutClusterCapacityProviders =
      PutClusterCapacityProvidersResponse
  request :: PutClusterCapacityProviders -> Request PutClusterCapacityProviders
request = Service
-> PutClusterCapacityProviders
-> Request PutClusterCapacityProviders
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutClusterCapacityProviders
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutClusterCapacityProviders)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutClusterCapacityProviders))
-> Logger
-> Service
-> Proxy PutClusterCapacityProviders
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutClusterCapacityProviders)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Cluster -> Int -> PutClusterCapacityProvidersResponse
PutClusterCapacityProvidersResponse'
            (Maybe Cluster -> Int -> PutClusterCapacityProvidersResponse)
-> Either String (Maybe Cluster)
-> Either String (Int -> PutClusterCapacityProvidersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Cluster)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"cluster")
            Either String (Int -> PutClusterCapacityProvidersResponse)
-> Either String Int
-> Either String PutClusterCapacityProvidersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PutClusterCapacityProviders

instance Prelude.NFData PutClusterCapacityProviders

instance Core.ToHeaders PutClusterCapacityProviders where
  toHeaders :: PutClusterCapacityProviders -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutClusterCapacityProviders -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonEC2ContainerServiceV20141113.PutClusterCapacityProviders" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PutClusterCapacityProviders where
  toJSON :: PutClusterCapacityProviders -> Value
toJSON PutClusterCapacityProviders' {[Text]
[CapacityProviderStrategyItem]
Text
defaultCapacityProviderStrategy :: [CapacityProviderStrategyItem]
capacityProviders :: [Text]
cluster :: Text
$sel:defaultCapacityProviderStrategy:PutClusterCapacityProviders' :: PutClusterCapacityProviders -> [CapacityProviderStrategyItem]
$sel:capacityProviders:PutClusterCapacityProviders' :: PutClusterCapacityProviders -> [Text]
$sel:cluster:PutClusterCapacityProviders' :: PutClusterCapacityProviders -> Text
..} =
    [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
"cluster" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
cluster),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"capacityProviders" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
capacityProviders),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"defaultCapacityProviderStrategy"
                  Text -> [CapacityProviderStrategyItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [CapacityProviderStrategyItem]
defaultCapacityProviderStrategy
              )
          ]
      )

instance Core.ToPath PutClusterCapacityProviders where
  toPath :: PutClusterCapacityProviders -> ByteString
toPath = ByteString -> PutClusterCapacityProviders -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery PutClusterCapacityProviders where
  toQuery :: PutClusterCapacityProviders -> QueryString
toQuery = QueryString -> PutClusterCapacityProviders -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutClusterCapacityProvidersResponse' smart constructor.
data PutClusterCapacityProvidersResponse = PutClusterCapacityProvidersResponse'
  { -- | Details about the cluster.
    PutClusterCapacityProvidersResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
    -- | The response's http status code.
    PutClusterCapacityProvidersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutClusterCapacityProvidersResponse
-> PutClusterCapacityProvidersResponse -> Bool
(PutClusterCapacityProvidersResponse
 -> PutClusterCapacityProvidersResponse -> Bool)
-> (PutClusterCapacityProvidersResponse
    -> PutClusterCapacityProvidersResponse -> Bool)
-> Eq PutClusterCapacityProvidersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutClusterCapacityProvidersResponse
-> PutClusterCapacityProvidersResponse -> Bool
$c/= :: PutClusterCapacityProvidersResponse
-> PutClusterCapacityProvidersResponse -> Bool
== :: PutClusterCapacityProvidersResponse
-> PutClusterCapacityProvidersResponse -> Bool
$c== :: PutClusterCapacityProvidersResponse
-> PutClusterCapacityProvidersResponse -> Bool
Prelude.Eq, ReadPrec [PutClusterCapacityProvidersResponse]
ReadPrec PutClusterCapacityProvidersResponse
Int -> ReadS PutClusterCapacityProvidersResponse
ReadS [PutClusterCapacityProvidersResponse]
(Int -> ReadS PutClusterCapacityProvidersResponse)
-> ReadS [PutClusterCapacityProvidersResponse]
-> ReadPrec PutClusterCapacityProvidersResponse
-> ReadPrec [PutClusterCapacityProvidersResponse]
-> Read PutClusterCapacityProvidersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutClusterCapacityProvidersResponse]
$creadListPrec :: ReadPrec [PutClusterCapacityProvidersResponse]
readPrec :: ReadPrec PutClusterCapacityProvidersResponse
$creadPrec :: ReadPrec PutClusterCapacityProvidersResponse
readList :: ReadS [PutClusterCapacityProvidersResponse]
$creadList :: ReadS [PutClusterCapacityProvidersResponse]
readsPrec :: Int -> ReadS PutClusterCapacityProvidersResponse
$creadsPrec :: Int -> ReadS PutClusterCapacityProvidersResponse
Prelude.Read, Int -> PutClusterCapacityProvidersResponse -> ShowS
[PutClusterCapacityProvidersResponse] -> ShowS
PutClusterCapacityProvidersResponse -> String
(Int -> PutClusterCapacityProvidersResponse -> ShowS)
-> (PutClusterCapacityProvidersResponse -> String)
-> ([PutClusterCapacityProvidersResponse] -> ShowS)
-> Show PutClusterCapacityProvidersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutClusterCapacityProvidersResponse] -> ShowS
$cshowList :: [PutClusterCapacityProvidersResponse] -> ShowS
show :: PutClusterCapacityProvidersResponse -> String
$cshow :: PutClusterCapacityProvidersResponse -> String
showsPrec :: Int -> PutClusterCapacityProvidersResponse -> ShowS
$cshowsPrec :: Int -> PutClusterCapacityProvidersResponse -> ShowS
Prelude.Show, (forall x.
 PutClusterCapacityProvidersResponse
 -> Rep PutClusterCapacityProvidersResponse x)
-> (forall x.
    Rep PutClusterCapacityProvidersResponse x
    -> PutClusterCapacityProvidersResponse)
-> Generic PutClusterCapacityProvidersResponse
forall x.
Rep PutClusterCapacityProvidersResponse x
-> PutClusterCapacityProvidersResponse
forall x.
PutClusterCapacityProvidersResponse
-> Rep PutClusterCapacityProvidersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutClusterCapacityProvidersResponse x
-> PutClusterCapacityProvidersResponse
$cfrom :: forall x.
PutClusterCapacityProvidersResponse
-> Rep PutClusterCapacityProvidersResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutClusterCapacityProvidersResponse' 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:
--
-- 'cluster', 'putClusterCapacityProvidersResponse_cluster' - Details about the cluster.
--
-- 'httpStatus', 'putClusterCapacityProvidersResponse_httpStatus' - The response's http status code.
newPutClusterCapacityProvidersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutClusterCapacityProvidersResponse
newPutClusterCapacityProvidersResponse :: Int -> PutClusterCapacityProvidersResponse
newPutClusterCapacityProvidersResponse Int
pHttpStatus_ =
  PutClusterCapacityProvidersResponse' :: Maybe Cluster -> Int -> PutClusterCapacityProvidersResponse
PutClusterCapacityProvidersResponse'
    { $sel:cluster:PutClusterCapacityProvidersResponse' :: Maybe Cluster
cluster =
        Maybe Cluster
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutClusterCapacityProvidersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Details about the cluster.
putClusterCapacityProvidersResponse_cluster :: Lens.Lens' PutClusterCapacityProvidersResponse (Prelude.Maybe Cluster)
putClusterCapacityProvidersResponse_cluster :: (Maybe Cluster -> f (Maybe Cluster))
-> PutClusterCapacityProvidersResponse
-> f PutClusterCapacityProvidersResponse
putClusterCapacityProvidersResponse_cluster = (PutClusterCapacityProvidersResponse -> Maybe Cluster)
-> (PutClusterCapacityProvidersResponse
    -> Maybe Cluster -> PutClusterCapacityProvidersResponse)
-> Lens
     PutClusterCapacityProvidersResponse
     PutClusterCapacityProvidersResponse
     (Maybe Cluster)
     (Maybe Cluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutClusterCapacityProvidersResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:PutClusterCapacityProvidersResponse' :: PutClusterCapacityProvidersResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: PutClusterCapacityProvidersResponse
s@PutClusterCapacityProvidersResponse' {} Maybe Cluster
a -> PutClusterCapacityProvidersResponse
s {$sel:cluster:PutClusterCapacityProvidersResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: PutClusterCapacityProvidersResponse)

-- | The response's http status code.
putClusterCapacityProvidersResponse_httpStatus :: Lens.Lens' PutClusterCapacityProvidersResponse Prelude.Int
putClusterCapacityProvidersResponse_httpStatus :: (Int -> f Int)
-> PutClusterCapacityProvidersResponse
-> f PutClusterCapacityProvidersResponse
putClusterCapacityProvidersResponse_httpStatus = (PutClusterCapacityProvidersResponse -> Int)
-> (PutClusterCapacityProvidersResponse
    -> Int -> PutClusterCapacityProvidersResponse)
-> Lens
     PutClusterCapacityProvidersResponse
     PutClusterCapacityProvidersResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutClusterCapacityProvidersResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutClusterCapacityProvidersResponse' :: PutClusterCapacityProvidersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutClusterCapacityProvidersResponse
s@PutClusterCapacityProvidersResponse' {} Int
a -> PutClusterCapacityProvidersResponse
s {$sel:httpStatus:PutClusterCapacityProvidersResponse' :: Int
httpStatus = Int
a} :: PutClusterCapacityProvidersResponse)

instance
  Prelude.NFData
    PutClusterCapacityProvidersResponse