{-# 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.WorkSpacesWeb.DisassociateUserSettings
-- 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 user settings from a web portal.
module Amazonka.WorkSpacesWeb.DisassociateUserSettings
  ( -- * Creating a Request
    DisassociateUserSettings (..),
    newDisassociateUserSettings,

    -- * Request Lenses
    disassociateUserSettings_portalArn,

    -- * Destructuring the Response
    DisassociateUserSettingsResponse (..),
    newDisassociateUserSettingsResponse,

    -- * Response Lenses
    disassociateUserSettingsResponse_httpStatus,
  )
where

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
import Amazonka.WorkSpacesWeb.Types

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

-- |
-- Create a value of 'DisassociateUserSettings' 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:
--
-- 'portalArn', 'disassociateUserSettings_portalArn' - The ARN of the web portal.
newDisassociateUserSettings ::
  -- | 'portalArn'
  Prelude.Text ->
  DisassociateUserSettings
newDisassociateUserSettings :: Text -> DisassociateUserSettings
newDisassociateUserSettings Text
pPortalArn_ =
  DisassociateUserSettings' {$sel:portalArn:DisassociateUserSettings' :: Text
portalArn = Text
pPortalArn_}

-- | The ARN of the web portal.
disassociateUserSettings_portalArn :: Lens.Lens' DisassociateUserSettings Prelude.Text
disassociateUserSettings_portalArn :: Lens' DisassociateUserSettings Text
disassociateUserSettings_portalArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateUserSettings' {Text
portalArn :: Text
$sel:portalArn:DisassociateUserSettings' :: DisassociateUserSettings -> Text
portalArn} -> Text
portalArn) (\s :: DisassociateUserSettings
s@DisassociateUserSettings' {} Text
a -> DisassociateUserSettings
s {$sel:portalArn:DisassociateUserSettings' :: Text
portalArn = Text
a} :: DisassociateUserSettings)

instance Core.AWSRequest DisassociateUserSettings where
  type
    AWSResponse DisassociateUserSettings =
      DisassociateUserSettingsResponse
  request :: (Service -> Service)
-> DisassociateUserSettings -> Request DisassociateUserSettings
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 DisassociateUserSettings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisassociateUserSettings)))
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 -> DisassociateUserSettingsResponse
DisassociateUserSettingsResponse'
            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 DisassociateUserSettings where
  hashWithSalt :: Int -> DisassociateUserSettings -> Int
hashWithSalt Int
_salt DisassociateUserSettings' {Text
portalArn :: Text
$sel:portalArn:DisassociateUserSettings' :: DisassociateUserSettings -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portalArn

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

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

instance Data.ToPath DisassociateUserSettings where
  toPath :: DisassociateUserSettings -> ByteString
toPath DisassociateUserSettings' {Text
portalArn :: Text
$sel:portalArn:DisassociateUserSettings' :: DisassociateUserSettings -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/portals/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
portalArn, ByteString
"/userSettings"]

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

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

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

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

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