{-# 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.DisassociateSigninDelegateGroupsFromAccount
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Disassociates the specified sign-in delegate groups from the specified
-- Amazon Chime account.
module Amazonka.Chime.DisassociateSigninDelegateGroupsFromAccount
  ( -- * Creating a Request
    DisassociateSigninDelegateGroupsFromAccount (..),
    newDisassociateSigninDelegateGroupsFromAccount,

    -- * Request Lenses
    disassociateSigninDelegateGroupsFromAccount_accountId,
    disassociateSigninDelegateGroupsFromAccount_groupNames,

    -- * Destructuring the Response
    DisassociateSigninDelegateGroupsFromAccountResponse (..),
    newDisassociateSigninDelegateGroupsFromAccountResponse,

    -- * Response Lenses
    disassociateSigninDelegateGroupsFromAccountResponse_httpStatus,
  )
where

import Amazonka.Chime.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:/ 'newDisassociateSigninDelegateGroupsFromAccount' smart constructor.
data DisassociateSigninDelegateGroupsFromAccount = DisassociateSigninDelegateGroupsFromAccount'
  { -- | The Amazon Chime account ID.
    DisassociateSigninDelegateGroupsFromAccount -> Text
accountId :: Prelude.Text,
    -- | The sign-in delegate group names.
    DisassociateSigninDelegateGroupsFromAccount -> NonEmpty Text
groupNames :: Prelude.NonEmpty Prelude.Text
  }
  deriving (DisassociateSigninDelegateGroupsFromAccount
-> DisassociateSigninDelegateGroupsFromAccount -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateSigninDelegateGroupsFromAccount
-> DisassociateSigninDelegateGroupsFromAccount -> Bool
$c/= :: DisassociateSigninDelegateGroupsFromAccount
-> DisassociateSigninDelegateGroupsFromAccount -> Bool
== :: DisassociateSigninDelegateGroupsFromAccount
-> DisassociateSigninDelegateGroupsFromAccount -> Bool
$c== :: DisassociateSigninDelegateGroupsFromAccount
-> DisassociateSigninDelegateGroupsFromAccount -> Bool
Prelude.Eq, ReadPrec [DisassociateSigninDelegateGroupsFromAccount]
ReadPrec DisassociateSigninDelegateGroupsFromAccount
Int -> ReadS DisassociateSigninDelegateGroupsFromAccount
ReadS [DisassociateSigninDelegateGroupsFromAccount]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateSigninDelegateGroupsFromAccount]
$creadListPrec :: ReadPrec [DisassociateSigninDelegateGroupsFromAccount]
readPrec :: ReadPrec DisassociateSigninDelegateGroupsFromAccount
$creadPrec :: ReadPrec DisassociateSigninDelegateGroupsFromAccount
readList :: ReadS [DisassociateSigninDelegateGroupsFromAccount]
$creadList :: ReadS [DisassociateSigninDelegateGroupsFromAccount]
readsPrec :: Int -> ReadS DisassociateSigninDelegateGroupsFromAccount
$creadsPrec :: Int -> ReadS DisassociateSigninDelegateGroupsFromAccount
Prelude.Read, Int -> DisassociateSigninDelegateGroupsFromAccount -> ShowS
[DisassociateSigninDelegateGroupsFromAccount] -> ShowS
DisassociateSigninDelegateGroupsFromAccount -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateSigninDelegateGroupsFromAccount] -> ShowS
$cshowList :: [DisassociateSigninDelegateGroupsFromAccount] -> ShowS
show :: DisassociateSigninDelegateGroupsFromAccount -> String
$cshow :: DisassociateSigninDelegateGroupsFromAccount -> String
showsPrec :: Int -> DisassociateSigninDelegateGroupsFromAccount -> ShowS
$cshowsPrec :: Int -> DisassociateSigninDelegateGroupsFromAccount -> ShowS
Prelude.Show, forall x.
Rep DisassociateSigninDelegateGroupsFromAccount x
-> DisassociateSigninDelegateGroupsFromAccount
forall x.
DisassociateSigninDelegateGroupsFromAccount
-> Rep DisassociateSigninDelegateGroupsFromAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateSigninDelegateGroupsFromAccount x
-> DisassociateSigninDelegateGroupsFromAccount
$cfrom :: forall x.
DisassociateSigninDelegateGroupsFromAccount
-> Rep DisassociateSigninDelegateGroupsFromAccount x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateSigninDelegateGroupsFromAccount' 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:
--
-- 'accountId', 'disassociateSigninDelegateGroupsFromAccount_accountId' - The Amazon Chime account ID.
--
-- 'groupNames', 'disassociateSigninDelegateGroupsFromAccount_groupNames' - The sign-in delegate group names.
newDisassociateSigninDelegateGroupsFromAccount ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'groupNames'
  Prelude.NonEmpty Prelude.Text ->
  DisassociateSigninDelegateGroupsFromAccount
newDisassociateSigninDelegateGroupsFromAccount :: Text
-> NonEmpty Text -> DisassociateSigninDelegateGroupsFromAccount
newDisassociateSigninDelegateGroupsFromAccount
  Text
pAccountId_
  NonEmpty Text
pGroupNames_ =
    DisassociateSigninDelegateGroupsFromAccount'
      { $sel:accountId:DisassociateSigninDelegateGroupsFromAccount' :: Text
accountId =
          Text
pAccountId_,
        $sel:groupNames:DisassociateSigninDelegateGroupsFromAccount' :: NonEmpty Text
groupNames =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pGroupNames_
      }

-- | The Amazon Chime account ID.
disassociateSigninDelegateGroupsFromAccount_accountId :: Lens.Lens' DisassociateSigninDelegateGroupsFromAccount Prelude.Text
disassociateSigninDelegateGroupsFromAccount_accountId :: Lens' DisassociateSigninDelegateGroupsFromAccount Text
disassociateSigninDelegateGroupsFromAccount_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSigninDelegateGroupsFromAccount' {Text
accountId :: Text
$sel:accountId:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> Text
accountId} -> Text
accountId) (\s :: DisassociateSigninDelegateGroupsFromAccount
s@DisassociateSigninDelegateGroupsFromAccount' {} Text
a -> DisassociateSigninDelegateGroupsFromAccount
s {$sel:accountId:DisassociateSigninDelegateGroupsFromAccount' :: Text
accountId = Text
a} :: DisassociateSigninDelegateGroupsFromAccount)

-- | The sign-in delegate group names.
disassociateSigninDelegateGroupsFromAccount_groupNames :: Lens.Lens' DisassociateSigninDelegateGroupsFromAccount (Prelude.NonEmpty Prelude.Text)
disassociateSigninDelegateGroupsFromAccount_groupNames :: Lens' DisassociateSigninDelegateGroupsFromAccount (NonEmpty Text)
disassociateSigninDelegateGroupsFromAccount_groupNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSigninDelegateGroupsFromAccount' {NonEmpty Text
groupNames :: NonEmpty Text
$sel:groupNames:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> NonEmpty Text
groupNames} -> NonEmpty Text
groupNames) (\s :: DisassociateSigninDelegateGroupsFromAccount
s@DisassociateSigninDelegateGroupsFromAccount' {} NonEmpty Text
a -> DisassociateSigninDelegateGroupsFromAccount
s {$sel:groupNames:DisassociateSigninDelegateGroupsFromAccount' :: NonEmpty Text
groupNames = NonEmpty Text
a} :: DisassociateSigninDelegateGroupsFromAccount) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    DisassociateSigninDelegateGroupsFromAccount
  where
  type
    AWSResponse
      DisassociateSigninDelegateGroupsFromAccount =
      DisassociateSigninDelegateGroupsFromAccountResponse
  request :: (Service -> Service)
-> DisassociateSigninDelegateGroupsFromAccount
-> Request DisassociateSigninDelegateGroupsFromAccount
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateSigninDelegateGroupsFromAccount
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DisassociateSigninDelegateGroupsFromAccount)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DisassociateSigninDelegateGroupsFromAccountResponse
DisassociateSigninDelegateGroupsFromAccountResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DisassociateSigninDelegateGroupsFromAccount
  where
  hashWithSalt :: Int -> DisassociateSigninDelegateGroupsFromAccount -> Int
hashWithSalt
    Int
_salt
    DisassociateSigninDelegateGroupsFromAccount' {NonEmpty Text
Text
groupNames :: NonEmpty Text
accountId :: Text
$sel:groupNames:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> NonEmpty Text
$sel:accountId:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
groupNames

instance
  Prelude.NFData
    DisassociateSigninDelegateGroupsFromAccount
  where
  rnf :: DisassociateSigninDelegateGroupsFromAccount -> ()
rnf DisassociateSigninDelegateGroupsFromAccount' {NonEmpty Text
Text
groupNames :: NonEmpty Text
accountId :: Text
$sel:groupNames:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> NonEmpty Text
$sel:accountId:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
groupNames

instance
  Data.ToHeaders
    DisassociateSigninDelegateGroupsFromAccount
  where
  toHeaders :: DisassociateSigninDelegateGroupsFromAccount -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance
  Data.ToJSON
    DisassociateSigninDelegateGroupsFromAccount
  where
  toJSON :: DisassociateSigninDelegateGroupsFromAccount -> Value
toJSON
    DisassociateSigninDelegateGroupsFromAccount' {NonEmpty Text
Text
groupNames :: NonEmpty Text
accountId :: Text
$sel:groupNames:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> NonEmpty Text
$sel:accountId:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> Text
..} =
      [Pair] -> Value
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [forall a. a -> Maybe a
Prelude.Just (Key
"GroupNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
groupNames)]
        )

instance
  Data.ToPath
    DisassociateSigninDelegateGroupsFromAccount
  where
  toPath :: DisassociateSigninDelegateGroupsFromAccount -> ByteString
toPath
    DisassociateSigninDelegateGroupsFromAccount' {NonEmpty Text
Text
groupNames :: NonEmpty Text
accountId :: Text
$sel:groupNames:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> NonEmpty Text
$sel:accountId:DisassociateSigninDelegateGroupsFromAccount' :: DisassociateSigninDelegateGroupsFromAccount -> Text
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/accounts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
accountId]

instance
  Data.ToQuery
    DisassociateSigninDelegateGroupsFromAccount
  where
  toQuery :: DisassociateSigninDelegateGroupsFromAccount -> QueryString
toQuery =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [QueryString
"operation=disassociate-signin-delegate-groups"]
      )

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

-- |
-- Create a value of 'DisassociateSigninDelegateGroupsFromAccountResponse' 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:
--
-- 'httpStatus', 'disassociateSigninDelegateGroupsFromAccountResponse_httpStatus' - The response's http status code.
newDisassociateSigninDelegateGroupsFromAccountResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DisassociateSigninDelegateGroupsFromAccountResponse
newDisassociateSigninDelegateGroupsFromAccountResponse :: Int -> DisassociateSigninDelegateGroupsFromAccountResponse
newDisassociateSigninDelegateGroupsFromAccountResponse
  Int
pHttpStatus_ =
    DisassociateSigninDelegateGroupsFromAccountResponse'
      { $sel:httpStatus:DisassociateSigninDelegateGroupsFromAccountResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
disassociateSigninDelegateGroupsFromAccountResponse_httpStatus :: Lens.Lens' DisassociateSigninDelegateGroupsFromAccountResponse Prelude.Int
disassociateSigninDelegateGroupsFromAccountResponse_httpStatus :: Lens' DisassociateSigninDelegateGroupsFromAccountResponse Int
disassociateSigninDelegateGroupsFromAccountResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSigninDelegateGroupsFromAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateSigninDelegateGroupsFromAccountResponse' :: DisassociateSigninDelegateGroupsFromAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateSigninDelegateGroupsFromAccountResponse
s@DisassociateSigninDelegateGroupsFromAccountResponse' {} Int
a -> DisassociateSigninDelegateGroupsFromAccountResponse
s {$sel:httpStatus:DisassociateSigninDelegateGroupsFromAccountResponse' :: Int
httpStatus = Int
a} :: DisassociateSigninDelegateGroupsFromAccountResponse)

instance
  Prelude.NFData
    DisassociateSigninDelegateGroupsFromAccountResponse
  where
  rnf :: DisassociateSigninDelegateGroupsFromAccountResponse -> ()
rnf
    DisassociateSigninDelegateGroupsFromAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateSigninDelegateGroupsFromAccountResponse' :: DisassociateSigninDelegateGroupsFromAccountResponse -> Int
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus