{-# 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.UpdateApiDestination
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an API destination.
module Amazonka.CloudWatchEvents.UpdateApiDestination
  ( -- * Creating a Request
    UpdateApiDestination (..),
    newUpdateApiDestination,

    -- * Request Lenses
    updateApiDestination_connectionArn,
    updateApiDestination_description,
    updateApiDestination_httpMethod,
    updateApiDestination_invocationEndpoint,
    updateApiDestination_invocationRateLimitPerSecond,
    updateApiDestination_name,

    -- * Destructuring the Response
    UpdateApiDestinationResponse (..),
    newUpdateApiDestinationResponse,

    -- * Response Lenses
    updateApiDestinationResponse_apiDestinationArn,
    updateApiDestinationResponse_apiDestinationState,
    updateApiDestinationResponse_creationTime,
    updateApiDestinationResponse_lastModifiedTime,
    updateApiDestinationResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateApiDestination' smart constructor.
data UpdateApiDestination = UpdateApiDestination'
  { -- | The ARN of the connection to use for the API destination.
    UpdateApiDestination -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the API destination to update.
    UpdateApiDestination -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The method to use for the API destination.
    UpdateApiDestination -> Maybe ApiDestinationHttpMethod
httpMethod :: Prelude.Maybe ApiDestinationHttpMethod,
    -- | The URL to the endpoint to use for the API destination.
    UpdateApiDestination -> Maybe Text
invocationEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of invocations per second to send to the API
    -- destination.
    UpdateApiDestination -> Maybe Natural
invocationRateLimitPerSecond :: Prelude.Maybe Prelude.Natural,
    -- | The name of the API destination to update.
    UpdateApiDestination -> Text
name :: Prelude.Text
  }
  deriving (UpdateApiDestination -> UpdateApiDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApiDestination -> UpdateApiDestination -> Bool
$c/= :: UpdateApiDestination -> UpdateApiDestination -> Bool
== :: UpdateApiDestination -> UpdateApiDestination -> Bool
$c== :: UpdateApiDestination -> UpdateApiDestination -> Bool
Prelude.Eq, ReadPrec [UpdateApiDestination]
ReadPrec UpdateApiDestination
Int -> ReadS UpdateApiDestination
ReadS [UpdateApiDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApiDestination]
$creadListPrec :: ReadPrec [UpdateApiDestination]
readPrec :: ReadPrec UpdateApiDestination
$creadPrec :: ReadPrec UpdateApiDestination
readList :: ReadS [UpdateApiDestination]
$creadList :: ReadS [UpdateApiDestination]
readsPrec :: Int -> ReadS UpdateApiDestination
$creadsPrec :: Int -> ReadS UpdateApiDestination
Prelude.Read, Int -> UpdateApiDestination -> ShowS
[UpdateApiDestination] -> ShowS
UpdateApiDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApiDestination] -> ShowS
$cshowList :: [UpdateApiDestination] -> ShowS
show :: UpdateApiDestination -> String
$cshow :: UpdateApiDestination -> String
showsPrec :: Int -> UpdateApiDestination -> ShowS
$cshowsPrec :: Int -> UpdateApiDestination -> ShowS
Prelude.Show, forall x. Rep UpdateApiDestination x -> UpdateApiDestination
forall x. UpdateApiDestination -> Rep UpdateApiDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateApiDestination x -> UpdateApiDestination
$cfrom :: forall x. UpdateApiDestination -> Rep UpdateApiDestination x
Prelude.Generic)

-- |
-- Create a value of 'UpdateApiDestination' 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:
--
-- 'connectionArn', 'updateApiDestination_connectionArn' - The ARN of the connection to use for the API destination.
--
-- 'description', 'updateApiDestination_description' - The name of the API destination to update.
--
-- 'httpMethod', 'updateApiDestination_httpMethod' - The method to use for the API destination.
--
-- 'invocationEndpoint', 'updateApiDestination_invocationEndpoint' - The URL to the endpoint to use for the API destination.
--
-- 'invocationRateLimitPerSecond', 'updateApiDestination_invocationRateLimitPerSecond' - The maximum number of invocations per second to send to the API
-- destination.
--
-- 'name', 'updateApiDestination_name' - The name of the API destination to update.
newUpdateApiDestination ::
  -- | 'name'
  Prelude.Text ->
  UpdateApiDestination
newUpdateApiDestination :: Text -> UpdateApiDestination
newUpdateApiDestination Text
pName_ =
  UpdateApiDestination'
    { $sel:connectionArn:UpdateApiDestination' :: Maybe Text
connectionArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateApiDestination' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:httpMethod:UpdateApiDestination' :: Maybe ApiDestinationHttpMethod
httpMethod = forall a. Maybe a
Prelude.Nothing,
      $sel:invocationEndpoint:UpdateApiDestination' :: Maybe Text
invocationEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:invocationRateLimitPerSecond:UpdateApiDestination' :: Maybe Natural
invocationRateLimitPerSecond = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateApiDestination' :: Text
name = Text
pName_
    }

-- | The ARN of the connection to use for the API destination.
updateApiDestination_connectionArn :: Lens.Lens' UpdateApiDestination (Prelude.Maybe Prelude.Text)
updateApiDestination_connectionArn :: Lens' UpdateApiDestination (Maybe Text)
updateApiDestination_connectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestination' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: UpdateApiDestination
s@UpdateApiDestination' {} Maybe Text
a -> UpdateApiDestination
s {$sel:connectionArn:UpdateApiDestination' :: Maybe Text
connectionArn = Maybe Text
a} :: UpdateApiDestination)

-- | The name of the API destination to update.
updateApiDestination_description :: Lens.Lens' UpdateApiDestination (Prelude.Maybe Prelude.Text)
updateApiDestination_description :: Lens' UpdateApiDestination (Maybe Text)
updateApiDestination_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestination' {Maybe Text
description :: Maybe Text
$sel:description:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateApiDestination
s@UpdateApiDestination' {} Maybe Text
a -> UpdateApiDestination
s {$sel:description:UpdateApiDestination' :: Maybe Text
description = Maybe Text
a} :: UpdateApiDestination)

-- | The method to use for the API destination.
updateApiDestination_httpMethod :: Lens.Lens' UpdateApiDestination (Prelude.Maybe ApiDestinationHttpMethod)
updateApiDestination_httpMethod :: Lens' UpdateApiDestination (Maybe ApiDestinationHttpMethod)
updateApiDestination_httpMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestination' {Maybe ApiDestinationHttpMethod
httpMethod :: Maybe ApiDestinationHttpMethod
$sel:httpMethod:UpdateApiDestination' :: UpdateApiDestination -> Maybe ApiDestinationHttpMethod
httpMethod} -> Maybe ApiDestinationHttpMethod
httpMethod) (\s :: UpdateApiDestination
s@UpdateApiDestination' {} Maybe ApiDestinationHttpMethod
a -> UpdateApiDestination
s {$sel:httpMethod:UpdateApiDestination' :: Maybe ApiDestinationHttpMethod
httpMethod = Maybe ApiDestinationHttpMethod
a} :: UpdateApiDestination)

-- | The URL to the endpoint to use for the API destination.
updateApiDestination_invocationEndpoint :: Lens.Lens' UpdateApiDestination (Prelude.Maybe Prelude.Text)
updateApiDestination_invocationEndpoint :: Lens' UpdateApiDestination (Maybe Text)
updateApiDestination_invocationEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestination' {Maybe Text
invocationEndpoint :: Maybe Text
$sel:invocationEndpoint:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
invocationEndpoint} -> Maybe Text
invocationEndpoint) (\s :: UpdateApiDestination
s@UpdateApiDestination' {} Maybe Text
a -> UpdateApiDestination
s {$sel:invocationEndpoint:UpdateApiDestination' :: Maybe Text
invocationEndpoint = Maybe Text
a} :: UpdateApiDestination)

-- | The maximum number of invocations per second to send to the API
-- destination.
updateApiDestination_invocationRateLimitPerSecond :: Lens.Lens' UpdateApiDestination (Prelude.Maybe Prelude.Natural)
updateApiDestination_invocationRateLimitPerSecond :: Lens' UpdateApiDestination (Maybe Natural)
updateApiDestination_invocationRateLimitPerSecond = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestination' {Maybe Natural
invocationRateLimitPerSecond :: Maybe Natural
$sel:invocationRateLimitPerSecond:UpdateApiDestination' :: UpdateApiDestination -> Maybe Natural
invocationRateLimitPerSecond} -> Maybe Natural
invocationRateLimitPerSecond) (\s :: UpdateApiDestination
s@UpdateApiDestination' {} Maybe Natural
a -> UpdateApiDestination
s {$sel:invocationRateLimitPerSecond:UpdateApiDestination' :: Maybe Natural
invocationRateLimitPerSecond = Maybe Natural
a} :: UpdateApiDestination)

-- | The name of the API destination to update.
updateApiDestination_name :: Lens.Lens' UpdateApiDestination Prelude.Text
updateApiDestination_name :: Lens' UpdateApiDestination Text
updateApiDestination_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestination' {Text
name :: Text
$sel:name:UpdateApiDestination' :: UpdateApiDestination -> Text
name} -> Text
name) (\s :: UpdateApiDestination
s@UpdateApiDestination' {} Text
a -> UpdateApiDestination
s {$sel:name:UpdateApiDestination' :: Text
name = Text
a} :: UpdateApiDestination)

instance Core.AWSRequest UpdateApiDestination where
  type
    AWSResponse UpdateApiDestination =
      UpdateApiDestinationResponse
  request :: (Service -> Service)
-> UpdateApiDestination -> Request UpdateApiDestination
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateApiDestination
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateApiDestination)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe ApiDestinationState
-> Maybe POSIX
-> Maybe POSIX
-> Int
-> UpdateApiDestinationResponse
UpdateApiDestinationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ApiDestinationArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ApiDestinationState")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModifiedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateApiDestination where
  hashWithSalt :: Int -> UpdateApiDestination -> Int
hashWithSalt Int
_salt UpdateApiDestination' {Maybe Natural
Maybe Text
Maybe ApiDestinationHttpMethod
Text
name :: Text
invocationRateLimitPerSecond :: Maybe Natural
invocationEndpoint :: Maybe Text
httpMethod :: Maybe ApiDestinationHttpMethod
description :: Maybe Text
connectionArn :: Maybe Text
$sel:name:UpdateApiDestination' :: UpdateApiDestination -> Text
$sel:invocationRateLimitPerSecond:UpdateApiDestination' :: UpdateApiDestination -> Maybe Natural
$sel:invocationEndpoint:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:httpMethod:UpdateApiDestination' :: UpdateApiDestination -> Maybe ApiDestinationHttpMethod
$sel:description:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:connectionArn:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApiDestinationHttpMethod
httpMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
invocationEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
invocationRateLimitPerSecond
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData UpdateApiDestination where
  rnf :: UpdateApiDestination -> ()
rnf UpdateApiDestination' {Maybe Natural
Maybe Text
Maybe ApiDestinationHttpMethod
Text
name :: Text
invocationRateLimitPerSecond :: Maybe Natural
invocationEndpoint :: Maybe Text
httpMethod :: Maybe ApiDestinationHttpMethod
description :: Maybe Text
connectionArn :: Maybe Text
$sel:name:UpdateApiDestination' :: UpdateApiDestination -> Text
$sel:invocationRateLimitPerSecond:UpdateApiDestination' :: UpdateApiDestination -> Maybe Natural
$sel:invocationEndpoint:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:httpMethod:UpdateApiDestination' :: UpdateApiDestination -> Maybe ApiDestinationHttpMethod
$sel:description:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:connectionArn:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApiDestinationHttpMethod
httpMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
invocationEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
invocationRateLimitPerSecond
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders UpdateApiDestination where
  toHeaders :: UpdateApiDestination -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSEvents.UpdateApiDestination" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateApiDestination where
  toJSON :: UpdateApiDestination -> Value
toJSON UpdateApiDestination' {Maybe Natural
Maybe Text
Maybe ApiDestinationHttpMethod
Text
name :: Text
invocationRateLimitPerSecond :: Maybe Natural
invocationEndpoint :: Maybe Text
httpMethod :: Maybe ApiDestinationHttpMethod
description :: Maybe Text
connectionArn :: Maybe Text
$sel:name:UpdateApiDestination' :: UpdateApiDestination -> Text
$sel:invocationRateLimitPerSecond:UpdateApiDestination' :: UpdateApiDestination -> Maybe Natural
$sel:invocationEndpoint:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:httpMethod:UpdateApiDestination' :: UpdateApiDestination -> Maybe ApiDestinationHttpMethod
$sel:description:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:connectionArn:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ConnectionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
connectionArn,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"HttpMethod" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ApiDestinationHttpMethod
httpMethod,
            (Key
"InvocationEndpoint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
invocationEndpoint,
            (Key
"InvocationRateLimitPerSecond" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
invocationRateLimitPerSecond,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateApiDestinationResponse' 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:
--
-- 'apiDestinationArn', 'updateApiDestinationResponse_apiDestinationArn' - The ARN of the API destination that was updated.
--
-- 'apiDestinationState', 'updateApiDestinationResponse_apiDestinationState' - The state of the API destination that was updated.
--
-- 'creationTime', 'updateApiDestinationResponse_creationTime' - A time stamp for the time that the API destination was created.
--
-- 'lastModifiedTime', 'updateApiDestinationResponse_lastModifiedTime' - A time stamp for the time that the API destination was last modified.
--
-- 'httpStatus', 'updateApiDestinationResponse_httpStatus' - The response's http status code.
newUpdateApiDestinationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateApiDestinationResponse
newUpdateApiDestinationResponse :: Int -> UpdateApiDestinationResponse
newUpdateApiDestinationResponse Int
pHttpStatus_ =
  UpdateApiDestinationResponse'
    { $sel:apiDestinationArn:UpdateApiDestinationResponse' :: Maybe Text
apiDestinationArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:apiDestinationState:UpdateApiDestinationResponse' :: Maybe ApiDestinationState
apiDestinationState = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:UpdateApiDestinationResponse' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:UpdateApiDestinationResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateApiDestinationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the API destination that was updated.
updateApiDestinationResponse_apiDestinationArn :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe Prelude.Text)
updateApiDestinationResponse_apiDestinationArn :: Lens' UpdateApiDestinationResponse (Maybe Text)
updateApiDestinationResponse_apiDestinationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestinationResponse' {Maybe Text
apiDestinationArn :: Maybe Text
$sel:apiDestinationArn:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe Text
apiDestinationArn} -> Maybe Text
apiDestinationArn) (\s :: UpdateApiDestinationResponse
s@UpdateApiDestinationResponse' {} Maybe Text
a -> UpdateApiDestinationResponse
s {$sel:apiDestinationArn:UpdateApiDestinationResponse' :: Maybe Text
apiDestinationArn = Maybe Text
a} :: UpdateApiDestinationResponse)

-- | The state of the API destination that was updated.
updateApiDestinationResponse_apiDestinationState :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe ApiDestinationState)
updateApiDestinationResponse_apiDestinationState :: Lens' UpdateApiDestinationResponse (Maybe ApiDestinationState)
updateApiDestinationResponse_apiDestinationState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestinationResponse' {Maybe ApiDestinationState
apiDestinationState :: Maybe ApiDestinationState
$sel:apiDestinationState:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe ApiDestinationState
apiDestinationState} -> Maybe ApiDestinationState
apiDestinationState) (\s :: UpdateApiDestinationResponse
s@UpdateApiDestinationResponse' {} Maybe ApiDestinationState
a -> UpdateApiDestinationResponse
s {$sel:apiDestinationState:UpdateApiDestinationResponse' :: Maybe ApiDestinationState
apiDestinationState = Maybe ApiDestinationState
a} :: UpdateApiDestinationResponse)

-- | A time stamp for the time that the API destination was created.
updateApiDestinationResponse_creationTime :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe Prelude.UTCTime)
updateApiDestinationResponse_creationTime :: Lens' UpdateApiDestinationResponse (Maybe UTCTime)
updateApiDestinationResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestinationResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: UpdateApiDestinationResponse
s@UpdateApiDestinationResponse' {} Maybe POSIX
a -> UpdateApiDestinationResponse
s {$sel:creationTime:UpdateApiDestinationResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: UpdateApiDestinationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A time stamp for the time that the API destination was last modified.
updateApiDestinationResponse_lastModifiedTime :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe Prelude.UTCTime)
updateApiDestinationResponse_lastModifiedTime :: Lens' UpdateApiDestinationResponse (Maybe UTCTime)
updateApiDestinationResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApiDestinationResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: UpdateApiDestinationResponse
s@UpdateApiDestinationResponse' {} Maybe POSIX
a -> UpdateApiDestinationResponse
s {$sel:lastModifiedTime:UpdateApiDestinationResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: UpdateApiDestinationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance Prelude.NFData UpdateApiDestinationResponse where
  rnf :: UpdateApiDestinationResponse -> ()
rnf UpdateApiDestinationResponse' {Int
Maybe Text
Maybe POSIX
Maybe ApiDestinationState
httpStatus :: Int
lastModifiedTime :: Maybe POSIX
creationTime :: Maybe POSIX
apiDestinationState :: Maybe ApiDestinationState
apiDestinationArn :: Maybe Text
$sel:httpStatus:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Int
$sel:lastModifiedTime:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe POSIX
$sel:creationTime:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe POSIX
$sel:apiDestinationState:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe ApiDestinationState
$sel:apiDestinationArn:UpdateApiDestinationResponse' :: UpdateApiDestinationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
apiDestinationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApiDestinationState
apiDestinationState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus