{-# 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.DeleteUseCase
-- 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)
--
-- Deletes a use case from an integration association.
module Amazonka.Connect.DeleteUseCase
  ( -- * Creating a Request
    DeleteUseCase (..),
    newDeleteUseCase,

    -- * Request Lenses
    deleteUseCase_instanceId,
    deleteUseCase_integrationAssociationId,
    deleteUseCase_useCaseId,

    -- * Destructuring the Response
    DeleteUseCaseResponse (..),
    newDeleteUseCaseResponse,
  )
where

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

-- |
-- Create a value of 'DeleteUseCase' 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', 'deleteUseCase_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'integrationAssociationId', 'deleteUseCase_integrationAssociationId' - The identifier for the integration association.
--
-- 'useCaseId', 'deleteUseCase_useCaseId' - The identifier for the use case.
newDeleteUseCase ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'integrationAssociationId'
  Prelude.Text ->
  -- | 'useCaseId'
  Prelude.Text ->
  DeleteUseCase
newDeleteUseCase :: Text -> Text -> Text -> DeleteUseCase
newDeleteUseCase
  Text
pInstanceId_
  Text
pIntegrationAssociationId_
  Text
pUseCaseId_ =
    DeleteUseCase' :: Text -> Text -> Text -> DeleteUseCase
DeleteUseCase'
      { $sel:instanceId:DeleteUseCase' :: Text
instanceId = Text
pInstanceId_,
        $sel:integrationAssociationId:DeleteUseCase' :: Text
integrationAssociationId =
          Text
pIntegrationAssociationId_,
        $sel:useCaseId:DeleteUseCase' :: Text
useCaseId = Text
pUseCaseId_
      }

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

-- | The identifier for the integration association.
deleteUseCase_integrationAssociationId :: Lens.Lens' DeleteUseCase Prelude.Text
deleteUseCase_integrationAssociationId :: (Text -> f Text) -> DeleteUseCase -> f DeleteUseCase
deleteUseCase_integrationAssociationId = (DeleteUseCase -> Text)
-> (DeleteUseCase -> Text -> DeleteUseCase)
-> Lens DeleteUseCase DeleteUseCase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUseCase' {Text
integrationAssociationId :: Text
$sel:integrationAssociationId:DeleteUseCase' :: DeleteUseCase -> Text
integrationAssociationId} -> Text
integrationAssociationId) (\s :: DeleteUseCase
s@DeleteUseCase' {} Text
a -> DeleteUseCase
s {$sel:integrationAssociationId:DeleteUseCase' :: Text
integrationAssociationId = Text
a} :: DeleteUseCase)

-- | The identifier for the use case.
deleteUseCase_useCaseId :: Lens.Lens' DeleteUseCase Prelude.Text
deleteUseCase_useCaseId :: (Text -> f Text) -> DeleteUseCase -> f DeleteUseCase
deleteUseCase_useCaseId = (DeleteUseCase -> Text)
-> (DeleteUseCase -> Text -> DeleteUseCase)
-> Lens DeleteUseCase DeleteUseCase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUseCase' {Text
useCaseId :: Text
$sel:useCaseId:DeleteUseCase' :: DeleteUseCase -> Text
useCaseId} -> Text
useCaseId) (\s :: DeleteUseCase
s@DeleteUseCase' {} Text
a -> DeleteUseCase
s {$sel:useCaseId:DeleteUseCase' :: Text
useCaseId = Text
a} :: DeleteUseCase)

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

instance Prelude.Hashable DeleteUseCase

instance Prelude.NFData DeleteUseCase

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

instance Core.ToPath DeleteUseCase where
  toPath :: DeleteUseCase -> ByteString
toPath DeleteUseCase' {Text
useCaseId :: Text
integrationAssociationId :: Text
instanceId :: Text
$sel:useCaseId:DeleteUseCase' :: DeleteUseCase -> Text
$sel:integrationAssociationId:DeleteUseCase' :: DeleteUseCase -> Text
$sel:instanceId:DeleteUseCase' :: DeleteUseCase -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/instance/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/integration-associations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
integrationAssociationId,
        ByteString
"/use-cases/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
useCaseId
      ]

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

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

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

instance Prelude.NFData DeleteUseCaseResponse