{-# 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.Connect.DisassociateLambdaFunction
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Remove the Lambda function from the dropdown options available in the
-- relevant flow blocks.
module Amazonka.Connect.DisassociateLambdaFunction
  ( -- * Creating a Request
    DisassociateLambdaFunction (..),
    newDisassociateLambdaFunction,

    -- * Request Lenses
    disassociateLambdaFunction_instanceId,
    disassociateLambdaFunction_functionArn,

    -- * Destructuring the Response
    DisassociateLambdaFunctionResponse (..),
    newDisassociateLambdaFunctionResponse,
  )
where

import Amazonka.Connect.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:/ 'newDisassociateLambdaFunction' smart constructor.
data DisassociateLambdaFunction = DisassociateLambdaFunction'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance..
    DisassociateLambdaFunction -> Text
instanceId :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Lambda function being
    -- disassociated.
    DisassociateLambdaFunction -> Text
functionArn :: Prelude.Text
  }
  deriving (DisassociateLambdaFunction -> DisassociateLambdaFunction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateLambdaFunction -> DisassociateLambdaFunction -> Bool
$c/= :: DisassociateLambdaFunction -> DisassociateLambdaFunction -> Bool
== :: DisassociateLambdaFunction -> DisassociateLambdaFunction -> Bool
$c== :: DisassociateLambdaFunction -> DisassociateLambdaFunction -> Bool
Prelude.Eq, ReadPrec [DisassociateLambdaFunction]
ReadPrec DisassociateLambdaFunction
Int -> ReadS DisassociateLambdaFunction
ReadS [DisassociateLambdaFunction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateLambdaFunction]
$creadListPrec :: ReadPrec [DisassociateLambdaFunction]
readPrec :: ReadPrec DisassociateLambdaFunction
$creadPrec :: ReadPrec DisassociateLambdaFunction
readList :: ReadS [DisassociateLambdaFunction]
$creadList :: ReadS [DisassociateLambdaFunction]
readsPrec :: Int -> ReadS DisassociateLambdaFunction
$creadsPrec :: Int -> ReadS DisassociateLambdaFunction
Prelude.Read, Int -> DisassociateLambdaFunction -> ShowS
[DisassociateLambdaFunction] -> ShowS
DisassociateLambdaFunction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateLambdaFunction] -> ShowS
$cshowList :: [DisassociateLambdaFunction] -> ShowS
show :: DisassociateLambdaFunction -> String
$cshow :: DisassociateLambdaFunction -> String
showsPrec :: Int -> DisassociateLambdaFunction -> ShowS
$cshowsPrec :: Int -> DisassociateLambdaFunction -> ShowS
Prelude.Show, forall x.
Rep DisassociateLambdaFunction x -> DisassociateLambdaFunction
forall x.
DisassociateLambdaFunction -> Rep DisassociateLambdaFunction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateLambdaFunction x -> DisassociateLambdaFunction
$cfrom :: forall x.
DisassociateLambdaFunction -> Rep DisassociateLambdaFunction x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateLambdaFunction' 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:
--
-- 'instanceId', 'disassociateLambdaFunction_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance..
--
-- 'functionArn', 'disassociateLambdaFunction_functionArn' - The Amazon Resource Name (ARN) of the Lambda function being
-- disassociated.
newDisassociateLambdaFunction ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'functionArn'
  Prelude.Text ->
  DisassociateLambdaFunction
newDisassociateLambdaFunction :: Text -> Text -> DisassociateLambdaFunction
newDisassociateLambdaFunction
  Text
pInstanceId_
  Text
pFunctionArn_ =
    DisassociateLambdaFunction'
      { $sel:instanceId:DisassociateLambdaFunction' :: Text
instanceId =
          Text
pInstanceId_,
        $sel:functionArn:DisassociateLambdaFunction' :: Text
functionArn = Text
pFunctionArn_
      }

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance..
disassociateLambdaFunction_instanceId :: Lens.Lens' DisassociateLambdaFunction Prelude.Text
disassociateLambdaFunction_instanceId :: Lens' DisassociateLambdaFunction Text
disassociateLambdaFunction_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLambdaFunction' {Text
instanceId :: Text
$sel:instanceId:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
instanceId} -> Text
instanceId) (\s :: DisassociateLambdaFunction
s@DisassociateLambdaFunction' {} Text
a -> DisassociateLambdaFunction
s {$sel:instanceId:DisassociateLambdaFunction' :: Text
instanceId = Text
a} :: DisassociateLambdaFunction)

-- | The Amazon Resource Name (ARN) of the Lambda function being
-- disassociated.
disassociateLambdaFunction_functionArn :: Lens.Lens' DisassociateLambdaFunction Prelude.Text
disassociateLambdaFunction_functionArn :: Lens' DisassociateLambdaFunction Text
disassociateLambdaFunction_functionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLambdaFunction' {Text
functionArn :: Text
$sel:functionArn:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
functionArn} -> Text
functionArn) (\s :: DisassociateLambdaFunction
s@DisassociateLambdaFunction' {} Text
a -> DisassociateLambdaFunction
s {$sel:functionArn:DisassociateLambdaFunction' :: Text
functionArn = Text
a} :: DisassociateLambdaFunction)

instance Core.AWSRequest DisassociateLambdaFunction where
  type
    AWSResponse DisassociateLambdaFunction =
      DisassociateLambdaFunctionResponse
  request :: (Service -> Service)
-> DisassociateLambdaFunction -> Request DisassociateLambdaFunction
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateLambdaFunction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateLambdaFunction)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DisassociateLambdaFunctionResponse
DisassociateLambdaFunctionResponse'

instance Prelude.Hashable DisassociateLambdaFunction where
  hashWithSalt :: Int -> DisassociateLambdaFunction -> Int
hashWithSalt Int
_salt DisassociateLambdaFunction' {Text
functionArn :: Text
instanceId :: Text
$sel:functionArn:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
$sel:instanceId:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionArn

instance Prelude.NFData DisassociateLambdaFunction where
  rnf :: DisassociateLambdaFunction -> ()
rnf DisassociateLambdaFunction' {Text
functionArn :: Text
instanceId :: Text
$sel:functionArn:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
$sel:instanceId:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionArn

instance Data.ToHeaders DisassociateLambdaFunction where
  toHeaders :: DisassociateLambdaFunction -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DisassociateLambdaFunction where
  toPath :: DisassociateLambdaFunction -> ByteString
toPath DisassociateLambdaFunction' {Text
functionArn :: Text
instanceId :: Text
$sel:functionArn:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
$sel:instanceId:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/instance/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId,
        ByteString
"/lambda-function"
      ]

instance Data.ToQuery DisassociateLambdaFunction where
  toQuery :: DisassociateLambdaFunction -> QueryString
toQuery DisassociateLambdaFunction' {Text
functionArn :: Text
instanceId :: Text
$sel:functionArn:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
$sel:instanceId:DisassociateLambdaFunction' :: DisassociateLambdaFunction -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"functionArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
functionArn]

-- | /See:/ 'newDisassociateLambdaFunctionResponse' smart constructor.
data DisassociateLambdaFunctionResponse = DisassociateLambdaFunctionResponse'
  {
  }
  deriving (DisassociateLambdaFunctionResponse
-> DisassociateLambdaFunctionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateLambdaFunctionResponse
-> DisassociateLambdaFunctionResponse -> Bool
$c/= :: DisassociateLambdaFunctionResponse
-> DisassociateLambdaFunctionResponse -> Bool
== :: DisassociateLambdaFunctionResponse
-> DisassociateLambdaFunctionResponse -> Bool
$c== :: DisassociateLambdaFunctionResponse
-> DisassociateLambdaFunctionResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateLambdaFunctionResponse]
ReadPrec DisassociateLambdaFunctionResponse
Int -> ReadS DisassociateLambdaFunctionResponse
ReadS [DisassociateLambdaFunctionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateLambdaFunctionResponse]
$creadListPrec :: ReadPrec [DisassociateLambdaFunctionResponse]
readPrec :: ReadPrec DisassociateLambdaFunctionResponse
$creadPrec :: ReadPrec DisassociateLambdaFunctionResponse
readList :: ReadS [DisassociateLambdaFunctionResponse]
$creadList :: ReadS [DisassociateLambdaFunctionResponse]
readsPrec :: Int -> ReadS DisassociateLambdaFunctionResponse
$creadsPrec :: Int -> ReadS DisassociateLambdaFunctionResponse
Prelude.Read, Int -> DisassociateLambdaFunctionResponse -> ShowS
[DisassociateLambdaFunctionResponse] -> ShowS
DisassociateLambdaFunctionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateLambdaFunctionResponse] -> ShowS
$cshowList :: [DisassociateLambdaFunctionResponse] -> ShowS
show :: DisassociateLambdaFunctionResponse -> String
$cshow :: DisassociateLambdaFunctionResponse -> String
showsPrec :: Int -> DisassociateLambdaFunctionResponse -> ShowS
$cshowsPrec :: Int -> DisassociateLambdaFunctionResponse -> ShowS
Prelude.Show, forall x.
Rep DisassociateLambdaFunctionResponse x
-> DisassociateLambdaFunctionResponse
forall x.
DisassociateLambdaFunctionResponse
-> Rep DisassociateLambdaFunctionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateLambdaFunctionResponse x
-> DisassociateLambdaFunctionResponse
$cfrom :: forall x.
DisassociateLambdaFunctionResponse
-> Rep DisassociateLambdaFunctionResponse x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateLambdaFunctionResponse' 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.
newDisassociateLambdaFunctionResponse ::
  DisassociateLambdaFunctionResponse
newDisassociateLambdaFunctionResponse :: DisassociateLambdaFunctionResponse
newDisassociateLambdaFunctionResponse =
  DisassociateLambdaFunctionResponse
DisassociateLambdaFunctionResponse'

instance
  Prelude.NFData
    DisassociateLambdaFunctionResponse
  where
  rnf :: DisassociateLambdaFunctionResponse -> ()
rnf DisassociateLambdaFunctionResponse
_ = ()