{-# 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.Chime.DeleteAppInstance
-- 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 an @AppInstance@ and all associated data asynchronously.
module Amazonka.Chime.DeleteAppInstance
  ( -- * Creating a Request
    DeleteAppInstance (..),
    newDeleteAppInstance,

    -- * Request Lenses
    deleteAppInstance_appInstanceArn,

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

import Amazonka.Chime.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:/ 'newDeleteAppInstance' smart constructor.
data DeleteAppInstance = DeleteAppInstance'
  { -- | The ARN of the @AppInstance@.
    DeleteAppInstance -> Text
appInstanceArn :: Prelude.Text
  }
  deriving (DeleteAppInstance -> DeleteAppInstance -> Bool
(DeleteAppInstance -> DeleteAppInstance -> Bool)
-> (DeleteAppInstance -> DeleteAppInstance -> Bool)
-> Eq DeleteAppInstance
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]
(Int -> ReadS DeleteAppInstance)
-> ReadS [DeleteAppInstance]
-> ReadPrec DeleteAppInstance
-> ReadPrec [DeleteAppInstance]
-> Read 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
(Int -> DeleteAppInstance -> ShowS)
-> (DeleteAppInstance -> String)
-> ([DeleteAppInstance] -> ShowS)
-> Show DeleteAppInstance
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. DeleteAppInstance -> Rep DeleteAppInstance x)
-> (forall x. Rep DeleteAppInstance x -> DeleteAppInstance)
-> Generic DeleteAppInstance
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' :: Text -> DeleteAppInstance
DeleteAppInstance'
    { $sel:appInstanceArn:DeleteAppInstance' :: Text
appInstanceArn =
        Text
pAppInstanceArn_
    }

-- | The ARN of the @AppInstance@.
deleteAppInstance_appInstanceArn :: Lens.Lens' DeleteAppInstance Prelude.Text
deleteAppInstance_appInstanceArn :: (Text -> f Text) -> DeleteAppInstance -> f DeleteAppInstance
deleteAppInstance_appInstanceArn = (DeleteAppInstance -> Text)
-> (DeleteAppInstance -> Text -> DeleteAppInstance)
-> Lens DeleteAppInstance DeleteAppInstance Text Text
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 :: DeleteAppInstance -> Request DeleteAppInstance
request = Service -> DeleteAppInstance -> Request DeleteAppInstance
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteAppInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAppInstance)))
response =
    AWSResponse DeleteAppInstance
-> Logger
-> Service
-> Proxy DeleteAppInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAppInstance)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteAppInstance
DeleteAppInstanceResponse
DeleteAppInstanceResponse'

instance Prelude.Hashable DeleteAppInstance

instance Prelude.NFData DeleteAppInstance

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

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

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

-- | /See:/ 'newDeleteAppInstanceResponse' smart constructor.
data DeleteAppInstanceResponse = DeleteAppInstanceResponse'
  {
  }
  deriving (DeleteAppInstanceResponse -> DeleteAppInstanceResponse -> Bool
(DeleteAppInstanceResponse -> DeleteAppInstanceResponse -> Bool)
-> (DeleteAppInstanceResponse -> DeleteAppInstanceResponse -> Bool)
-> Eq DeleteAppInstanceResponse
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]
(Int -> ReadS DeleteAppInstanceResponse)
-> ReadS [DeleteAppInstanceResponse]
-> ReadPrec DeleteAppInstanceResponse
-> ReadPrec [DeleteAppInstanceResponse]
-> Read 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
(Int -> DeleteAppInstanceResponse -> ShowS)
-> (DeleteAppInstanceResponse -> String)
-> ([DeleteAppInstanceResponse] -> ShowS)
-> Show DeleteAppInstanceResponse
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.
 DeleteAppInstanceResponse -> Rep DeleteAppInstanceResponse x)
-> (forall x.
    Rep DeleteAppInstanceResponse x -> DeleteAppInstanceResponse)
-> Generic DeleteAppInstanceResponse
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