{-# 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.DisassociateTrustStore
-- 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 a trust store from a web portal.
module Amazonka.WorkSpacesWeb.DisassociateTrustStore
  ( -- * Creating a Request
    DisassociateTrustStore (..),
    newDisassociateTrustStore,

    -- * Request Lenses
    disassociateTrustStore_portalArn,

    -- * Destructuring the Response
    DisassociateTrustStoreResponse (..),
    newDisassociateTrustStoreResponse,

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

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

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

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

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

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

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

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

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

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

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