{-# 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.Kafka.CreateConfiguration
-- 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 MSK configuration.
module Amazonka.Kafka.CreateConfiguration
  ( -- * Creating a Request
    CreateConfiguration (..),
    newCreateConfiguration,

    -- * Request Lenses
    createConfiguration_kafkaVersions,
    createConfiguration_description,
    createConfiguration_serverProperties,
    createConfiguration_name,

    -- * Destructuring the Response
    CreateConfigurationResponse (..),
    newCreateConfigurationResponse,

    -- * Response Lenses
    createConfigurationResponse_creationTime,
    createConfigurationResponse_state,
    createConfigurationResponse_arn,
    createConfigurationResponse_latestRevision,
    createConfigurationResponse_name,
    createConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Kafka.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:/ 'newCreateConfiguration' smart constructor.
data CreateConfiguration = CreateConfiguration'
  { -- | The versions of Apache Kafka with which you can use this MSK
    -- configuration.
    CreateConfiguration -> Maybe [Text]
kafkaVersions :: Prelude.Maybe [Prelude.Text],
    -- | The description of the configuration.
    CreateConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Contents of the server.properties file. When using the API, you must
    -- ensure that the contents of the file are base64 encoded. When using the
    -- AWS Management Console, the SDK, or the AWS CLI, the contents of
    -- server.properties can be in plaintext.
    CreateConfiguration -> Base64
serverProperties :: Core.Base64,
    -- | The name of the configuration.
    CreateConfiguration -> Text
name :: Prelude.Text
  }
  deriving (CreateConfiguration -> CreateConfiguration -> Bool
(CreateConfiguration -> CreateConfiguration -> Bool)
-> (CreateConfiguration -> CreateConfiguration -> Bool)
-> Eq CreateConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConfiguration -> CreateConfiguration -> Bool
$c/= :: CreateConfiguration -> CreateConfiguration -> Bool
== :: CreateConfiguration -> CreateConfiguration -> Bool
$c== :: CreateConfiguration -> CreateConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateConfiguration]
ReadPrec CreateConfiguration
Int -> ReadS CreateConfiguration
ReadS [CreateConfiguration]
(Int -> ReadS CreateConfiguration)
-> ReadS [CreateConfiguration]
-> ReadPrec CreateConfiguration
-> ReadPrec [CreateConfiguration]
-> Read CreateConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConfiguration]
$creadListPrec :: ReadPrec [CreateConfiguration]
readPrec :: ReadPrec CreateConfiguration
$creadPrec :: ReadPrec CreateConfiguration
readList :: ReadS [CreateConfiguration]
$creadList :: ReadS [CreateConfiguration]
readsPrec :: Int -> ReadS CreateConfiguration
$creadsPrec :: Int -> ReadS CreateConfiguration
Prelude.Read, Int -> CreateConfiguration -> ShowS
[CreateConfiguration] -> ShowS
CreateConfiguration -> String
(Int -> CreateConfiguration -> ShowS)
-> (CreateConfiguration -> String)
-> ([CreateConfiguration] -> ShowS)
-> Show CreateConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConfiguration] -> ShowS
$cshowList :: [CreateConfiguration] -> ShowS
show :: CreateConfiguration -> String
$cshow :: CreateConfiguration -> String
showsPrec :: Int -> CreateConfiguration -> ShowS
$cshowsPrec :: Int -> CreateConfiguration -> ShowS
Prelude.Show, (forall x. CreateConfiguration -> Rep CreateConfiguration x)
-> (forall x. Rep CreateConfiguration x -> CreateConfiguration)
-> Generic CreateConfiguration
forall x. Rep CreateConfiguration x -> CreateConfiguration
forall x. CreateConfiguration -> Rep CreateConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateConfiguration x -> CreateConfiguration
$cfrom :: forall x. CreateConfiguration -> Rep CreateConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateConfiguration' 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:
--
-- 'kafkaVersions', 'createConfiguration_kafkaVersions' - The versions of Apache Kafka with which you can use this MSK
-- configuration.
--
-- 'description', 'createConfiguration_description' - The description of the configuration.
--
-- 'serverProperties', 'createConfiguration_serverProperties' - Contents of the server.properties file. When using the API, you must
-- ensure that the contents of the file are base64 encoded. When using the
-- AWS Management Console, the SDK, or the AWS CLI, the contents of
-- server.properties can be in plaintext.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'name', 'createConfiguration_name' - The name of the configuration.
newCreateConfiguration ::
  -- | 'serverProperties'
  Prelude.ByteString ->
  -- | 'name'
  Prelude.Text ->
  CreateConfiguration
newCreateConfiguration :: ByteString -> Text -> CreateConfiguration
newCreateConfiguration ByteString
pServerProperties_ Text
pName_ =
  CreateConfiguration' :: Maybe [Text] -> Maybe Text -> Base64 -> Text -> CreateConfiguration
CreateConfiguration'
    { $sel:kafkaVersions:CreateConfiguration' :: Maybe [Text]
kafkaVersions =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serverProperties:CreateConfiguration' :: Base64
serverProperties =
        Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64 (Tagged ByteString (Identity ByteString)
 -> Tagged Base64 (Identity Base64))
-> ByteString -> Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pServerProperties_,
      $sel:name:CreateConfiguration' :: Text
name = Text
pName_
    }

-- | The versions of Apache Kafka with which you can use this MSK
-- configuration.
createConfiguration_kafkaVersions :: Lens.Lens' CreateConfiguration (Prelude.Maybe [Prelude.Text])
createConfiguration_kafkaVersions :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateConfiguration -> f CreateConfiguration
createConfiguration_kafkaVersions = (CreateConfiguration -> Maybe [Text])
-> (CreateConfiguration -> Maybe [Text] -> CreateConfiguration)
-> Lens
     CreateConfiguration
     CreateConfiguration
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfiguration' {Maybe [Text]
kafkaVersions :: Maybe [Text]
$sel:kafkaVersions:CreateConfiguration' :: CreateConfiguration -> Maybe [Text]
kafkaVersions} -> Maybe [Text]
kafkaVersions) (\s :: CreateConfiguration
s@CreateConfiguration' {} Maybe [Text]
a -> CreateConfiguration
s {$sel:kafkaVersions:CreateConfiguration' :: Maybe [Text]
kafkaVersions = Maybe [Text]
a} :: CreateConfiguration) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateConfiguration -> f CreateConfiguration)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateConfiguration
-> f CreateConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The description of the configuration.
createConfiguration_description :: Lens.Lens' CreateConfiguration (Prelude.Maybe Prelude.Text)
createConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> CreateConfiguration -> f CreateConfiguration
createConfiguration_description = (CreateConfiguration -> Maybe Text)
-> (CreateConfiguration -> Maybe Text -> CreateConfiguration)
-> Lens
     CreateConfiguration CreateConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:CreateConfiguration' :: CreateConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateConfiguration
s@CreateConfiguration' {} Maybe Text
a -> CreateConfiguration
s {$sel:description:CreateConfiguration' :: Maybe Text
description = Maybe Text
a} :: CreateConfiguration)

-- | Contents of the server.properties file. When using the API, you must
-- ensure that the contents of the file are base64 encoded. When using the
-- AWS Management Console, the SDK, or the AWS CLI, the contents of
-- server.properties can be in plaintext.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
createConfiguration_serverProperties :: Lens.Lens' CreateConfiguration Prelude.ByteString
createConfiguration_serverProperties :: (ByteString -> f ByteString)
-> CreateConfiguration -> f CreateConfiguration
createConfiguration_serverProperties = (CreateConfiguration -> Base64)
-> (CreateConfiguration -> Base64 -> CreateConfiguration)
-> Lens CreateConfiguration CreateConfiguration Base64 Base64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfiguration' {Base64
serverProperties :: Base64
$sel:serverProperties:CreateConfiguration' :: CreateConfiguration -> Base64
serverProperties} -> Base64
serverProperties) (\s :: CreateConfiguration
s@CreateConfiguration' {} Base64
a -> CreateConfiguration
s {$sel:serverProperties:CreateConfiguration' :: Base64
serverProperties = Base64
a} :: CreateConfiguration) ((Base64 -> f Base64)
 -> CreateConfiguration -> f CreateConfiguration)
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> CreateConfiguration
-> f CreateConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64

-- | The name of the configuration.
createConfiguration_name :: Lens.Lens' CreateConfiguration Prelude.Text
createConfiguration_name :: (Text -> f Text) -> CreateConfiguration -> f CreateConfiguration
createConfiguration_name = (CreateConfiguration -> Text)
-> (CreateConfiguration -> Text -> CreateConfiguration)
-> Lens CreateConfiguration CreateConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfiguration' {Text
name :: Text
$sel:name:CreateConfiguration' :: CreateConfiguration -> Text
name} -> Text
name) (\s :: CreateConfiguration
s@CreateConfiguration' {} Text
a -> CreateConfiguration
s {$sel:name:CreateConfiguration' :: Text
name = Text
a} :: CreateConfiguration)

instance Core.AWSRequest CreateConfiguration where
  type
    AWSResponse CreateConfiguration =
      CreateConfigurationResponse
  request :: CreateConfiguration -> Request CreateConfiguration
request = Service -> CreateConfiguration -> Request CreateConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateConfiguration))
-> Logger
-> Service
-> Proxy CreateConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateConfiguration)))
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 POSIX
-> Maybe ConfigurationState
-> Maybe Text
-> Maybe ConfigurationRevision
-> Maybe Text
-> Int
-> CreateConfigurationResponse
CreateConfigurationResponse'
            (Maybe POSIX
 -> Maybe ConfigurationState
 -> Maybe Text
 -> Maybe ConfigurationRevision
 -> Maybe Text
 -> Int
 -> CreateConfigurationResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe ConfigurationState
      -> Maybe Text
      -> Maybe ConfigurationRevision
      -> Maybe Text
      -> Int
      -> CreateConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"creationTime")
            Either
  String
  (Maybe ConfigurationState
   -> Maybe Text
   -> Maybe ConfigurationRevision
   -> Maybe Text
   -> Int
   -> CreateConfigurationResponse)
-> Either String (Maybe ConfigurationState)
-> Either
     String
     (Maybe Text
      -> Maybe ConfigurationRevision
      -> Maybe Text
      -> Int
      -> CreateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ConfigurationState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"state")
            Either
  String
  (Maybe Text
   -> Maybe ConfigurationRevision
   -> Maybe Text
   -> Int
   -> CreateConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ConfigurationRevision
      -> Maybe Text -> Int -> CreateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"arn")
            Either
  String
  (Maybe ConfigurationRevision
   -> Maybe Text -> Int -> CreateConfigurationResponse)
-> Either String (Maybe ConfigurationRevision)
-> Either String (Maybe Text -> Int -> CreateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ConfigurationRevision)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"latestRevision")
            Either String (Maybe Text -> Int -> CreateConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"name")
            Either String (Int -> CreateConfigurationResponse)
-> Either String Int -> Either String CreateConfigurationResponse
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 CreateConfiguration

instance Prelude.NFData CreateConfiguration

instance Core.ToHeaders CreateConfiguration where
  toHeaders :: CreateConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateConfiguration where
  toJSON :: CreateConfiguration -> Value
toJSON CreateConfiguration' {Maybe [Text]
Maybe Text
Text
Base64
name :: Text
serverProperties :: Base64
description :: Maybe Text
kafkaVersions :: Maybe [Text]
$sel:name:CreateConfiguration' :: CreateConfiguration -> Text
$sel:serverProperties:CreateConfiguration' :: CreateConfiguration -> Base64
$sel:description:CreateConfiguration' :: CreateConfiguration -> Maybe Text
$sel:kafkaVersions:CreateConfiguration' :: CreateConfiguration -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"kafkaVersions" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
kafkaVersions,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"serverProperties" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Base64
serverProperties),
            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)
          ]
      )

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

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

-- | /See:/ 'newCreateConfigurationResponse' smart constructor.
data CreateConfigurationResponse = CreateConfigurationResponse'
  { -- | The time when the configuration was created.
    CreateConfigurationResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The state of the configuration. The possible states are ACTIVE,
    -- DELETING, and DELETE_FAILED.
    CreateConfigurationResponse -> Maybe ConfigurationState
state :: Prelude.Maybe ConfigurationState,
    -- | The Amazon Resource Name (ARN) of the configuration.
    CreateConfigurationResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Latest revision of the configuration.
    CreateConfigurationResponse -> Maybe ConfigurationRevision
latestRevision :: Prelude.Maybe ConfigurationRevision,
    -- | The name of the configuration.
    CreateConfigurationResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateConfigurationResponse -> CreateConfigurationResponse -> Bool
(CreateConfigurationResponse
 -> CreateConfigurationResponse -> Bool)
-> (CreateConfigurationResponse
    -> CreateConfigurationResponse -> Bool)
-> Eq CreateConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConfigurationResponse -> CreateConfigurationResponse -> Bool
$c/= :: CreateConfigurationResponse -> CreateConfigurationResponse -> Bool
== :: CreateConfigurationResponse -> CreateConfigurationResponse -> Bool
$c== :: CreateConfigurationResponse -> CreateConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreateConfigurationResponse]
ReadPrec CreateConfigurationResponse
Int -> ReadS CreateConfigurationResponse
ReadS [CreateConfigurationResponse]
(Int -> ReadS CreateConfigurationResponse)
-> ReadS [CreateConfigurationResponse]
-> ReadPrec CreateConfigurationResponse
-> ReadPrec [CreateConfigurationResponse]
-> Read CreateConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConfigurationResponse]
$creadListPrec :: ReadPrec [CreateConfigurationResponse]
readPrec :: ReadPrec CreateConfigurationResponse
$creadPrec :: ReadPrec CreateConfigurationResponse
readList :: ReadS [CreateConfigurationResponse]
$creadList :: ReadS [CreateConfigurationResponse]
readsPrec :: Int -> ReadS CreateConfigurationResponse
$creadsPrec :: Int -> ReadS CreateConfigurationResponse
Prelude.Read, Int -> CreateConfigurationResponse -> ShowS
[CreateConfigurationResponse] -> ShowS
CreateConfigurationResponse -> String
(Int -> CreateConfigurationResponse -> ShowS)
-> (CreateConfigurationResponse -> String)
-> ([CreateConfigurationResponse] -> ShowS)
-> Show CreateConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConfigurationResponse] -> ShowS
$cshowList :: [CreateConfigurationResponse] -> ShowS
show :: CreateConfigurationResponse -> String
$cshow :: CreateConfigurationResponse -> String
showsPrec :: Int -> CreateConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreateConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 CreateConfigurationResponse -> Rep CreateConfigurationResponse x)
-> (forall x.
    Rep CreateConfigurationResponse x -> CreateConfigurationResponse)
-> Generic CreateConfigurationResponse
forall x.
Rep CreateConfigurationResponse x -> CreateConfigurationResponse
forall x.
CreateConfigurationResponse -> Rep CreateConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateConfigurationResponse x -> CreateConfigurationResponse
$cfrom :: forall x.
CreateConfigurationResponse -> Rep CreateConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateConfigurationResponse' 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:
--
-- 'creationTime', 'createConfigurationResponse_creationTime' - The time when the configuration was created.
--
-- 'state', 'createConfigurationResponse_state' - The state of the configuration. The possible states are ACTIVE,
-- DELETING, and DELETE_FAILED.
--
-- 'arn', 'createConfigurationResponse_arn' - The Amazon Resource Name (ARN) of the configuration.
--
-- 'latestRevision', 'createConfigurationResponse_latestRevision' - Latest revision of the configuration.
--
-- 'name', 'createConfigurationResponse_name' - The name of the configuration.
--
-- 'httpStatus', 'createConfigurationResponse_httpStatus' - The response's http status code.
newCreateConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateConfigurationResponse
newCreateConfigurationResponse :: Int -> CreateConfigurationResponse
newCreateConfigurationResponse Int
pHttpStatus_ =
  CreateConfigurationResponse' :: Maybe POSIX
-> Maybe ConfigurationState
-> Maybe Text
-> Maybe ConfigurationRevision
-> Maybe Text
-> Int
-> CreateConfigurationResponse
CreateConfigurationResponse'
    { $sel:creationTime:CreateConfigurationResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:state:CreateConfigurationResponse' :: Maybe ConfigurationState
state = Maybe ConfigurationState
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateConfigurationResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestRevision:CreateConfigurationResponse' :: Maybe ConfigurationRevision
latestRevision = Maybe ConfigurationRevision
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateConfigurationResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The time when the configuration was created.
createConfigurationResponse_creationTime :: Lens.Lens' CreateConfigurationResponse (Prelude.Maybe Prelude.UTCTime)
createConfigurationResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateConfigurationResponse -> f CreateConfigurationResponse
createConfigurationResponse_creationTime = (CreateConfigurationResponse -> Maybe POSIX)
-> (CreateConfigurationResponse
    -> Maybe POSIX -> CreateConfigurationResponse)
-> Lens
     CreateConfigurationResponse
     CreateConfigurationResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:CreateConfigurationResponse' :: CreateConfigurationResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: CreateConfigurationResponse
s@CreateConfigurationResponse' {} Maybe POSIX
a -> CreateConfigurationResponse
s {$sel:creationTime:CreateConfigurationResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: CreateConfigurationResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateConfigurationResponse -> f CreateConfigurationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateConfigurationResponse
-> f CreateConfigurationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The state of the configuration. The possible states are ACTIVE,
-- DELETING, and DELETE_FAILED.
createConfigurationResponse_state :: Lens.Lens' CreateConfigurationResponse (Prelude.Maybe ConfigurationState)
createConfigurationResponse_state :: (Maybe ConfigurationState -> f (Maybe ConfigurationState))
-> CreateConfigurationResponse -> f CreateConfigurationResponse
createConfigurationResponse_state = (CreateConfigurationResponse -> Maybe ConfigurationState)
-> (CreateConfigurationResponse
    -> Maybe ConfigurationState -> CreateConfigurationResponse)
-> Lens
     CreateConfigurationResponse
     CreateConfigurationResponse
     (Maybe ConfigurationState)
     (Maybe ConfigurationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationResponse' {Maybe ConfigurationState
state :: Maybe ConfigurationState
$sel:state:CreateConfigurationResponse' :: CreateConfigurationResponse -> Maybe ConfigurationState
state} -> Maybe ConfigurationState
state) (\s :: CreateConfigurationResponse
s@CreateConfigurationResponse' {} Maybe ConfigurationState
a -> CreateConfigurationResponse
s {$sel:state:CreateConfigurationResponse' :: Maybe ConfigurationState
state = Maybe ConfigurationState
a} :: CreateConfigurationResponse)

-- | The Amazon Resource Name (ARN) of the configuration.
createConfigurationResponse_arn :: Lens.Lens' CreateConfigurationResponse (Prelude.Maybe Prelude.Text)
createConfigurationResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateConfigurationResponse -> f CreateConfigurationResponse
createConfigurationResponse_arn = (CreateConfigurationResponse -> Maybe Text)
-> (CreateConfigurationResponse
    -> Maybe Text -> CreateConfigurationResponse)
-> Lens
     CreateConfigurationResponse
     CreateConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateConfigurationResponse' :: CreateConfigurationResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateConfigurationResponse
s@CreateConfigurationResponse' {} Maybe Text
a -> CreateConfigurationResponse
s {$sel:arn:CreateConfigurationResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateConfigurationResponse)

-- | Latest revision of the configuration.
createConfigurationResponse_latestRevision :: Lens.Lens' CreateConfigurationResponse (Prelude.Maybe ConfigurationRevision)
createConfigurationResponse_latestRevision :: (Maybe ConfigurationRevision -> f (Maybe ConfigurationRevision))
-> CreateConfigurationResponse -> f CreateConfigurationResponse
createConfigurationResponse_latestRevision = (CreateConfigurationResponse -> Maybe ConfigurationRevision)
-> (CreateConfigurationResponse
    -> Maybe ConfigurationRevision -> CreateConfigurationResponse)
-> Lens
     CreateConfigurationResponse
     CreateConfigurationResponse
     (Maybe ConfigurationRevision)
     (Maybe ConfigurationRevision)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationResponse' {Maybe ConfigurationRevision
latestRevision :: Maybe ConfigurationRevision
$sel:latestRevision:CreateConfigurationResponse' :: CreateConfigurationResponse -> Maybe ConfigurationRevision
latestRevision} -> Maybe ConfigurationRevision
latestRevision) (\s :: CreateConfigurationResponse
s@CreateConfigurationResponse' {} Maybe ConfigurationRevision
a -> CreateConfigurationResponse
s {$sel:latestRevision:CreateConfigurationResponse' :: Maybe ConfigurationRevision
latestRevision = Maybe ConfigurationRevision
a} :: CreateConfigurationResponse)

-- | The name of the configuration.
createConfigurationResponse_name :: Lens.Lens' CreateConfigurationResponse (Prelude.Maybe Prelude.Text)
createConfigurationResponse_name :: (Maybe Text -> f (Maybe Text))
-> CreateConfigurationResponse -> f CreateConfigurationResponse
createConfigurationResponse_name = (CreateConfigurationResponse -> Maybe Text)
-> (CreateConfigurationResponse
    -> Maybe Text -> CreateConfigurationResponse)
-> Lens
     CreateConfigurationResponse
     CreateConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateConfigurationResponse' :: CreateConfigurationResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateConfigurationResponse
s@CreateConfigurationResponse' {} Maybe Text
a -> CreateConfigurationResponse
s {$sel:name:CreateConfigurationResponse' :: Maybe Text
name = Maybe Text
a} :: CreateConfigurationResponse)

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

instance Prelude.NFData CreateConfigurationResponse