{-# 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.UpdateConnection
-- 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)
--
-- Updates settings for a connection.
module Amazonka.CloudWatchEvents.UpdateConnection
  ( -- * Creating a Request
    UpdateConnection (..),
    newUpdateConnection,

    -- * Request Lenses
    updateConnection_authParameters,
    updateConnection_authorizationType,
    updateConnection_description,
    updateConnection_name,

    -- * Destructuring the Response
    UpdateConnectionResponse (..),
    newUpdateConnectionResponse,

    -- * Response Lenses
    updateConnectionResponse_creationTime,
    updateConnectionResponse_lastModifiedTime,
    updateConnectionResponse_lastAuthorizedTime,
    updateConnectionResponse_connectionArn,
    updateConnectionResponse_connectionState,
    updateConnectionResponse_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:/ 'newUpdateConnection' smart constructor.
data UpdateConnection = UpdateConnection'
  { -- | The authorization parameters to use for the connection.
    UpdateConnection -> Maybe UpdateConnectionAuthRequestParameters
authParameters :: Prelude.Maybe UpdateConnectionAuthRequestParameters,
    -- | The type of authorization to use for the connection.
    UpdateConnection -> Maybe ConnectionAuthorizationType
authorizationType :: Prelude.Maybe ConnectionAuthorizationType,
    -- | A description for the connection.
    UpdateConnection -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the connection to update.
    UpdateConnection -> Text
name :: Prelude.Text
  }
  deriving (UpdateConnection -> UpdateConnection -> Bool
(UpdateConnection -> UpdateConnection -> Bool)
-> (UpdateConnection -> UpdateConnection -> Bool)
-> Eq UpdateConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnection -> UpdateConnection -> Bool
$c/= :: UpdateConnection -> UpdateConnection -> Bool
== :: UpdateConnection -> UpdateConnection -> Bool
$c== :: UpdateConnection -> UpdateConnection -> Bool
Prelude.Eq, ReadPrec [UpdateConnection]
ReadPrec UpdateConnection
Int -> ReadS UpdateConnection
ReadS [UpdateConnection]
(Int -> ReadS UpdateConnection)
-> ReadS [UpdateConnection]
-> ReadPrec UpdateConnection
-> ReadPrec [UpdateConnection]
-> Read UpdateConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnection]
$creadListPrec :: ReadPrec [UpdateConnection]
readPrec :: ReadPrec UpdateConnection
$creadPrec :: ReadPrec UpdateConnection
readList :: ReadS [UpdateConnection]
$creadList :: ReadS [UpdateConnection]
readsPrec :: Int -> ReadS UpdateConnection
$creadsPrec :: Int -> ReadS UpdateConnection
Prelude.Read, Int -> UpdateConnection -> ShowS
[UpdateConnection] -> ShowS
UpdateConnection -> String
(Int -> UpdateConnection -> ShowS)
-> (UpdateConnection -> String)
-> ([UpdateConnection] -> ShowS)
-> Show UpdateConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnection] -> ShowS
$cshowList :: [UpdateConnection] -> ShowS
show :: UpdateConnection -> String
$cshow :: UpdateConnection -> String
showsPrec :: Int -> UpdateConnection -> ShowS
$cshowsPrec :: Int -> UpdateConnection -> ShowS
Prelude.Show, (forall x. UpdateConnection -> Rep UpdateConnection x)
-> (forall x. Rep UpdateConnection x -> UpdateConnection)
-> Generic UpdateConnection
forall x. Rep UpdateConnection x -> UpdateConnection
forall x. UpdateConnection -> Rep UpdateConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateConnection x -> UpdateConnection
$cfrom :: forall x. UpdateConnection -> Rep UpdateConnection x
Prelude.Generic)

-- |
-- Create a value of 'UpdateConnection' 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:
--
-- 'authParameters', 'updateConnection_authParameters' - The authorization parameters to use for the connection.
--
-- 'authorizationType', 'updateConnection_authorizationType' - The type of authorization to use for the connection.
--
-- 'description', 'updateConnection_description' - A description for the connection.
--
-- 'name', 'updateConnection_name' - The name of the connection to update.
newUpdateConnection ::
  -- | 'name'
  Prelude.Text ->
  UpdateConnection
newUpdateConnection :: Text -> UpdateConnection
newUpdateConnection Text
pName_ =
  UpdateConnection' :: Maybe UpdateConnectionAuthRequestParameters
-> Maybe ConnectionAuthorizationType
-> Maybe Text
-> Text
-> UpdateConnection
UpdateConnection'
    { $sel:authParameters:UpdateConnection' :: Maybe UpdateConnectionAuthRequestParameters
authParameters = Maybe UpdateConnectionAuthRequestParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationType:UpdateConnection' :: Maybe ConnectionAuthorizationType
authorizationType = Maybe ConnectionAuthorizationType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateConnection' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateConnection' :: Text
name = Text
pName_
    }

-- | The authorization parameters to use for the connection.
updateConnection_authParameters :: Lens.Lens' UpdateConnection (Prelude.Maybe UpdateConnectionAuthRequestParameters)
updateConnection_authParameters :: (Maybe UpdateConnectionAuthRequestParameters
 -> f (Maybe UpdateConnectionAuthRequestParameters))
-> UpdateConnection -> f UpdateConnection
updateConnection_authParameters = (UpdateConnection -> Maybe UpdateConnectionAuthRequestParameters)
-> (UpdateConnection
    -> Maybe UpdateConnectionAuthRequestParameters -> UpdateConnection)
-> Lens
     UpdateConnection
     UpdateConnection
     (Maybe UpdateConnectionAuthRequestParameters)
     (Maybe UpdateConnectionAuthRequestParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnection' {Maybe UpdateConnectionAuthRequestParameters
authParameters :: Maybe UpdateConnectionAuthRequestParameters
$sel:authParameters:UpdateConnection' :: UpdateConnection -> Maybe UpdateConnectionAuthRequestParameters
authParameters} -> Maybe UpdateConnectionAuthRequestParameters
authParameters) (\s :: UpdateConnection
s@UpdateConnection' {} Maybe UpdateConnectionAuthRequestParameters
a -> UpdateConnection
s {$sel:authParameters:UpdateConnection' :: Maybe UpdateConnectionAuthRequestParameters
authParameters = Maybe UpdateConnectionAuthRequestParameters
a} :: UpdateConnection)

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

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

-- | The name of the connection to update.
updateConnection_name :: Lens.Lens' UpdateConnection Prelude.Text
updateConnection_name :: (Text -> f Text) -> UpdateConnection -> f UpdateConnection
updateConnection_name = (UpdateConnection -> Text)
-> (UpdateConnection -> Text -> UpdateConnection)
-> Lens UpdateConnection UpdateConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnection' {Text
name :: Text
$sel:name:UpdateConnection' :: UpdateConnection -> Text
name} -> Text
name) (\s :: UpdateConnection
s@UpdateConnection' {} Text
a -> UpdateConnection
s {$sel:name:UpdateConnection' :: Text
name = Text
a} :: UpdateConnection)

instance Core.AWSRequest UpdateConnection where
  type
    AWSResponse UpdateConnection =
      UpdateConnectionResponse
  request :: UpdateConnection -> Request UpdateConnection
request = Service -> UpdateConnection -> Request UpdateConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateConnection
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateConnection)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateConnection))
-> Logger
-> Service
-> Proxy UpdateConnection
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateConnection)))
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 POSIX
-> Maybe Text
-> Maybe ConnectionState
-> Int
-> UpdateConnectionResponse
UpdateConnectionResponse'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ConnectionState
 -> Int
 -> UpdateConnectionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> UpdateConnectionResponse)
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 POSIX
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> UpdateConnectionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> UpdateConnectionResponse)
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 POSIX
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> UpdateConnectionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe ConnectionState -> Int -> UpdateConnectionResponse)
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
"LastAuthorizedTime")
            Either
  String
  (Maybe Text
   -> Maybe ConnectionState -> Int -> UpdateConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe ConnectionState -> Int -> UpdateConnectionResponse)
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 -> UpdateConnectionResponse)
-> Either String (Maybe ConnectionState)
-> Either String (Int -> UpdateConnectionResponse)
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 -> UpdateConnectionResponse)
-> Either String Int -> Either String UpdateConnectionResponse
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 UpdateConnection

instance Prelude.NFData UpdateConnection

instance Core.ToHeaders UpdateConnection where
  toHeaders :: UpdateConnection -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateConnection -> 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.UpdateConnection" :: 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 UpdateConnection where
  toJSON :: UpdateConnection -> Value
toJSON UpdateConnection' {Maybe Text
Maybe ConnectionAuthorizationType
Maybe UpdateConnectionAuthRequestParameters
Text
name :: Text
description :: Maybe Text
authorizationType :: Maybe ConnectionAuthorizationType
authParameters :: Maybe UpdateConnectionAuthRequestParameters
$sel:name:UpdateConnection' :: UpdateConnection -> Text
$sel:description:UpdateConnection' :: UpdateConnection -> Maybe Text
$sel:authorizationType:UpdateConnection' :: UpdateConnection -> Maybe ConnectionAuthorizationType
$sel:authParameters:UpdateConnection' :: UpdateConnection -> Maybe UpdateConnectionAuthRequestParameters
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AuthParameters" Text -> UpdateConnectionAuthRequestParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (UpdateConnectionAuthRequestParameters -> Pair)
-> Maybe UpdateConnectionAuthRequestParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateConnectionAuthRequestParameters
authParameters,
            (Text
"AuthorizationType" Text -> ConnectionAuthorizationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ConnectionAuthorizationType -> Pair)
-> Maybe ConnectionAuthorizationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectionAuthorizationType
authorizationType,
            (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)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateConnectionResponse' 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', 'updateConnectionResponse_creationTime' - A time stamp for the time that the connection was created.
--
-- 'lastModifiedTime', 'updateConnectionResponse_lastModifiedTime' - A time stamp for the time that the connection was last modified.
--
-- 'lastAuthorizedTime', 'updateConnectionResponse_lastAuthorizedTime' - A time stamp for the time that the connection was last authorized.
--
-- 'connectionArn', 'updateConnectionResponse_connectionArn' - The ARN of the connection that was updated.
--
-- 'connectionState', 'updateConnectionResponse_connectionState' - The state of the connection that was updated.
--
-- 'httpStatus', 'updateConnectionResponse_httpStatus' - The response's http status code.
newUpdateConnectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateConnectionResponse
newUpdateConnectionResponse :: Int -> UpdateConnectionResponse
newUpdateConnectionResponse Int
pHttpStatus_ =
  UpdateConnectionResponse' :: Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ConnectionState
-> Int
-> UpdateConnectionResponse
UpdateConnectionResponse'
    { $sel:creationTime:UpdateConnectionResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:UpdateConnectionResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastAuthorizedTime:UpdateConnectionResponse' :: Maybe POSIX
lastAuthorizedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionArn:UpdateConnectionResponse' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionState:UpdateConnectionResponse' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateConnectionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A time stamp for the time that the connection was created.
updateConnectionResponse_creationTime :: Lens.Lens' UpdateConnectionResponse (Prelude.Maybe Prelude.UTCTime)
updateConnectionResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConnectionResponse -> f UpdateConnectionResponse
updateConnectionResponse_creationTime = (UpdateConnectionResponse -> Maybe POSIX)
-> (UpdateConnectionResponse
    -> Maybe POSIX -> UpdateConnectionResponse)
-> Lens
     UpdateConnectionResponse
     UpdateConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:UpdateConnectionResponse' :: UpdateConnectionResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: UpdateConnectionResponse
s@UpdateConnectionResponse' {} Maybe POSIX
a -> UpdateConnectionResponse
s {$sel:creationTime:UpdateConnectionResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: UpdateConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateConnectionResponse -> f UpdateConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConnectionResponse
-> f UpdateConnectionResponse
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 modified.
updateConnectionResponse_lastModifiedTime :: Lens.Lens' UpdateConnectionResponse (Prelude.Maybe Prelude.UTCTime)
updateConnectionResponse_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConnectionResponse -> f UpdateConnectionResponse
updateConnectionResponse_lastModifiedTime = (UpdateConnectionResponse -> Maybe POSIX)
-> (UpdateConnectionResponse
    -> Maybe POSIX -> UpdateConnectionResponse)
-> Lens
     UpdateConnectionResponse
     UpdateConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:UpdateConnectionResponse' :: UpdateConnectionResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: UpdateConnectionResponse
s@UpdateConnectionResponse' {} Maybe POSIX
a -> UpdateConnectionResponse
s {$sel:lastModifiedTime:UpdateConnectionResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: UpdateConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateConnectionResponse -> f UpdateConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConnectionResponse
-> f UpdateConnectionResponse
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 authorized.
updateConnectionResponse_lastAuthorizedTime :: Lens.Lens' UpdateConnectionResponse (Prelude.Maybe Prelude.UTCTime)
updateConnectionResponse_lastAuthorizedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConnectionResponse -> f UpdateConnectionResponse
updateConnectionResponse_lastAuthorizedTime = (UpdateConnectionResponse -> Maybe POSIX)
-> (UpdateConnectionResponse
    -> Maybe POSIX -> UpdateConnectionResponse)
-> Lens
     UpdateConnectionResponse
     UpdateConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionResponse' {Maybe POSIX
lastAuthorizedTime :: Maybe POSIX
$sel:lastAuthorizedTime:UpdateConnectionResponse' :: UpdateConnectionResponse -> Maybe POSIX
lastAuthorizedTime} -> Maybe POSIX
lastAuthorizedTime) (\s :: UpdateConnectionResponse
s@UpdateConnectionResponse' {} Maybe POSIX
a -> UpdateConnectionResponse
s {$sel:lastAuthorizedTime:UpdateConnectionResponse' :: Maybe POSIX
lastAuthorizedTime = Maybe POSIX
a} :: UpdateConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateConnectionResponse -> f UpdateConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConnectionResponse
-> f UpdateConnectionResponse
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 updated.
updateConnectionResponse_connectionArn :: Lens.Lens' UpdateConnectionResponse (Prelude.Maybe Prelude.Text)
updateConnectionResponse_connectionArn :: (Maybe Text -> f (Maybe Text))
-> UpdateConnectionResponse -> f UpdateConnectionResponse
updateConnectionResponse_connectionArn = (UpdateConnectionResponse -> Maybe Text)
-> (UpdateConnectionResponse
    -> Maybe Text -> UpdateConnectionResponse)
-> Lens
     UpdateConnectionResponse
     UpdateConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionResponse' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:UpdateConnectionResponse' :: UpdateConnectionResponse -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: UpdateConnectionResponse
s@UpdateConnectionResponse' {} Maybe Text
a -> UpdateConnectionResponse
s {$sel:connectionArn:UpdateConnectionResponse' :: Maybe Text
connectionArn = Maybe Text
a} :: UpdateConnectionResponse)

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

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

instance Prelude.NFData UpdateConnectionResponse