{-# 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.KafkaConnect.CreateWorkerConfiguration
-- 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 worker configuration using the specified properties.
module Amazonka.KafkaConnect.CreateWorkerConfiguration
  ( -- * Creating a Request
    CreateWorkerConfiguration (..),
    newCreateWorkerConfiguration,

    -- * Request Lenses
    createWorkerConfiguration_description,
    createWorkerConfiguration_name,
    createWorkerConfiguration_propertiesFileContent,

    -- * Destructuring the Response
    CreateWorkerConfigurationResponse (..),
    newCreateWorkerConfigurationResponse,

    -- * Response Lenses
    createWorkerConfigurationResponse_creationTime,
    createWorkerConfigurationResponse_latestRevision,
    createWorkerConfigurationResponse_name,
    createWorkerConfigurationResponse_workerConfigurationArn,
    createWorkerConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.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:/ 'newCreateWorkerConfiguration' smart constructor.
data CreateWorkerConfiguration = CreateWorkerConfiguration'
  { -- | A summary description of the worker configuration.
    CreateWorkerConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the worker configuration.
    CreateWorkerConfiguration -> Text
name :: Prelude.Text,
    -- | Base64 encoded contents of connect-distributed.properties file.
    CreateWorkerConfiguration -> Text
propertiesFileContent :: Prelude.Text
  }
  deriving (CreateWorkerConfiguration -> CreateWorkerConfiguration -> Bool
(CreateWorkerConfiguration -> CreateWorkerConfiguration -> Bool)
-> (CreateWorkerConfiguration -> CreateWorkerConfiguration -> Bool)
-> Eq CreateWorkerConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkerConfiguration -> CreateWorkerConfiguration -> Bool
$c/= :: CreateWorkerConfiguration -> CreateWorkerConfiguration -> Bool
== :: CreateWorkerConfiguration -> CreateWorkerConfiguration -> Bool
$c== :: CreateWorkerConfiguration -> CreateWorkerConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateWorkerConfiguration]
ReadPrec CreateWorkerConfiguration
Int -> ReadS CreateWorkerConfiguration
ReadS [CreateWorkerConfiguration]
(Int -> ReadS CreateWorkerConfiguration)
-> ReadS [CreateWorkerConfiguration]
-> ReadPrec CreateWorkerConfiguration
-> ReadPrec [CreateWorkerConfiguration]
-> Read CreateWorkerConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkerConfiguration]
$creadListPrec :: ReadPrec [CreateWorkerConfiguration]
readPrec :: ReadPrec CreateWorkerConfiguration
$creadPrec :: ReadPrec CreateWorkerConfiguration
readList :: ReadS [CreateWorkerConfiguration]
$creadList :: ReadS [CreateWorkerConfiguration]
readsPrec :: Int -> ReadS CreateWorkerConfiguration
$creadsPrec :: Int -> ReadS CreateWorkerConfiguration
Prelude.Read, Int -> CreateWorkerConfiguration -> ShowS
[CreateWorkerConfiguration] -> ShowS
CreateWorkerConfiguration -> String
(Int -> CreateWorkerConfiguration -> ShowS)
-> (CreateWorkerConfiguration -> String)
-> ([CreateWorkerConfiguration] -> ShowS)
-> Show CreateWorkerConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkerConfiguration] -> ShowS
$cshowList :: [CreateWorkerConfiguration] -> ShowS
show :: CreateWorkerConfiguration -> String
$cshow :: CreateWorkerConfiguration -> String
showsPrec :: Int -> CreateWorkerConfiguration -> ShowS
$cshowsPrec :: Int -> CreateWorkerConfiguration -> ShowS
Prelude.Show, (forall x.
 CreateWorkerConfiguration -> Rep CreateWorkerConfiguration x)
-> (forall x.
    Rep CreateWorkerConfiguration x -> CreateWorkerConfiguration)
-> Generic CreateWorkerConfiguration
forall x.
Rep CreateWorkerConfiguration x -> CreateWorkerConfiguration
forall x.
CreateWorkerConfiguration -> Rep CreateWorkerConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorkerConfiguration x -> CreateWorkerConfiguration
$cfrom :: forall x.
CreateWorkerConfiguration -> Rep CreateWorkerConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkerConfiguration' 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:
--
-- 'description', 'createWorkerConfiguration_description' - A summary description of the worker configuration.
--
-- 'name', 'createWorkerConfiguration_name' - The name of the worker configuration.
--
-- 'propertiesFileContent', 'createWorkerConfiguration_propertiesFileContent' - Base64 encoded contents of connect-distributed.properties file.
newCreateWorkerConfiguration ::
  -- | 'name'
  Prelude.Text ->
  -- | 'propertiesFileContent'
  Prelude.Text ->
  CreateWorkerConfiguration
newCreateWorkerConfiguration :: Text -> Text -> CreateWorkerConfiguration
newCreateWorkerConfiguration
  Text
pName_
  Text
pPropertiesFileContent_ =
    CreateWorkerConfiguration' :: Maybe Text -> Text -> Text -> CreateWorkerConfiguration
CreateWorkerConfiguration'
      { $sel:description:CreateWorkerConfiguration' :: Maybe Text
description =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateWorkerConfiguration' :: Text
name = Text
pName_,
        $sel:propertiesFileContent:CreateWorkerConfiguration' :: Text
propertiesFileContent = Text
pPropertiesFileContent_
      }

-- | A summary description of the worker configuration.
createWorkerConfiguration_description :: Lens.Lens' CreateWorkerConfiguration (Prelude.Maybe Prelude.Text)
createWorkerConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> CreateWorkerConfiguration -> f CreateWorkerConfiguration
createWorkerConfiguration_description = (CreateWorkerConfiguration -> Maybe Text)
-> (CreateWorkerConfiguration
    -> Maybe Text -> CreateWorkerConfiguration)
-> Lens
     CreateWorkerConfiguration
     CreateWorkerConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkerConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:CreateWorkerConfiguration' :: CreateWorkerConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateWorkerConfiguration
s@CreateWorkerConfiguration' {} Maybe Text
a -> CreateWorkerConfiguration
s {$sel:description:CreateWorkerConfiguration' :: Maybe Text
description = Maybe Text
a} :: CreateWorkerConfiguration)

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

-- | Base64 encoded contents of connect-distributed.properties file.
createWorkerConfiguration_propertiesFileContent :: Lens.Lens' CreateWorkerConfiguration Prelude.Text
createWorkerConfiguration_propertiesFileContent :: (Text -> f Text)
-> CreateWorkerConfiguration -> f CreateWorkerConfiguration
createWorkerConfiguration_propertiesFileContent = (CreateWorkerConfiguration -> Text)
-> (CreateWorkerConfiguration -> Text -> CreateWorkerConfiguration)
-> Lens
     CreateWorkerConfiguration CreateWorkerConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkerConfiguration' {Text
propertiesFileContent :: Text
$sel:propertiesFileContent:CreateWorkerConfiguration' :: CreateWorkerConfiguration -> Text
propertiesFileContent} -> Text
propertiesFileContent) (\s :: CreateWorkerConfiguration
s@CreateWorkerConfiguration' {} Text
a -> CreateWorkerConfiguration
s {$sel:propertiesFileContent:CreateWorkerConfiguration' :: Text
propertiesFileContent = Text
a} :: CreateWorkerConfiguration)

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

instance Prelude.NFData CreateWorkerConfiguration

instance Core.ToHeaders CreateWorkerConfiguration where
  toHeaders :: CreateWorkerConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorkerConfiguration -> 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 CreateWorkerConfiguration where
  toJSON :: CreateWorkerConfiguration -> Value
toJSON CreateWorkerConfiguration' {Maybe Text
Text
propertiesFileContent :: Text
name :: Text
description :: Maybe Text
$sel:propertiesFileContent:CreateWorkerConfiguration' :: CreateWorkerConfiguration -> Text
$sel:name:CreateWorkerConfiguration' :: CreateWorkerConfiguration -> Text
$sel:description:CreateWorkerConfiguration' :: CreateWorkerConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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
"propertiesFileContent"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
propertiesFileContent
              )
          ]
      )

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

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

-- | /See:/ 'newCreateWorkerConfigurationResponse' smart constructor.
data CreateWorkerConfigurationResponse = CreateWorkerConfigurationResponse'
  { -- | The time that the worker configuration was created.
    CreateWorkerConfigurationResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The latest revision of the worker configuration.
    CreateWorkerConfigurationResponse
-> Maybe WorkerConfigurationRevisionSummary
latestRevision :: Prelude.Maybe WorkerConfigurationRevisionSummary,
    -- | The name of the worker configuration.
    CreateWorkerConfigurationResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) that Amazon assigned to the worker
    -- configuration.
    CreateWorkerConfigurationResponse -> Maybe Text
workerConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWorkerConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorkerConfigurationResponse
-> CreateWorkerConfigurationResponse -> Bool
(CreateWorkerConfigurationResponse
 -> CreateWorkerConfigurationResponse -> Bool)
-> (CreateWorkerConfigurationResponse
    -> CreateWorkerConfigurationResponse -> Bool)
-> Eq CreateWorkerConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkerConfigurationResponse
-> CreateWorkerConfigurationResponse -> Bool
$c/= :: CreateWorkerConfigurationResponse
-> CreateWorkerConfigurationResponse -> Bool
== :: CreateWorkerConfigurationResponse
-> CreateWorkerConfigurationResponse -> Bool
$c== :: CreateWorkerConfigurationResponse
-> CreateWorkerConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorkerConfigurationResponse]
ReadPrec CreateWorkerConfigurationResponse
Int -> ReadS CreateWorkerConfigurationResponse
ReadS [CreateWorkerConfigurationResponse]
(Int -> ReadS CreateWorkerConfigurationResponse)
-> ReadS [CreateWorkerConfigurationResponse]
-> ReadPrec CreateWorkerConfigurationResponse
-> ReadPrec [CreateWorkerConfigurationResponse]
-> Read CreateWorkerConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkerConfigurationResponse]
$creadListPrec :: ReadPrec [CreateWorkerConfigurationResponse]
readPrec :: ReadPrec CreateWorkerConfigurationResponse
$creadPrec :: ReadPrec CreateWorkerConfigurationResponse
readList :: ReadS [CreateWorkerConfigurationResponse]
$creadList :: ReadS [CreateWorkerConfigurationResponse]
readsPrec :: Int -> ReadS CreateWorkerConfigurationResponse
$creadsPrec :: Int -> ReadS CreateWorkerConfigurationResponse
Prelude.Read, Int -> CreateWorkerConfigurationResponse -> ShowS
[CreateWorkerConfigurationResponse] -> ShowS
CreateWorkerConfigurationResponse -> String
(Int -> CreateWorkerConfigurationResponse -> ShowS)
-> (CreateWorkerConfigurationResponse -> String)
-> ([CreateWorkerConfigurationResponse] -> ShowS)
-> Show CreateWorkerConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkerConfigurationResponse] -> ShowS
$cshowList :: [CreateWorkerConfigurationResponse] -> ShowS
show :: CreateWorkerConfigurationResponse -> String
$cshow :: CreateWorkerConfigurationResponse -> String
showsPrec :: Int -> CreateWorkerConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreateWorkerConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 CreateWorkerConfigurationResponse
 -> Rep CreateWorkerConfigurationResponse x)
-> (forall x.
    Rep CreateWorkerConfigurationResponse x
    -> CreateWorkerConfigurationResponse)
-> Generic CreateWorkerConfigurationResponse
forall x.
Rep CreateWorkerConfigurationResponse x
-> CreateWorkerConfigurationResponse
forall x.
CreateWorkerConfigurationResponse
-> Rep CreateWorkerConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorkerConfigurationResponse x
-> CreateWorkerConfigurationResponse
$cfrom :: forall x.
CreateWorkerConfigurationResponse
-> Rep CreateWorkerConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkerConfigurationResponse' 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', 'createWorkerConfigurationResponse_creationTime' - The time that the worker configuration was created.
--
-- 'latestRevision', 'createWorkerConfigurationResponse_latestRevision' - The latest revision of the worker configuration.
--
-- 'name', 'createWorkerConfigurationResponse_name' - The name of the worker configuration.
--
-- 'workerConfigurationArn', 'createWorkerConfigurationResponse_workerConfigurationArn' - The Amazon Resource Name (ARN) that Amazon assigned to the worker
-- configuration.
--
-- 'httpStatus', 'createWorkerConfigurationResponse_httpStatus' - The response's http status code.
newCreateWorkerConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorkerConfigurationResponse
newCreateWorkerConfigurationResponse :: Int -> CreateWorkerConfigurationResponse
newCreateWorkerConfigurationResponse Int
pHttpStatus_ =
  CreateWorkerConfigurationResponse' :: Maybe POSIX
-> Maybe WorkerConfigurationRevisionSummary
-> Maybe Text
-> Maybe Text
-> Int
-> CreateWorkerConfigurationResponse
CreateWorkerConfigurationResponse'
    { $sel:creationTime:CreateWorkerConfigurationResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestRevision:CreateWorkerConfigurationResponse' :: Maybe WorkerConfigurationRevisionSummary
latestRevision = Maybe WorkerConfigurationRevisionSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateWorkerConfigurationResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workerConfigurationArn:CreateWorkerConfigurationResponse' :: Maybe Text
workerConfigurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorkerConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The time that the worker configuration was created.
createWorkerConfigurationResponse_creationTime :: Lens.Lens' CreateWorkerConfigurationResponse (Prelude.Maybe Prelude.UTCTime)
createWorkerConfigurationResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateWorkerConfigurationResponse
-> f CreateWorkerConfigurationResponse
createWorkerConfigurationResponse_creationTime = (CreateWorkerConfigurationResponse -> Maybe POSIX)
-> (CreateWorkerConfigurationResponse
    -> Maybe POSIX -> CreateWorkerConfigurationResponse)
-> Lens
     CreateWorkerConfigurationResponse
     CreateWorkerConfigurationResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkerConfigurationResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:CreateWorkerConfigurationResponse' :: CreateWorkerConfigurationResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: CreateWorkerConfigurationResponse
s@CreateWorkerConfigurationResponse' {} Maybe POSIX
a -> CreateWorkerConfigurationResponse
s {$sel:creationTime:CreateWorkerConfigurationResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: CreateWorkerConfigurationResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateWorkerConfigurationResponse
 -> f CreateWorkerConfigurationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateWorkerConfigurationResponse
-> f CreateWorkerConfigurationResponse
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 latest revision of the worker configuration.
createWorkerConfigurationResponse_latestRevision :: Lens.Lens' CreateWorkerConfigurationResponse (Prelude.Maybe WorkerConfigurationRevisionSummary)
createWorkerConfigurationResponse_latestRevision :: (Maybe WorkerConfigurationRevisionSummary
 -> f (Maybe WorkerConfigurationRevisionSummary))
-> CreateWorkerConfigurationResponse
-> f CreateWorkerConfigurationResponse
createWorkerConfigurationResponse_latestRevision = (CreateWorkerConfigurationResponse
 -> Maybe WorkerConfigurationRevisionSummary)
-> (CreateWorkerConfigurationResponse
    -> Maybe WorkerConfigurationRevisionSummary
    -> CreateWorkerConfigurationResponse)
-> Lens
     CreateWorkerConfigurationResponse
     CreateWorkerConfigurationResponse
     (Maybe WorkerConfigurationRevisionSummary)
     (Maybe WorkerConfigurationRevisionSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkerConfigurationResponse' {Maybe WorkerConfigurationRevisionSummary
latestRevision :: Maybe WorkerConfigurationRevisionSummary
$sel:latestRevision:CreateWorkerConfigurationResponse' :: CreateWorkerConfigurationResponse
-> Maybe WorkerConfigurationRevisionSummary
latestRevision} -> Maybe WorkerConfigurationRevisionSummary
latestRevision) (\s :: CreateWorkerConfigurationResponse
s@CreateWorkerConfigurationResponse' {} Maybe WorkerConfigurationRevisionSummary
a -> CreateWorkerConfigurationResponse
s {$sel:latestRevision:CreateWorkerConfigurationResponse' :: Maybe WorkerConfigurationRevisionSummary
latestRevision = Maybe WorkerConfigurationRevisionSummary
a} :: CreateWorkerConfigurationResponse)

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

-- | The Amazon Resource Name (ARN) that Amazon assigned to the worker
-- configuration.
createWorkerConfigurationResponse_workerConfigurationArn :: Lens.Lens' CreateWorkerConfigurationResponse (Prelude.Maybe Prelude.Text)
createWorkerConfigurationResponse_workerConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> CreateWorkerConfigurationResponse
-> f CreateWorkerConfigurationResponse
createWorkerConfigurationResponse_workerConfigurationArn = (CreateWorkerConfigurationResponse -> Maybe Text)
-> (CreateWorkerConfigurationResponse
    -> Maybe Text -> CreateWorkerConfigurationResponse)
-> Lens
     CreateWorkerConfigurationResponse
     CreateWorkerConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkerConfigurationResponse' {Maybe Text
workerConfigurationArn :: Maybe Text
$sel:workerConfigurationArn:CreateWorkerConfigurationResponse' :: CreateWorkerConfigurationResponse -> Maybe Text
workerConfigurationArn} -> Maybe Text
workerConfigurationArn) (\s :: CreateWorkerConfigurationResponse
s@CreateWorkerConfigurationResponse' {} Maybe Text
a -> CreateWorkerConfigurationResponse
s {$sel:workerConfigurationArn:CreateWorkerConfigurationResponse' :: Maybe Text
workerConfigurationArn = Maybe Text
a} :: CreateWorkerConfigurationResponse)

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

instance
  Prelude.NFData
    CreateWorkerConfigurationResponse