{-# 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.CloudWatchEvents.CreateConnection
-- 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 connection. A connection defines the authorization type and
-- credentials to use for authorization with an API destination HTTP
-- endpoint.
module Amazonka.CloudWatchEvents.CreateConnection
  ( -- * Creating a Request
    CreateConnection (..),
    newCreateConnection,

    -- * Request Lenses
    createConnection_description,
    createConnection_name,
    createConnection_authorizationType,
    createConnection_authParameters,

    -- * Destructuring the Response
    CreateConnectionResponse (..),
    newCreateConnectionResponse,

    -- * Response Lenses
    createConnectionResponse_creationTime,
    createConnectionResponse_lastModifiedTime,
    createConnectionResponse_connectionArn,
    createConnectionResponse_connectionState,
    createConnectionResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.Types
import qualified Amazonka.Core as Core
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:/ 'newCreateConnection' smart constructor.
data CreateConnection = CreateConnection'
  { -- | A description for the connection to create.
    CreateConnection -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name for the connection to create.
    CreateConnection -> Text
name :: Prelude.Text,
    -- | The type of authorization to use for the connection.
    CreateConnection -> ConnectionAuthorizationType
authorizationType :: ConnectionAuthorizationType,
    -- | A @CreateConnectionAuthRequestParameters@ object that contains the
    -- authorization parameters to use to authorize with the endpoint.
    CreateConnection -> CreateConnectionAuthRequestParameters
authParameters :: CreateConnectionAuthRequestParameters
  }
  deriving (CreateConnection -> CreateConnection -> Bool
(CreateConnection -> CreateConnection -> Bool)
-> (CreateConnection -> CreateConnection -> Bool)
-> Eq CreateConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConnection -> CreateConnection -> Bool
$c/= :: CreateConnection -> CreateConnection -> Bool
== :: CreateConnection -> CreateConnection -> Bool
$c== :: CreateConnection -> CreateConnection -> Bool
Prelude.Eq, ReadPrec [CreateConnection]
ReadPrec CreateConnection
Int -> ReadS CreateConnection
ReadS [CreateConnection]
(Int -> ReadS CreateConnection)
-> ReadS [CreateConnection]
-> ReadPrec CreateConnection
-> ReadPrec [CreateConnection]
-> Read CreateConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConnection]
$creadListPrec :: ReadPrec [CreateConnection]
readPrec :: ReadPrec CreateConnection
$creadPrec :: ReadPrec CreateConnection
readList :: ReadS [CreateConnection]
$creadList :: ReadS [CreateConnection]
readsPrec :: Int -> ReadS CreateConnection
$creadsPrec :: Int -> ReadS CreateConnection
Prelude.Read, Int -> CreateConnection -> ShowS
[CreateConnection] -> ShowS
CreateConnection -> String
(Int -> CreateConnection -> ShowS)
-> (CreateConnection -> String)
-> ([CreateConnection] -> ShowS)
-> Show CreateConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConnection] -> ShowS
$cshowList :: [CreateConnection] -> ShowS
show :: CreateConnection -> String
$cshow :: CreateConnection -> String
showsPrec :: Int -> CreateConnection -> ShowS
$cshowsPrec :: Int -> CreateConnection -> ShowS
Prelude.Show, (forall x. CreateConnection -> Rep CreateConnection x)
-> (forall x. Rep CreateConnection x -> CreateConnection)
-> Generic CreateConnection
forall x. Rep CreateConnection x -> CreateConnection
forall x. CreateConnection -> Rep CreateConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateConnection x -> CreateConnection
$cfrom :: forall x. CreateConnection -> Rep CreateConnection x
Prelude.Generic)

-- |
-- Create a value of 'CreateConnection' 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', 'createConnection_description' - A description for the connection to create.
--
-- 'name', 'createConnection_name' - The name for the connection to create.
--
-- 'authorizationType', 'createConnection_authorizationType' - The type of authorization to use for the connection.
--
-- 'authParameters', 'createConnection_authParameters' - A @CreateConnectionAuthRequestParameters@ object that contains the
-- authorization parameters to use to authorize with the endpoint.
newCreateConnection ::
  -- | 'name'
  Prelude.Text ->
  -- | 'authorizationType'
  ConnectionAuthorizationType ->
  -- | 'authParameters'
  CreateConnectionAuthRequestParameters ->
  CreateConnection
newCreateConnection :: Text
-> ConnectionAuthorizationType
-> CreateConnectionAuthRequestParameters
-> CreateConnection
newCreateConnection
  Text
pName_
  ConnectionAuthorizationType
pAuthorizationType_
  CreateConnectionAuthRequestParameters
pAuthParameters_ =
    CreateConnection' :: Maybe Text
-> Text
-> ConnectionAuthorizationType
-> CreateConnectionAuthRequestParameters
-> CreateConnection
CreateConnection'
      { $sel:description:CreateConnection' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateConnection' :: Text
name = Text
pName_,
        $sel:authorizationType:CreateConnection' :: ConnectionAuthorizationType
authorizationType = ConnectionAuthorizationType
pAuthorizationType_,
        $sel:authParameters:CreateConnection' :: CreateConnectionAuthRequestParameters
authParameters = CreateConnectionAuthRequestParameters
pAuthParameters_
      }

-- | A description for the connection to create.
createConnection_description :: Lens.Lens' CreateConnection (Prelude.Maybe Prelude.Text)
createConnection_description :: (Maybe Text -> f (Maybe Text))
-> CreateConnection -> f CreateConnection
createConnection_description = (CreateConnection -> Maybe Text)
-> (CreateConnection -> Maybe Text -> CreateConnection)
-> Lens CreateConnection CreateConnection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnection' {Maybe Text
description :: Maybe Text
$sel:description:CreateConnection' :: CreateConnection -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateConnection
s@CreateConnection' {} Maybe Text
a -> CreateConnection
s {$sel:description:CreateConnection' :: Maybe Text
description = Maybe Text
a} :: CreateConnection)

-- | The name for the connection to create.
createConnection_name :: Lens.Lens' CreateConnection Prelude.Text
createConnection_name :: (Text -> f Text) -> CreateConnection -> f CreateConnection
createConnection_name = (CreateConnection -> Text)
-> (CreateConnection -> Text -> CreateConnection)
-> Lens CreateConnection CreateConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnection' {Text
name :: Text
$sel:name:CreateConnection' :: CreateConnection -> Text
name} -> Text
name) (\s :: CreateConnection
s@CreateConnection' {} Text
a -> CreateConnection
s {$sel:name:CreateConnection' :: Text
name = Text
a} :: CreateConnection)

-- | The type of authorization to use for the connection.
createConnection_authorizationType :: Lens.Lens' CreateConnection ConnectionAuthorizationType
createConnection_authorizationType :: (ConnectionAuthorizationType -> f ConnectionAuthorizationType)
-> CreateConnection -> f CreateConnection
createConnection_authorizationType = (CreateConnection -> ConnectionAuthorizationType)
-> (CreateConnection
    -> ConnectionAuthorizationType -> CreateConnection)
-> Lens
     CreateConnection
     CreateConnection
     ConnectionAuthorizationType
     ConnectionAuthorizationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnection' {ConnectionAuthorizationType
authorizationType :: ConnectionAuthorizationType
$sel:authorizationType:CreateConnection' :: CreateConnection -> ConnectionAuthorizationType
authorizationType} -> ConnectionAuthorizationType
authorizationType) (\s :: CreateConnection
s@CreateConnection' {} ConnectionAuthorizationType
a -> CreateConnection
s {$sel:authorizationType:CreateConnection' :: ConnectionAuthorizationType
authorizationType = ConnectionAuthorizationType
a} :: CreateConnection)

-- | A @CreateConnectionAuthRequestParameters@ object that contains the
-- authorization parameters to use to authorize with the endpoint.
createConnection_authParameters :: Lens.Lens' CreateConnection CreateConnectionAuthRequestParameters
createConnection_authParameters :: (CreateConnectionAuthRequestParameters
 -> f CreateConnectionAuthRequestParameters)
-> CreateConnection -> f CreateConnection
createConnection_authParameters = (CreateConnection -> CreateConnectionAuthRequestParameters)
-> (CreateConnection
    -> CreateConnectionAuthRequestParameters -> CreateConnection)
-> Lens
     CreateConnection
     CreateConnection
     CreateConnectionAuthRequestParameters
     CreateConnectionAuthRequestParameters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnection' {CreateConnectionAuthRequestParameters
authParameters :: CreateConnectionAuthRequestParameters
$sel:authParameters:CreateConnection' :: CreateConnection -> CreateConnectionAuthRequestParameters
authParameters} -> CreateConnectionAuthRequestParameters
authParameters) (\s :: CreateConnection
s@CreateConnection' {} CreateConnectionAuthRequestParameters
a -> CreateConnection
s {$sel:authParameters:CreateConnection' :: CreateConnectionAuthRequestParameters
authParameters = CreateConnectionAuthRequestParameters
a} :: CreateConnection)

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

instance Prelude.NFData CreateConnection

instance Core.ToHeaders CreateConnection where
  toHeaders :: CreateConnection -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateConnection -> 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
"AWSEvents.CreateConnection" :: 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 CreateConnection where
  toJSON :: CreateConnection -> Value
toJSON CreateConnection' {Maybe Text
Text
ConnectionAuthorizationType
CreateConnectionAuthRequestParameters
authParameters :: CreateConnectionAuthRequestParameters
authorizationType :: ConnectionAuthorizationType
name :: Text
description :: Maybe Text
$sel:authParameters:CreateConnection' :: CreateConnection -> CreateConnectionAuthRequestParameters
$sel:authorizationType:CreateConnection' :: CreateConnection -> ConnectionAuthorizationType
$sel:name:CreateConnection' :: CreateConnection -> Text
$sel:description:CreateConnection' :: CreateConnection -> 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
"AuthorizationType" Text -> ConnectionAuthorizationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectionAuthorizationType
authorizationType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AuthParameters" Text -> CreateConnectionAuthRequestParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CreateConnectionAuthRequestParameters
authParameters)
          ]
      )

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

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

-- | /See:/ 'newCreateConnectionResponse' smart constructor.
data CreateConnectionResponse = CreateConnectionResponse'
  { -- | A time stamp for the time that the connection was created.
    CreateConnectionResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | A time stamp for the time that the connection was last updated.
    CreateConnectionResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the connection that was created by the request.
    CreateConnectionResponse -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
    -- | The state of the connection that was created by the request.
    CreateConnectionResponse -> Maybe ConnectionState
connectionState :: Prelude.Maybe ConnectionState,
    -- | The response's http status code.
    CreateConnectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateConnectionResponse -> CreateConnectionResponse -> Bool
(CreateConnectionResponse -> CreateConnectionResponse -> Bool)
-> (CreateConnectionResponse -> CreateConnectionResponse -> Bool)
-> Eq CreateConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConnectionResponse -> CreateConnectionResponse -> Bool
$c/= :: CreateConnectionResponse -> CreateConnectionResponse -> Bool
== :: CreateConnectionResponse -> CreateConnectionResponse -> Bool
$c== :: CreateConnectionResponse -> CreateConnectionResponse -> Bool
Prelude.Eq, ReadPrec [CreateConnectionResponse]
ReadPrec CreateConnectionResponse
Int -> ReadS CreateConnectionResponse
ReadS [CreateConnectionResponse]
(Int -> ReadS CreateConnectionResponse)
-> ReadS [CreateConnectionResponse]
-> ReadPrec CreateConnectionResponse
-> ReadPrec [CreateConnectionResponse]
-> Read CreateConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConnectionResponse]
$creadListPrec :: ReadPrec [CreateConnectionResponse]
readPrec :: ReadPrec CreateConnectionResponse
$creadPrec :: ReadPrec CreateConnectionResponse
readList :: ReadS [CreateConnectionResponse]
$creadList :: ReadS [CreateConnectionResponse]
readsPrec :: Int -> ReadS CreateConnectionResponse
$creadsPrec :: Int -> ReadS CreateConnectionResponse
Prelude.Read, Int -> CreateConnectionResponse -> ShowS
[CreateConnectionResponse] -> ShowS
CreateConnectionResponse -> String
(Int -> CreateConnectionResponse -> ShowS)
-> (CreateConnectionResponse -> String)
-> ([CreateConnectionResponse] -> ShowS)
-> Show CreateConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConnectionResponse] -> ShowS
$cshowList :: [CreateConnectionResponse] -> ShowS
show :: CreateConnectionResponse -> String
$cshow :: CreateConnectionResponse -> String
showsPrec :: Int -> CreateConnectionResponse -> ShowS
$cshowsPrec :: Int -> CreateConnectionResponse -> ShowS
Prelude.Show, (forall x.
 CreateConnectionResponse -> Rep CreateConnectionResponse x)
-> (forall x.
    Rep CreateConnectionResponse x -> CreateConnectionResponse)
-> Generic CreateConnectionResponse
forall x.
Rep CreateConnectionResponse x -> CreateConnectionResponse
forall x.
CreateConnectionResponse -> Rep CreateConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateConnectionResponse x -> CreateConnectionResponse
$cfrom :: forall x.
CreateConnectionResponse -> Rep CreateConnectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateConnectionResponse' 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', 'createConnectionResponse_creationTime' - A time stamp for the time that the connection was created.
--
-- 'lastModifiedTime', 'createConnectionResponse_lastModifiedTime' - A time stamp for the time that the connection was last updated.
--
-- 'connectionArn', 'createConnectionResponse_connectionArn' - The ARN of the connection that was created by the request.
--
-- 'connectionState', 'createConnectionResponse_connectionState' - The state of the connection that was created by the request.
--
-- 'httpStatus', 'createConnectionResponse_httpStatus' - The response's http status code.
newCreateConnectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateConnectionResponse
newCreateConnectionResponse :: Int -> CreateConnectionResponse
newCreateConnectionResponse Int
pHttpStatus_ =
  CreateConnectionResponse' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ConnectionState
-> Int
-> CreateConnectionResponse
CreateConnectionResponse'
    { $sel:creationTime:CreateConnectionResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:CreateConnectionResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionArn:CreateConnectionResponse' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionState:CreateConnectionResponse' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateConnectionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A time stamp for the time that the connection was created.
createConnectionResponse_creationTime :: Lens.Lens' CreateConnectionResponse (Prelude.Maybe Prelude.UTCTime)
createConnectionResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateConnectionResponse -> f CreateConnectionResponse
createConnectionResponse_creationTime = (CreateConnectionResponse -> Maybe POSIX)
-> (CreateConnectionResponse
    -> Maybe POSIX -> CreateConnectionResponse)
-> Lens
     CreateConnectionResponse
     CreateConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:CreateConnectionResponse' :: CreateConnectionResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: CreateConnectionResponse
s@CreateConnectionResponse' {} Maybe POSIX
a -> CreateConnectionResponse
s {$sel:creationTime:CreateConnectionResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: CreateConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateConnectionResponse -> f CreateConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateConnectionResponse
-> f CreateConnectionResponse
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

-- | A time stamp for the time that the connection was last updated.
createConnectionResponse_lastModifiedTime :: Lens.Lens' CreateConnectionResponse (Prelude.Maybe Prelude.UTCTime)
createConnectionResponse_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateConnectionResponse -> f CreateConnectionResponse
createConnectionResponse_lastModifiedTime = (CreateConnectionResponse -> Maybe POSIX)
-> (CreateConnectionResponse
    -> Maybe POSIX -> CreateConnectionResponse)
-> Lens
     CreateConnectionResponse
     CreateConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:CreateConnectionResponse' :: CreateConnectionResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: CreateConnectionResponse
s@CreateConnectionResponse' {} Maybe POSIX
a -> CreateConnectionResponse
s {$sel:lastModifiedTime:CreateConnectionResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: CreateConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateConnectionResponse -> f CreateConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateConnectionResponse
-> f CreateConnectionResponse
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 ARN of the connection that was created by the request.
createConnectionResponse_connectionArn :: Lens.Lens' CreateConnectionResponse (Prelude.Maybe Prelude.Text)
createConnectionResponse_connectionArn :: (Maybe Text -> f (Maybe Text))
-> CreateConnectionResponse -> f CreateConnectionResponse
createConnectionResponse_connectionArn = (CreateConnectionResponse -> Maybe Text)
-> (CreateConnectionResponse
    -> Maybe Text -> CreateConnectionResponse)
-> Lens
     CreateConnectionResponse
     CreateConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionResponse' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:CreateConnectionResponse' :: CreateConnectionResponse -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: CreateConnectionResponse
s@CreateConnectionResponse' {} Maybe Text
a -> CreateConnectionResponse
s {$sel:connectionArn:CreateConnectionResponse' :: Maybe Text
connectionArn = Maybe Text
a} :: CreateConnectionResponse)

-- | The state of the connection that was created by the request.
createConnectionResponse_connectionState :: Lens.Lens' CreateConnectionResponse (Prelude.Maybe ConnectionState)
createConnectionResponse_connectionState :: (Maybe ConnectionState -> f (Maybe ConnectionState))
-> CreateConnectionResponse -> f CreateConnectionResponse
createConnectionResponse_connectionState = (CreateConnectionResponse -> Maybe ConnectionState)
-> (CreateConnectionResponse
    -> Maybe ConnectionState -> CreateConnectionResponse)
-> Lens
     CreateConnectionResponse
     CreateConnectionResponse
     (Maybe ConnectionState)
     (Maybe ConnectionState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionResponse' {Maybe ConnectionState
connectionState :: Maybe ConnectionState
$sel:connectionState:CreateConnectionResponse' :: CreateConnectionResponse -> Maybe ConnectionState
connectionState} -> Maybe ConnectionState
connectionState) (\s :: CreateConnectionResponse
s@CreateConnectionResponse' {} Maybe ConnectionState
a -> CreateConnectionResponse
s {$sel:connectionState:CreateConnectionResponse' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
a} :: CreateConnectionResponse)

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

instance Prelude.NFData CreateConnectionResponse