{-# 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.DisassociateUserAccessLoggingSettings
-- 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 access logging settings from a web portal.
module Amazonka.WorkSpacesWeb.DisassociateUserAccessLoggingSettings
  ( -- * Creating a Request
    DisassociateUserAccessLoggingSettings (..),
    newDisassociateUserAccessLoggingSettings,

    -- * Request Lenses
    disassociateUserAccessLoggingSettings_portalArn,

    -- * Destructuring the Response
    DisassociateUserAccessLoggingSettingsResponse (..),
    newDisassociateUserAccessLoggingSettingsResponse,

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

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

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

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

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

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

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

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

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

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

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