{-# 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.ChimeSDKIdentity.DeleteAppInstance
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes an @AppInstance@ and all associated data asynchronously.
module Amazonka.ChimeSDKIdentity.DeleteAppInstance
  ( -- * Creating a Request
    DeleteAppInstance (..),
    newDeleteAppInstance,

    -- * Request Lenses
    deleteAppInstance_appInstanceArn,

    -- * Destructuring the Response
    DeleteAppInstanceResponse (..),
    newDeleteAppInstanceResponse,
  )
where

import Amazonka.ChimeSDKIdentity.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:/ 'newDeleteAppInstance' smart constructor.
data DeleteAppInstance = DeleteAppInstance'
  { -- | The ARN of the @AppInstance@.
    DeleteAppInstance -> Text
appInstanceArn :: Prelude.Text
  }
  deriving (DeleteAppInstance -> DeleteAppInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAppInstance -> DeleteAppInstance -> Bool
$c/= :: DeleteAppInstance -> DeleteAppInstance -> Bool
== :: DeleteAppInstance -> DeleteAppInstance -> Bool
$c== :: DeleteAppInstance -> DeleteAppInstance -> Bool
Prelude.Eq, ReadPrec [DeleteAppInstance]
ReadPrec DeleteAppInstance
Int -> ReadS DeleteAppInstance
ReadS [DeleteAppInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAppInstance]
$creadListPrec :: ReadPrec [DeleteAppInstance]
readPrec :: ReadPrec DeleteAppInstance
$creadPrec :: ReadPrec DeleteAppInstance
readList :: ReadS [DeleteAppInstance]
$creadList :: ReadS [DeleteAppInstance]
readsPrec :: Int -> ReadS DeleteAppInstance
$creadsPrec :: Int -> ReadS DeleteAppInstance
Prelude.Read, Int -> DeleteAppInstance -> ShowS
[DeleteAppInstance] -> ShowS
DeleteAppInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAppInstance] -> ShowS
$cshowList :: [DeleteAppInstance] -> ShowS
show :: DeleteAppInstance -> String
$cshow :: DeleteAppInstance -> String
showsPrec :: Int -> DeleteAppInstance -> ShowS
$cshowsPrec :: Int -> DeleteAppInstance -> ShowS
Prelude.Show, forall x. Rep DeleteAppInstance x -> DeleteAppInstance
forall x. DeleteAppInstance -> Rep DeleteAppInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAppInstance x -> DeleteAppInstance
$cfrom :: forall x. DeleteAppInstance -> Rep DeleteAppInstance x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAppInstance' 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:
--
-- 'appInstanceArn', 'deleteAppInstance_appInstanceArn' - The ARN of the @AppInstance@.
newDeleteAppInstance ::
  -- | 'appInstanceArn'
  Prelude.Text ->
  DeleteAppInstance
newDeleteAppInstance :: Text -> DeleteAppInstance
newDeleteAppInstance Text
pAppInstanceArn_ =
  DeleteAppInstance'
    { $sel:appInstanceArn:DeleteAppInstance' :: Text
appInstanceArn =
        Text
pAppInstanceArn_
    }

-- | The ARN of the @AppInstance@.
deleteAppInstance_appInstanceArn :: Lens.Lens' DeleteAppInstance Prelude.Text
deleteAppInstance_appInstanceArn :: Lens' DeleteAppInstance Text
deleteAppInstance_appInstanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAppInstance' {Text
appInstanceArn :: Text
$sel:appInstanceArn:DeleteAppInstance' :: DeleteAppInstance -> Text
appInstanceArn} -> Text
appInstanceArn) (\s :: DeleteAppInstance
s@DeleteAppInstance' {} Text
a -> DeleteAppInstance
s {$sel:appInstanceArn:DeleteAppInstance' :: Text
appInstanceArn = Text
a} :: DeleteAppInstance)

instance Core.AWSRequest DeleteAppInstance where
  type
    AWSResponse DeleteAppInstance =
      DeleteAppInstanceResponse
  request :: (Service -> Service)
-> DeleteAppInstance -> Request DeleteAppInstance
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 DeleteAppInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAppInstance)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteAppInstanceResponse
DeleteAppInstanceResponse'

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

instance Prelude.NFData DeleteAppInstance where
  rnf :: DeleteAppInstance -> ()
rnf DeleteAppInstance' {Text
appInstanceArn :: Text
$sel:appInstanceArn:DeleteAppInstance' :: DeleteAppInstance -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
appInstanceArn

instance Data.ToHeaders DeleteAppInstance where
  toHeaders :: DeleteAppInstance -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeleteAppInstance where
  toPath :: DeleteAppInstance -> ByteString
toPath DeleteAppInstance' {Text
appInstanceArn :: Text
$sel:appInstanceArn:DeleteAppInstance' :: DeleteAppInstance -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/app-instances/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
appInstanceArn]

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

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

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

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