{-# 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.MediaConvert.DisassociateCertificate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Removes an association between the Amazon Resource Name (ARN) of an AWS
-- Certificate Manager (ACM) certificate and an AWS Elemental MediaConvert
-- resource.
module Amazonka.MediaConvert.DisassociateCertificate
  ( -- * Creating a Request
    DisassociateCertificate (..),
    newDisassociateCertificate,

    -- * Request Lenses
    disassociateCertificate_arn,

    -- * Destructuring the Response
    DisassociateCertificateResponse (..),
    newDisassociateCertificateResponse,

    -- * Response Lenses
    disassociateCertificateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDisassociateCertificate' smart constructor.
data DisassociateCertificate = DisassociateCertificate'
  { -- | The ARN of the ACM certificate that you want to disassociate from your
    -- MediaConvert resource.
    DisassociateCertificate -> Text
arn :: Prelude.Text
  }
  deriving (DisassociateCertificate -> DisassociateCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateCertificate -> DisassociateCertificate -> Bool
$c/= :: DisassociateCertificate -> DisassociateCertificate -> Bool
== :: DisassociateCertificate -> DisassociateCertificate -> Bool
$c== :: DisassociateCertificate -> DisassociateCertificate -> Bool
Prelude.Eq, ReadPrec [DisassociateCertificate]
ReadPrec DisassociateCertificate
Int -> ReadS DisassociateCertificate
ReadS [DisassociateCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateCertificate]
$creadListPrec :: ReadPrec [DisassociateCertificate]
readPrec :: ReadPrec DisassociateCertificate
$creadPrec :: ReadPrec DisassociateCertificate
readList :: ReadS [DisassociateCertificate]
$creadList :: ReadS [DisassociateCertificate]
readsPrec :: Int -> ReadS DisassociateCertificate
$creadsPrec :: Int -> ReadS DisassociateCertificate
Prelude.Read, Int -> DisassociateCertificate -> ShowS
[DisassociateCertificate] -> ShowS
DisassociateCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateCertificate] -> ShowS
$cshowList :: [DisassociateCertificate] -> ShowS
show :: DisassociateCertificate -> String
$cshow :: DisassociateCertificate -> String
showsPrec :: Int -> DisassociateCertificate -> ShowS
$cshowsPrec :: Int -> DisassociateCertificate -> ShowS
Prelude.Show, forall x. Rep DisassociateCertificate x -> DisassociateCertificate
forall x. DisassociateCertificate -> Rep DisassociateCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateCertificate x -> DisassociateCertificate
$cfrom :: forall x. DisassociateCertificate -> Rep DisassociateCertificate x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateCertificate' 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:
--
-- 'arn', 'disassociateCertificate_arn' - The ARN of the ACM certificate that you want to disassociate from your
-- MediaConvert resource.
newDisassociateCertificate ::
  -- | 'arn'
  Prelude.Text ->
  DisassociateCertificate
newDisassociateCertificate :: Text -> DisassociateCertificate
newDisassociateCertificate Text
pArn_ =
  DisassociateCertificate' {$sel:arn:DisassociateCertificate' :: Text
arn = Text
pArn_}

-- | The ARN of the ACM certificate that you want to disassociate from your
-- MediaConvert resource.
disassociateCertificate_arn :: Lens.Lens' DisassociateCertificate Prelude.Text
disassociateCertificate_arn :: Lens' DisassociateCertificate Text
disassociateCertificate_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateCertificate' {Text
arn :: Text
$sel:arn:DisassociateCertificate' :: DisassociateCertificate -> Text
arn} -> Text
arn) (\s :: DisassociateCertificate
s@DisassociateCertificate' {} Text
a -> DisassociateCertificate
s {$sel:arn:DisassociateCertificate' :: Text
arn = Text
a} :: DisassociateCertificate)

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

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

instance Data.ToHeaders DisassociateCertificate where
  toHeaders :: DisassociateCertificate -> 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 DisassociateCertificate where
  toPath :: DisassociateCertificate -> ByteString
toPath DisassociateCertificate' {Text
arn :: Text
$sel:arn:DisassociateCertificate' :: DisassociateCertificate -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2017-08-29/certificates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
arn]

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

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

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

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

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