{-# 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-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 an API destination.
module Amazonka.CloudWatchEvents.UpdateApiDestination
  ( -- * Creating a Request
    UpdateApiDestination (..),
    newUpdateApiDestination,

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

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

    -- * Response Lenses
    updateApiDestinationResponse_creationTime,
    updateApiDestinationResponse_lastModifiedTime,
    updateApiDestinationResponse_apiDestinationState,
    updateApiDestinationResponse_apiDestinationArn,
    updateApiDestinationResponse_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:/ 'newUpdateApiDestination' smart constructor.
data UpdateApiDestination = UpdateApiDestination'
  { -- | 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 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 name of the API destination to update.
    UpdateApiDestination -> Text
name :: Prelude.Text
  }
  deriving (UpdateApiDestination -> UpdateApiDestination -> Bool
(UpdateApiDestination -> UpdateApiDestination -> Bool)
-> (UpdateApiDestination -> UpdateApiDestination -> Bool)
-> Eq UpdateApiDestination
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]
(Int -> ReadS UpdateApiDestination)
-> ReadS [UpdateApiDestination]
-> ReadPrec UpdateApiDestination
-> ReadPrec [UpdateApiDestination]
-> Read 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
(Int -> UpdateApiDestination -> ShowS)
-> (UpdateApiDestination -> String)
-> ([UpdateApiDestination] -> ShowS)
-> Show UpdateApiDestination
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. UpdateApiDestination -> Rep UpdateApiDestination x)
-> (forall x. Rep UpdateApiDestination x -> UpdateApiDestination)
-> Generic UpdateApiDestination
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:
--
-- '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.
--
-- '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.
--
-- 'name', 'updateApiDestination_name' - The name of the API destination to update.
newUpdateApiDestination ::
  -- | 'name'
  Prelude.Text ->
  UpdateApiDestination
newUpdateApiDestination :: Text -> UpdateApiDestination
newUpdateApiDestination Text
pName_ =
  UpdateApiDestination' :: Maybe ApiDestinationHttpMethod
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Text
-> UpdateApiDestination
UpdateApiDestination'
    { $sel:httpMethod:UpdateApiDestination' :: Maybe ApiDestinationHttpMethod
httpMethod = Maybe ApiDestinationHttpMethod
forall a. Maybe a
Prelude.Nothing,
      $sel:invocationEndpoint:UpdateApiDestination' :: Maybe Text
invocationEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:invocationRateLimitPerSecond:UpdateApiDestination' :: Maybe Natural
invocationRateLimitPerSecond = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionArn:UpdateApiDestination' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateApiDestination' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateApiDestination' :: Text
name = Text
pName_
    }

-- | The method to use for the API destination.
updateApiDestination_httpMethod :: Lens.Lens' UpdateApiDestination (Prelude.Maybe ApiDestinationHttpMethod)
updateApiDestination_httpMethod :: (Maybe ApiDestinationHttpMethod
 -> f (Maybe ApiDestinationHttpMethod))
-> UpdateApiDestination -> f UpdateApiDestination
updateApiDestination_httpMethod = (UpdateApiDestination -> Maybe ApiDestinationHttpMethod)
-> (UpdateApiDestination
    -> Maybe ApiDestinationHttpMethod -> UpdateApiDestination)
-> Lens
     UpdateApiDestination
     UpdateApiDestination
     (Maybe ApiDestinationHttpMethod)
     (Maybe ApiDestinationHttpMethod)
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 :: (Maybe Text -> f (Maybe Text))
-> UpdateApiDestination -> f UpdateApiDestination
updateApiDestination_invocationEndpoint = (UpdateApiDestination -> Maybe Text)
-> (UpdateApiDestination -> Maybe Text -> UpdateApiDestination)
-> Lens
     UpdateApiDestination UpdateApiDestination (Maybe Text) (Maybe Text)
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 :: (Maybe Natural -> f (Maybe Natural))
-> UpdateApiDestination -> f UpdateApiDestination
updateApiDestination_invocationRateLimitPerSecond = (UpdateApiDestination -> Maybe Natural)
-> (UpdateApiDestination -> Maybe Natural -> UpdateApiDestination)
-> Lens
     UpdateApiDestination
     UpdateApiDestination
     (Maybe Natural)
     (Maybe Natural)
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 ARN of the connection to use for the API destination.
updateApiDestination_connectionArn :: Lens.Lens' UpdateApiDestination (Prelude.Maybe Prelude.Text)
updateApiDestination_connectionArn :: (Maybe Text -> f (Maybe Text))
-> UpdateApiDestination -> f UpdateApiDestination
updateApiDestination_connectionArn = (UpdateApiDestination -> Maybe Text)
-> (UpdateApiDestination -> Maybe Text -> UpdateApiDestination)
-> Lens
     UpdateApiDestination UpdateApiDestination (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> UpdateApiDestination -> f UpdateApiDestination
updateApiDestination_description = (UpdateApiDestination -> Maybe Text)
-> (UpdateApiDestination -> Maybe Text -> UpdateApiDestination)
-> Lens
     UpdateApiDestination UpdateApiDestination (Maybe Text) (Maybe Text)
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 name of the API destination to update.
updateApiDestination_name :: Lens.Lens' UpdateApiDestination Prelude.Text
updateApiDestination_name :: (Text -> f Text) -> UpdateApiDestination -> f UpdateApiDestination
updateApiDestination_name = (UpdateApiDestination -> Text)
-> (UpdateApiDestination -> Text -> UpdateApiDestination)
-> Lens UpdateApiDestination UpdateApiDestination Text Text
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 :: UpdateApiDestination -> Request UpdateApiDestination
request = Service -> UpdateApiDestination -> Request UpdateApiDestination
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateApiDestination
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateApiDestination)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateApiDestination))
-> Logger
-> Service
-> Proxy UpdateApiDestination
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateApiDestination)))
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 ApiDestinationState
-> Maybe Text
-> Int
-> UpdateApiDestinationResponse
UpdateApiDestinationResponse'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe ApiDestinationState
 -> Maybe Text
 -> Int
 -> UpdateApiDestinationResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe ApiDestinationState
      -> Maybe Text
      -> Int
      -> UpdateApiDestinationResponse)
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 ApiDestinationState
   -> Maybe Text
   -> Int
   -> UpdateApiDestinationResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe ApiDestinationState
      -> Maybe Text -> Int -> UpdateApiDestinationResponse)
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 ApiDestinationState
   -> Maybe Text -> Int -> UpdateApiDestinationResponse)
-> Either String (Maybe ApiDestinationState)
-> Either
     String (Maybe Text -> Int -> UpdateApiDestinationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ApiDestinationState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApiDestinationState")
            Either String (Maybe Text -> Int -> UpdateApiDestinationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateApiDestinationResponse)
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
"ApiDestinationArn")
            Either String (Int -> UpdateApiDestinationResponse)
-> Either String Int -> Either String UpdateApiDestinationResponse
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 UpdateApiDestination

instance Prelude.NFData UpdateApiDestination

instance Core.ToHeaders UpdateApiDestination where
  toHeaders :: UpdateApiDestination -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateApiDestination -> 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.UpdateApiDestination" ::
                          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 UpdateApiDestination where
  toJSON :: UpdateApiDestination -> Value
toJSON UpdateApiDestination' {Maybe Natural
Maybe Text
Maybe ApiDestinationHttpMethod
Text
name :: Text
description :: Maybe Text
connectionArn :: Maybe Text
invocationRateLimitPerSecond :: Maybe Natural
invocationEndpoint :: Maybe Text
httpMethod :: Maybe ApiDestinationHttpMethod
$sel:name:UpdateApiDestination' :: UpdateApiDestination -> Text
$sel:description:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:connectionArn:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:invocationRateLimitPerSecond:UpdateApiDestination' :: UpdateApiDestination -> Maybe Natural
$sel:invocationEndpoint:UpdateApiDestination' :: UpdateApiDestination -> Maybe Text
$sel:httpMethod:UpdateApiDestination' :: UpdateApiDestination -> Maybe ApiDestinationHttpMethod
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"HttpMethod" Text -> ApiDestinationHttpMethod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ApiDestinationHttpMethod -> Pair)
-> Maybe ApiDestinationHttpMethod -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ApiDestinationHttpMethod
httpMethod,
            (Text
"InvocationEndpoint" 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
invocationEndpoint,
            (Text
"InvocationRateLimitPerSecond" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
invocationRateLimitPerSecond,
            (Text
"ConnectionArn" 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
connectionArn,
            (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 UpdateApiDestination where
  toPath :: UpdateApiDestination -> ByteString
toPath = ByteString -> UpdateApiDestination -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateApiDestinationResponse' smart constructor.
data UpdateApiDestinationResponse = UpdateApiDestinationResponse'
  { -- | A time stamp for the time that the API destination was created.
    UpdateApiDestinationResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | A time stamp for the time that the API destination was last modified.
    UpdateApiDestinationResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The state of the API destination that was updated.
    UpdateApiDestinationResponse -> Maybe ApiDestinationState
apiDestinationState :: Prelude.Maybe ApiDestinationState,
    -- | The ARN of the API destination that was updated.
    UpdateApiDestinationResponse -> Maybe Text
apiDestinationArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateApiDestinationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateApiDestinationResponse
-> UpdateApiDestinationResponse -> Bool
(UpdateApiDestinationResponse
 -> UpdateApiDestinationResponse -> Bool)
-> (UpdateApiDestinationResponse
    -> UpdateApiDestinationResponse -> Bool)
-> Eq UpdateApiDestinationResponse
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]
(Int -> ReadS UpdateApiDestinationResponse)
-> ReadS [UpdateApiDestinationResponse]
-> ReadPrec UpdateApiDestinationResponse
-> ReadPrec [UpdateApiDestinationResponse]
-> Read 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
(Int -> UpdateApiDestinationResponse -> ShowS)
-> (UpdateApiDestinationResponse -> String)
-> ([UpdateApiDestinationResponse] -> ShowS)
-> Show UpdateApiDestinationResponse
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.
 UpdateApiDestinationResponse -> Rep UpdateApiDestinationResponse x)
-> (forall x.
    Rep UpdateApiDestinationResponse x -> UpdateApiDestinationResponse)
-> Generic UpdateApiDestinationResponse
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:
--
-- '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.
--
-- 'apiDestinationState', 'updateApiDestinationResponse_apiDestinationState' - The state of the API destination that was updated.
--
-- 'apiDestinationArn', 'updateApiDestinationResponse_apiDestinationArn' - The ARN of the API destination that was updated.
--
-- 'httpStatus', 'updateApiDestinationResponse_httpStatus' - The response's http status code.
newUpdateApiDestinationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateApiDestinationResponse
newUpdateApiDestinationResponse :: Int -> UpdateApiDestinationResponse
newUpdateApiDestinationResponse Int
pHttpStatus_ =
  UpdateApiDestinationResponse' :: Maybe POSIX
-> Maybe POSIX
-> Maybe ApiDestinationState
-> Maybe Text
-> Int
-> UpdateApiDestinationResponse
UpdateApiDestinationResponse'
    { $sel:creationTime:UpdateApiDestinationResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:UpdateApiDestinationResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:apiDestinationState:UpdateApiDestinationResponse' :: Maybe ApiDestinationState
apiDestinationState = Maybe ApiDestinationState
forall a. Maybe a
Prelude.Nothing,
      $sel:apiDestinationArn:UpdateApiDestinationResponse' :: Maybe Text
apiDestinationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateApiDestinationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A time stamp for the time that the API destination was created.
updateApiDestinationResponse_creationTime :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe Prelude.UTCTime)
updateApiDestinationResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateApiDestinationResponse -> f UpdateApiDestinationResponse
updateApiDestinationResponse_creationTime = (UpdateApiDestinationResponse -> Maybe POSIX)
-> (UpdateApiDestinationResponse
    -> Maybe POSIX -> UpdateApiDestinationResponse)
-> Lens
     UpdateApiDestinationResponse
     UpdateApiDestinationResponse
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateApiDestinationResponse -> f UpdateApiDestinationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateApiDestinationResponse
-> f UpdateApiDestinationResponse
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 API destination was last modified.
updateApiDestinationResponse_lastModifiedTime :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe Prelude.UTCTime)
updateApiDestinationResponse_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateApiDestinationResponse -> f UpdateApiDestinationResponse
updateApiDestinationResponse_lastModifiedTime = (UpdateApiDestinationResponse -> Maybe POSIX)
-> (UpdateApiDestinationResponse
    -> Maybe POSIX -> UpdateApiDestinationResponse)
-> Lens
     UpdateApiDestinationResponse
     UpdateApiDestinationResponse
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateApiDestinationResponse -> f UpdateApiDestinationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateApiDestinationResponse
-> f UpdateApiDestinationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The state of the API destination that was updated.
updateApiDestinationResponse_apiDestinationState :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe ApiDestinationState)
updateApiDestinationResponse_apiDestinationState :: (Maybe ApiDestinationState -> f (Maybe ApiDestinationState))
-> UpdateApiDestinationResponse -> f UpdateApiDestinationResponse
updateApiDestinationResponse_apiDestinationState = (UpdateApiDestinationResponse -> Maybe ApiDestinationState)
-> (UpdateApiDestinationResponse
    -> Maybe ApiDestinationState -> UpdateApiDestinationResponse)
-> Lens
     UpdateApiDestinationResponse
     UpdateApiDestinationResponse
     (Maybe ApiDestinationState)
     (Maybe 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)

-- | The ARN of the API destination that was updated.
updateApiDestinationResponse_apiDestinationArn :: Lens.Lens' UpdateApiDestinationResponse (Prelude.Maybe Prelude.Text)
updateApiDestinationResponse_apiDestinationArn :: (Maybe Text -> f (Maybe Text))
-> UpdateApiDestinationResponse -> f UpdateApiDestinationResponse
updateApiDestinationResponse_apiDestinationArn = (UpdateApiDestinationResponse -> Maybe Text)
-> (UpdateApiDestinationResponse
    -> Maybe Text -> UpdateApiDestinationResponse)
-> Lens
     UpdateApiDestinationResponse
     UpdateApiDestinationResponse
     (Maybe Text)
     (Maybe Text)
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 response's http status code.
updateApiDestinationResponse_httpStatus :: Lens.Lens' UpdateApiDestinationResponse Prelude.Int
updateApiDestinationResponse_httpStatus :: (Int -> f Int)
-> UpdateApiDestinationResponse -> f UpdateApiDestinationResponse
updateApiDestinationResponse_httpStatus = (UpdateApiDestinationResponse -> Int)
-> (UpdateApiDestinationResponse
    -> Int -> UpdateApiDestinationResponse)
-> Lens
     UpdateApiDestinationResponse UpdateApiDestinationResponse Int Int
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