{-# 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.DeleteAppInstanceAdmin
-- 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)
--
-- Demotes an @AppInstanceAdmin@ to an @AppInstanceUser@. This action does
-- not delete the user.
module Amazonka.ChimeSDKIdentity.DeleteAppInstanceAdmin
  ( -- * Creating a Request
    DeleteAppInstanceAdmin (..),
    newDeleteAppInstanceAdmin,

    -- * Request Lenses
    deleteAppInstanceAdmin_appInstanceAdminArn,
    deleteAppInstanceAdmin_appInstanceArn,

    -- * Destructuring the Response
    DeleteAppInstanceAdminResponse (..),
    newDeleteAppInstanceAdminResponse,
  )
where

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

-- |
-- Create a value of 'DeleteAppInstanceAdmin' 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:
--
-- 'appInstanceAdminArn', 'deleteAppInstanceAdmin_appInstanceAdminArn' - The ARN of the @AppInstance@\'s administrator.
--
-- 'appInstanceArn', 'deleteAppInstanceAdmin_appInstanceArn' - The ARN of the @AppInstance@.
newDeleteAppInstanceAdmin ::
  -- | 'appInstanceAdminArn'
  Prelude.Text ->
  -- | 'appInstanceArn'
  Prelude.Text ->
  DeleteAppInstanceAdmin
newDeleteAppInstanceAdmin :: Text -> Text -> DeleteAppInstanceAdmin
newDeleteAppInstanceAdmin
  Text
pAppInstanceAdminArn_
  Text
pAppInstanceArn_ =
    DeleteAppInstanceAdmin' :: Text -> Text -> DeleteAppInstanceAdmin
DeleteAppInstanceAdmin'
      { $sel:appInstanceAdminArn:DeleteAppInstanceAdmin' :: Text
appInstanceAdminArn =
          Text
pAppInstanceAdminArn_,
        $sel:appInstanceArn:DeleteAppInstanceAdmin' :: Text
appInstanceArn = Text
pAppInstanceArn_
      }

-- | The ARN of the @AppInstance@\'s administrator.
deleteAppInstanceAdmin_appInstanceAdminArn :: Lens.Lens' DeleteAppInstanceAdmin Prelude.Text
deleteAppInstanceAdmin_appInstanceAdminArn :: (Text -> f Text)
-> DeleteAppInstanceAdmin -> f DeleteAppInstanceAdmin
deleteAppInstanceAdmin_appInstanceAdminArn = (DeleteAppInstanceAdmin -> Text)
-> (DeleteAppInstanceAdmin -> Text -> DeleteAppInstanceAdmin)
-> Lens DeleteAppInstanceAdmin DeleteAppInstanceAdmin Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAppInstanceAdmin' {Text
appInstanceAdminArn :: Text
$sel:appInstanceAdminArn:DeleteAppInstanceAdmin' :: DeleteAppInstanceAdmin -> Text
appInstanceAdminArn} -> Text
appInstanceAdminArn) (\s :: DeleteAppInstanceAdmin
s@DeleteAppInstanceAdmin' {} Text
a -> DeleteAppInstanceAdmin
s {$sel:appInstanceAdminArn:DeleteAppInstanceAdmin' :: Text
appInstanceAdminArn = Text
a} :: DeleteAppInstanceAdmin)

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

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

instance Prelude.Hashable DeleteAppInstanceAdmin

instance Prelude.NFData DeleteAppInstanceAdmin

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

instance Core.ToPath DeleteAppInstanceAdmin where
  toPath :: DeleteAppInstanceAdmin -> ByteString
toPath DeleteAppInstanceAdmin' {Text
appInstanceArn :: Text
appInstanceAdminArn :: Text
$sel:appInstanceArn:DeleteAppInstanceAdmin' :: DeleteAppInstanceAdmin -> Text
$sel:appInstanceAdminArn:DeleteAppInstanceAdmin' :: DeleteAppInstanceAdmin -> 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,
        ByteString
"/admins/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appInstanceAdminArn
      ]

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

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

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

instance
  Prelude.NFData
    DeleteAppInstanceAdminResponse