{-# 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.CreateCapacityProvider
-- 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)
--
-- Creates a new capacity provider. Capacity providers are associated with
-- an Amazon ECS cluster and are used in capacity provider strategies to
-- facilitate cluster auto scaling.
--
-- Only capacity providers using an Auto Scaling group can be created.
-- Amazon ECS tasks on Fargate use the @FARGATE@ and @FARGATE_SPOT@
-- capacity providers which are already created and available to all
-- accounts in Regions supported by Fargate.
module Amazonka.ECS.CreateCapacityProvider
  ( -- * Creating a Request
    CreateCapacityProvider (..),
    newCreateCapacityProvider,

    -- * Request Lenses
    createCapacityProvider_tags,
    createCapacityProvider_name,
    createCapacityProvider_autoScalingGroupProvider,

    -- * Destructuring the Response
    CreateCapacityProviderResponse (..),
    newCreateCapacityProviderResponse,

    -- * Response Lenses
    createCapacityProviderResponse_capacityProvider,
    createCapacityProviderResponse_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:/ 'newCreateCapacityProvider' smart constructor.
data CreateCapacityProvider = CreateCapacityProvider'
  { -- | The metadata that you apply to the capacity provider to help you
    -- categorize and organize them. 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.
    CreateCapacityProvider -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the capacity provider. Up to 255 characters are allowed,
    -- including letters (upper and lowercase), numbers, underscores, and
    -- hyphens. The name cannot be prefixed with \"@aws@\", \"@ecs@\", or
    -- \"@fargate@\".
    CreateCapacityProvider -> Text
name :: Prelude.Text,
    -- | The details of the Auto Scaling group for the capacity provider.
    CreateCapacityProvider -> AutoScalingGroupProvider
autoScalingGroupProvider :: AutoScalingGroupProvider
  }
  deriving (CreateCapacityProvider -> CreateCapacityProvider -> Bool
(CreateCapacityProvider -> CreateCapacityProvider -> Bool)
-> (CreateCapacityProvider -> CreateCapacityProvider -> Bool)
-> Eq CreateCapacityProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCapacityProvider -> CreateCapacityProvider -> Bool
$c/= :: CreateCapacityProvider -> CreateCapacityProvider -> Bool
== :: CreateCapacityProvider -> CreateCapacityProvider -> Bool
$c== :: CreateCapacityProvider -> CreateCapacityProvider -> Bool
Prelude.Eq, ReadPrec [CreateCapacityProvider]
ReadPrec CreateCapacityProvider
Int -> ReadS CreateCapacityProvider
ReadS [CreateCapacityProvider]
(Int -> ReadS CreateCapacityProvider)
-> ReadS [CreateCapacityProvider]
-> ReadPrec CreateCapacityProvider
-> ReadPrec [CreateCapacityProvider]
-> Read CreateCapacityProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCapacityProvider]
$creadListPrec :: ReadPrec [CreateCapacityProvider]
readPrec :: ReadPrec CreateCapacityProvider
$creadPrec :: ReadPrec CreateCapacityProvider
readList :: ReadS [CreateCapacityProvider]
$creadList :: ReadS [CreateCapacityProvider]
readsPrec :: Int -> ReadS CreateCapacityProvider
$creadsPrec :: Int -> ReadS CreateCapacityProvider
Prelude.Read, Int -> CreateCapacityProvider -> ShowS
[CreateCapacityProvider] -> ShowS
CreateCapacityProvider -> String
(Int -> CreateCapacityProvider -> ShowS)
-> (CreateCapacityProvider -> String)
-> ([CreateCapacityProvider] -> ShowS)
-> Show CreateCapacityProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCapacityProvider] -> ShowS
$cshowList :: [CreateCapacityProvider] -> ShowS
show :: CreateCapacityProvider -> String
$cshow :: CreateCapacityProvider -> String
showsPrec :: Int -> CreateCapacityProvider -> ShowS
$cshowsPrec :: Int -> CreateCapacityProvider -> ShowS
Prelude.Show, (forall x. CreateCapacityProvider -> Rep CreateCapacityProvider x)
-> (forall x.
    Rep CreateCapacityProvider x -> CreateCapacityProvider)
-> Generic CreateCapacityProvider
forall x. Rep CreateCapacityProvider x -> CreateCapacityProvider
forall x. CreateCapacityProvider -> Rep CreateCapacityProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCapacityProvider x -> CreateCapacityProvider
$cfrom :: forall x. CreateCapacityProvider -> Rep CreateCapacityProvider x
Prelude.Generic)

-- |
-- Create a value of 'CreateCapacityProvider' 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:
--
-- 'tags', 'createCapacityProvider_tags' - The metadata that you apply to the capacity provider to help you
-- categorize and organize them. 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.
--
-- 'name', 'createCapacityProvider_name' - The name of the capacity provider. Up to 255 characters are allowed,
-- including letters (upper and lowercase), numbers, underscores, and
-- hyphens. The name cannot be prefixed with \"@aws@\", \"@ecs@\", or
-- \"@fargate@\".
--
-- 'autoScalingGroupProvider', 'createCapacityProvider_autoScalingGroupProvider' - The details of the Auto Scaling group for the capacity provider.
newCreateCapacityProvider ::
  -- | 'name'
  Prelude.Text ->
  -- | 'autoScalingGroupProvider'
  AutoScalingGroupProvider ->
  CreateCapacityProvider
newCreateCapacityProvider :: Text -> AutoScalingGroupProvider -> CreateCapacityProvider
newCreateCapacityProvider
  Text
pName_
  AutoScalingGroupProvider
pAutoScalingGroupProvider_ =
    CreateCapacityProvider' :: Maybe [Tag]
-> Text -> AutoScalingGroupProvider -> CreateCapacityProvider
CreateCapacityProvider'
      { $sel:tags:CreateCapacityProvider' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateCapacityProvider' :: Text
name = Text
pName_,
        $sel:autoScalingGroupProvider:CreateCapacityProvider' :: AutoScalingGroupProvider
autoScalingGroupProvider =
          AutoScalingGroupProvider
pAutoScalingGroupProvider_
      }

-- | The metadata that you apply to the capacity provider to help you
-- categorize and organize them. 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.
createCapacityProvider_tags :: Lens.Lens' CreateCapacityProvider (Prelude.Maybe [Tag])
createCapacityProvider_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCapacityProvider -> f CreateCapacityProvider
createCapacityProvider_tags = (CreateCapacityProvider -> Maybe [Tag])
-> (CreateCapacityProvider
    -> Maybe [Tag] -> CreateCapacityProvider)
-> Lens
     CreateCapacityProvider
     CreateCapacityProvider
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCapacityProvider' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateCapacityProvider' :: CreateCapacityProvider -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateCapacityProvider
s@CreateCapacityProvider' {} Maybe [Tag]
a -> CreateCapacityProvider
s {$sel:tags:CreateCapacityProvider' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateCapacityProvider) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateCapacityProvider -> f CreateCapacityProvider)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCapacityProvider
-> f CreateCapacityProvider
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

-- | The name of the capacity provider. Up to 255 characters are allowed,
-- including letters (upper and lowercase), numbers, underscores, and
-- hyphens. The name cannot be prefixed with \"@aws@\", \"@ecs@\", or
-- \"@fargate@\".
createCapacityProvider_name :: Lens.Lens' CreateCapacityProvider Prelude.Text
createCapacityProvider_name :: (Text -> f Text)
-> CreateCapacityProvider -> f CreateCapacityProvider
createCapacityProvider_name = (CreateCapacityProvider -> Text)
-> (CreateCapacityProvider -> Text -> CreateCapacityProvider)
-> Lens CreateCapacityProvider CreateCapacityProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCapacityProvider' {Text
name :: Text
$sel:name:CreateCapacityProvider' :: CreateCapacityProvider -> Text
name} -> Text
name) (\s :: CreateCapacityProvider
s@CreateCapacityProvider' {} Text
a -> CreateCapacityProvider
s {$sel:name:CreateCapacityProvider' :: Text
name = Text
a} :: CreateCapacityProvider)

-- | The details of the Auto Scaling group for the capacity provider.
createCapacityProvider_autoScalingGroupProvider :: Lens.Lens' CreateCapacityProvider AutoScalingGroupProvider
createCapacityProvider_autoScalingGroupProvider :: (AutoScalingGroupProvider -> f AutoScalingGroupProvider)
-> CreateCapacityProvider -> f CreateCapacityProvider
createCapacityProvider_autoScalingGroupProvider = (CreateCapacityProvider -> AutoScalingGroupProvider)
-> (CreateCapacityProvider
    -> AutoScalingGroupProvider -> CreateCapacityProvider)
-> Lens
     CreateCapacityProvider
     CreateCapacityProvider
     AutoScalingGroupProvider
     AutoScalingGroupProvider
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCapacityProvider' {AutoScalingGroupProvider
autoScalingGroupProvider :: AutoScalingGroupProvider
$sel:autoScalingGroupProvider:CreateCapacityProvider' :: CreateCapacityProvider -> AutoScalingGroupProvider
autoScalingGroupProvider} -> AutoScalingGroupProvider
autoScalingGroupProvider) (\s :: CreateCapacityProvider
s@CreateCapacityProvider' {} AutoScalingGroupProvider
a -> CreateCapacityProvider
s {$sel:autoScalingGroupProvider:CreateCapacityProvider' :: AutoScalingGroupProvider
autoScalingGroupProvider = AutoScalingGroupProvider
a} :: CreateCapacityProvider)

instance Core.AWSRequest CreateCapacityProvider where
  type
    AWSResponse CreateCapacityProvider =
      CreateCapacityProviderResponse
  request :: CreateCapacityProvider -> Request CreateCapacityProvider
request = Service -> CreateCapacityProvider -> Request CreateCapacityProvider
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCapacityProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCapacityProvider)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateCapacityProvider))
-> Logger
-> Service
-> Proxy CreateCapacityProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCapacityProvider)))
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 CapacityProvider -> Int -> CreateCapacityProviderResponse
CreateCapacityProviderResponse'
            (Maybe CapacityProvider -> Int -> CreateCapacityProviderResponse)
-> Either String (Maybe CapacityProvider)
-> Either String (Int -> CreateCapacityProviderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CapacityProvider)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"capacityProvider")
            Either String (Int -> CreateCapacityProviderResponse)
-> Either String Int
-> Either String CreateCapacityProviderResponse
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 CreateCapacityProvider

instance Prelude.NFData CreateCapacityProvider

instance Core.ToHeaders CreateCapacityProvider where
  toHeaders :: CreateCapacityProvider -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateCapacityProvider -> 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.CreateCapacityProvider" ::
                          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 CreateCapacityProvider where
  toJSON :: CreateCapacityProvider -> Value
toJSON CreateCapacityProvider' {Maybe [Tag]
Text
AutoScalingGroupProvider
autoScalingGroupProvider :: AutoScalingGroupProvider
name :: Text
tags :: Maybe [Tag]
$sel:autoScalingGroupProvider:CreateCapacityProvider' :: CreateCapacityProvider -> AutoScalingGroupProvider
$sel:name:CreateCapacityProvider' :: CreateCapacityProvider -> Text
$sel:tags:CreateCapacityProvider' :: CreateCapacityProvider -> Maybe [Tag]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"autoScalingGroupProvider"
                  Text -> AutoScalingGroupProvider -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AutoScalingGroupProvider
autoScalingGroupProvider
              )
          ]
      )

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

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

-- | /See:/ 'newCreateCapacityProviderResponse' smart constructor.
data CreateCapacityProviderResponse = CreateCapacityProviderResponse'
  { -- | The full description of the new capacity provider.
    CreateCapacityProviderResponse -> Maybe CapacityProvider
capacityProvider :: Prelude.Maybe CapacityProvider,
    -- | The response's http status code.
    CreateCapacityProviderResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCapacityProviderResponse
-> CreateCapacityProviderResponse -> Bool
(CreateCapacityProviderResponse
 -> CreateCapacityProviderResponse -> Bool)
-> (CreateCapacityProviderResponse
    -> CreateCapacityProviderResponse -> Bool)
-> Eq CreateCapacityProviderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCapacityProviderResponse
-> CreateCapacityProviderResponse -> Bool
$c/= :: CreateCapacityProviderResponse
-> CreateCapacityProviderResponse -> Bool
== :: CreateCapacityProviderResponse
-> CreateCapacityProviderResponse -> Bool
$c== :: CreateCapacityProviderResponse
-> CreateCapacityProviderResponse -> Bool
Prelude.Eq, ReadPrec [CreateCapacityProviderResponse]
ReadPrec CreateCapacityProviderResponse
Int -> ReadS CreateCapacityProviderResponse
ReadS [CreateCapacityProviderResponse]
(Int -> ReadS CreateCapacityProviderResponse)
-> ReadS [CreateCapacityProviderResponse]
-> ReadPrec CreateCapacityProviderResponse
-> ReadPrec [CreateCapacityProviderResponse]
-> Read CreateCapacityProviderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCapacityProviderResponse]
$creadListPrec :: ReadPrec [CreateCapacityProviderResponse]
readPrec :: ReadPrec CreateCapacityProviderResponse
$creadPrec :: ReadPrec CreateCapacityProviderResponse
readList :: ReadS [CreateCapacityProviderResponse]
$creadList :: ReadS [CreateCapacityProviderResponse]
readsPrec :: Int -> ReadS CreateCapacityProviderResponse
$creadsPrec :: Int -> ReadS CreateCapacityProviderResponse
Prelude.Read, Int -> CreateCapacityProviderResponse -> ShowS
[CreateCapacityProviderResponse] -> ShowS
CreateCapacityProviderResponse -> String
(Int -> CreateCapacityProviderResponse -> ShowS)
-> (CreateCapacityProviderResponse -> String)
-> ([CreateCapacityProviderResponse] -> ShowS)
-> Show CreateCapacityProviderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCapacityProviderResponse] -> ShowS
$cshowList :: [CreateCapacityProviderResponse] -> ShowS
show :: CreateCapacityProviderResponse -> String
$cshow :: CreateCapacityProviderResponse -> String
showsPrec :: Int -> CreateCapacityProviderResponse -> ShowS
$cshowsPrec :: Int -> CreateCapacityProviderResponse -> ShowS
Prelude.Show, (forall x.
 CreateCapacityProviderResponse
 -> Rep CreateCapacityProviderResponse x)
-> (forall x.
    Rep CreateCapacityProviderResponse x
    -> CreateCapacityProviderResponse)
-> Generic CreateCapacityProviderResponse
forall x.
Rep CreateCapacityProviderResponse x
-> CreateCapacityProviderResponse
forall x.
CreateCapacityProviderResponse
-> Rep CreateCapacityProviderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCapacityProviderResponse x
-> CreateCapacityProviderResponse
$cfrom :: forall x.
CreateCapacityProviderResponse
-> Rep CreateCapacityProviderResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCapacityProviderResponse' 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:
--
-- 'capacityProvider', 'createCapacityProviderResponse_capacityProvider' - The full description of the new capacity provider.
--
-- 'httpStatus', 'createCapacityProviderResponse_httpStatus' - The response's http status code.
newCreateCapacityProviderResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCapacityProviderResponse
newCreateCapacityProviderResponse :: Int -> CreateCapacityProviderResponse
newCreateCapacityProviderResponse Int
pHttpStatus_ =
  CreateCapacityProviderResponse' :: Maybe CapacityProvider -> Int -> CreateCapacityProviderResponse
CreateCapacityProviderResponse'
    { $sel:capacityProvider:CreateCapacityProviderResponse' :: Maybe CapacityProvider
capacityProvider =
        Maybe CapacityProvider
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCapacityProviderResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The full description of the new capacity provider.
createCapacityProviderResponse_capacityProvider :: Lens.Lens' CreateCapacityProviderResponse (Prelude.Maybe CapacityProvider)
createCapacityProviderResponse_capacityProvider :: (Maybe CapacityProvider -> f (Maybe CapacityProvider))
-> CreateCapacityProviderResponse
-> f CreateCapacityProviderResponse
createCapacityProviderResponse_capacityProvider = (CreateCapacityProviderResponse -> Maybe CapacityProvider)
-> (CreateCapacityProviderResponse
    -> Maybe CapacityProvider -> CreateCapacityProviderResponse)
-> Lens
     CreateCapacityProviderResponse
     CreateCapacityProviderResponse
     (Maybe CapacityProvider)
     (Maybe CapacityProvider)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCapacityProviderResponse' {Maybe CapacityProvider
capacityProvider :: Maybe CapacityProvider
$sel:capacityProvider:CreateCapacityProviderResponse' :: CreateCapacityProviderResponse -> Maybe CapacityProvider
capacityProvider} -> Maybe CapacityProvider
capacityProvider) (\s :: CreateCapacityProviderResponse
s@CreateCapacityProviderResponse' {} Maybe CapacityProvider
a -> CreateCapacityProviderResponse
s {$sel:capacityProvider:CreateCapacityProviderResponse' :: Maybe CapacityProvider
capacityProvider = Maybe CapacityProvider
a} :: CreateCapacityProviderResponse)

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

instance
  Prelude.NFData
    CreateCapacityProviderResponse