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

    -- * Request Lenses
    disassociateBrowserSettings_portalArn,

    -- * Destructuring the Response
    DisassociateBrowserSettingsResponse (..),
    newDisassociateBrowserSettingsResponse,

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

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

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

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

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

instance Data.ToHeaders DisassociateBrowserSettings where
  toHeaders :: DisassociateBrowserSettings -> 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 DisassociateBrowserSettings where
  toPath :: DisassociateBrowserSettings -> ByteString
toPath DisassociateBrowserSettings' {Text
portalArn :: Text
$sel:portalArn:DisassociateBrowserSettings' :: DisassociateBrowserSettings -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/portals/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
portalArn,
        ByteString
"/browserSettings"
      ]

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

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

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

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

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