{-# 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.WorkLink.DisassociateWebsiteCertificateAuthority
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Removes a certificate authority (CA).
module Amazonka.WorkLink.DisassociateWebsiteCertificateAuthority
  ( -- * Creating a Request
    DisassociateWebsiteCertificateAuthority (..),
    newDisassociateWebsiteCertificateAuthority,

    -- * Request Lenses
    disassociateWebsiteCertificateAuthority_fleetArn,
    disassociateWebsiteCertificateAuthority_websiteCaId,

    -- * Destructuring the Response
    DisassociateWebsiteCertificateAuthorityResponse (..),
    newDisassociateWebsiteCertificateAuthorityResponse,

    -- * Response Lenses
    disassociateWebsiteCertificateAuthorityResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkLink.Types

-- | /See:/ 'newDisassociateWebsiteCertificateAuthority' smart constructor.
data DisassociateWebsiteCertificateAuthority = DisassociateWebsiteCertificateAuthority'
  { -- | The ARN of the fleet.
    DisassociateWebsiteCertificateAuthority -> Text
fleetArn :: Prelude.Text,
    -- | A unique identifier for the CA.
    DisassociateWebsiteCertificateAuthority -> Text
websiteCaId :: Prelude.Text
  }
  deriving (DisassociateWebsiteCertificateAuthority
-> DisassociateWebsiteCertificateAuthority -> Bool
(DisassociateWebsiteCertificateAuthority
 -> DisassociateWebsiteCertificateAuthority -> Bool)
-> (DisassociateWebsiteCertificateAuthority
    -> DisassociateWebsiteCertificateAuthority -> Bool)
-> Eq DisassociateWebsiteCertificateAuthority
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateWebsiteCertificateAuthority
-> DisassociateWebsiteCertificateAuthority -> Bool
$c/= :: DisassociateWebsiteCertificateAuthority
-> DisassociateWebsiteCertificateAuthority -> Bool
== :: DisassociateWebsiteCertificateAuthority
-> DisassociateWebsiteCertificateAuthority -> Bool
$c== :: DisassociateWebsiteCertificateAuthority
-> DisassociateWebsiteCertificateAuthority -> Bool
Prelude.Eq, ReadPrec [DisassociateWebsiteCertificateAuthority]
ReadPrec DisassociateWebsiteCertificateAuthority
Int -> ReadS DisassociateWebsiteCertificateAuthority
ReadS [DisassociateWebsiteCertificateAuthority]
(Int -> ReadS DisassociateWebsiteCertificateAuthority)
-> ReadS [DisassociateWebsiteCertificateAuthority]
-> ReadPrec DisassociateWebsiteCertificateAuthority
-> ReadPrec [DisassociateWebsiteCertificateAuthority]
-> Read DisassociateWebsiteCertificateAuthority
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateWebsiteCertificateAuthority]
$creadListPrec :: ReadPrec [DisassociateWebsiteCertificateAuthority]
readPrec :: ReadPrec DisassociateWebsiteCertificateAuthority
$creadPrec :: ReadPrec DisassociateWebsiteCertificateAuthority
readList :: ReadS [DisassociateWebsiteCertificateAuthority]
$creadList :: ReadS [DisassociateWebsiteCertificateAuthority]
readsPrec :: Int -> ReadS DisassociateWebsiteCertificateAuthority
$creadsPrec :: Int -> ReadS DisassociateWebsiteCertificateAuthority
Prelude.Read, Int -> DisassociateWebsiteCertificateAuthority -> ShowS
[DisassociateWebsiteCertificateAuthority] -> ShowS
DisassociateWebsiteCertificateAuthority -> String
(Int -> DisassociateWebsiteCertificateAuthority -> ShowS)
-> (DisassociateWebsiteCertificateAuthority -> String)
-> ([DisassociateWebsiteCertificateAuthority] -> ShowS)
-> Show DisassociateWebsiteCertificateAuthority
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateWebsiteCertificateAuthority] -> ShowS
$cshowList :: [DisassociateWebsiteCertificateAuthority] -> ShowS
show :: DisassociateWebsiteCertificateAuthority -> String
$cshow :: DisassociateWebsiteCertificateAuthority -> String
showsPrec :: Int -> DisassociateWebsiteCertificateAuthority -> ShowS
$cshowsPrec :: Int -> DisassociateWebsiteCertificateAuthority -> ShowS
Prelude.Show, (forall x.
 DisassociateWebsiteCertificateAuthority
 -> Rep DisassociateWebsiteCertificateAuthority x)
-> (forall x.
    Rep DisassociateWebsiteCertificateAuthority x
    -> DisassociateWebsiteCertificateAuthority)
-> Generic DisassociateWebsiteCertificateAuthority
forall x.
Rep DisassociateWebsiteCertificateAuthority x
-> DisassociateWebsiteCertificateAuthority
forall x.
DisassociateWebsiteCertificateAuthority
-> Rep DisassociateWebsiteCertificateAuthority x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateWebsiteCertificateAuthority x
-> DisassociateWebsiteCertificateAuthority
$cfrom :: forall x.
DisassociateWebsiteCertificateAuthority
-> Rep DisassociateWebsiteCertificateAuthority x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateWebsiteCertificateAuthority' 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:
--
-- 'fleetArn', 'disassociateWebsiteCertificateAuthority_fleetArn' - The ARN of the fleet.
--
-- 'websiteCaId', 'disassociateWebsiteCertificateAuthority_websiteCaId' - A unique identifier for the CA.
newDisassociateWebsiteCertificateAuthority ::
  -- | 'fleetArn'
  Prelude.Text ->
  -- | 'websiteCaId'
  Prelude.Text ->
  DisassociateWebsiteCertificateAuthority
newDisassociateWebsiteCertificateAuthority :: Text -> Text -> DisassociateWebsiteCertificateAuthority
newDisassociateWebsiteCertificateAuthority
  Text
pFleetArn_
  Text
pWebsiteCaId_ =
    DisassociateWebsiteCertificateAuthority' :: Text -> Text -> DisassociateWebsiteCertificateAuthority
DisassociateWebsiteCertificateAuthority'
      { $sel:fleetArn:DisassociateWebsiteCertificateAuthority' :: Text
fleetArn =
          Text
pFleetArn_,
        $sel:websiteCaId:DisassociateWebsiteCertificateAuthority' :: Text
websiteCaId = Text
pWebsiteCaId_
      }

-- | The ARN of the fleet.
disassociateWebsiteCertificateAuthority_fleetArn :: Lens.Lens' DisassociateWebsiteCertificateAuthority Prelude.Text
disassociateWebsiteCertificateAuthority_fleetArn :: (Text -> f Text)
-> DisassociateWebsiteCertificateAuthority
-> f DisassociateWebsiteCertificateAuthority
disassociateWebsiteCertificateAuthority_fleetArn = (DisassociateWebsiteCertificateAuthority -> Text)
-> (DisassociateWebsiteCertificateAuthority
    -> Text -> DisassociateWebsiteCertificateAuthority)
-> Lens
     DisassociateWebsiteCertificateAuthority
     DisassociateWebsiteCertificateAuthority
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateWebsiteCertificateAuthority' {Text
fleetArn :: Text
$sel:fleetArn:DisassociateWebsiteCertificateAuthority' :: DisassociateWebsiteCertificateAuthority -> Text
fleetArn} -> Text
fleetArn) (\s :: DisassociateWebsiteCertificateAuthority
s@DisassociateWebsiteCertificateAuthority' {} Text
a -> DisassociateWebsiteCertificateAuthority
s {$sel:fleetArn:DisassociateWebsiteCertificateAuthority' :: Text
fleetArn = Text
a} :: DisassociateWebsiteCertificateAuthority)

-- | A unique identifier for the CA.
disassociateWebsiteCertificateAuthority_websiteCaId :: Lens.Lens' DisassociateWebsiteCertificateAuthority Prelude.Text
disassociateWebsiteCertificateAuthority_websiteCaId :: (Text -> f Text)
-> DisassociateWebsiteCertificateAuthority
-> f DisassociateWebsiteCertificateAuthority
disassociateWebsiteCertificateAuthority_websiteCaId = (DisassociateWebsiteCertificateAuthority -> Text)
-> (DisassociateWebsiteCertificateAuthority
    -> Text -> DisassociateWebsiteCertificateAuthority)
-> Lens
     DisassociateWebsiteCertificateAuthority
     DisassociateWebsiteCertificateAuthority
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateWebsiteCertificateAuthority' {Text
websiteCaId :: Text
$sel:websiteCaId:DisassociateWebsiteCertificateAuthority' :: DisassociateWebsiteCertificateAuthority -> Text
websiteCaId} -> Text
websiteCaId) (\s :: DisassociateWebsiteCertificateAuthority
s@DisassociateWebsiteCertificateAuthority' {} Text
a -> DisassociateWebsiteCertificateAuthority
s {$sel:websiteCaId:DisassociateWebsiteCertificateAuthority' :: Text
websiteCaId = Text
a} :: DisassociateWebsiteCertificateAuthority)

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

instance
  Prelude.Hashable
    DisassociateWebsiteCertificateAuthority

instance
  Prelude.NFData
    DisassociateWebsiteCertificateAuthority

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

instance
  Core.ToJSON
    DisassociateWebsiteCertificateAuthority
  where
  toJSON :: DisassociateWebsiteCertificateAuthority -> Value
toJSON DisassociateWebsiteCertificateAuthority' {Text
websiteCaId :: Text
fleetArn :: Text
$sel:websiteCaId:DisassociateWebsiteCertificateAuthority' :: DisassociateWebsiteCertificateAuthority -> Text
$sel:fleetArn:DisassociateWebsiteCertificateAuthority' :: DisassociateWebsiteCertificateAuthority -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WebsiteCaId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
websiteCaId)
          ]
      )

instance
  Core.ToPath
    DisassociateWebsiteCertificateAuthority
  where
  toPath :: DisassociateWebsiteCertificateAuthority -> ByteString
toPath =
    ByteString -> DisassociateWebsiteCertificateAuthority -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/disassociateWebsiteCertificateAuthority"

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

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

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

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

instance
  Prelude.NFData
    DisassociateWebsiteCertificateAuthorityResponse