{-# 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.Route53.DisableHostedZoneDNSSEC
-- 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)
--
-- Disables DNSSEC signing in a specific hosted zone. This action does not
-- deactivate any key-signing keys (KSKs) that are active in the hosted
-- zone.
module Amazonka.Route53.DisableHostedZoneDNSSEC
  ( -- * Creating a Request
    DisableHostedZoneDNSSEC (..),
    newDisableHostedZoneDNSSEC,

    -- * Request Lenses
    disableHostedZoneDNSSEC_hostedZoneId,

    -- * Destructuring the Response
    DisableHostedZoneDNSSECResponse (..),
    newDisableHostedZoneDNSSECResponse,

    -- * Response Lenses
    disableHostedZoneDNSSECResponse_httpStatus,
    disableHostedZoneDNSSECResponse_changeInfo,
  )
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.Route53.Types

-- | /See:/ 'newDisableHostedZoneDNSSEC' smart constructor.
data DisableHostedZoneDNSSEC = DisableHostedZoneDNSSEC'
  { -- | A unique string used to identify a hosted zone.
    DisableHostedZoneDNSSEC -> ResourceId
hostedZoneId :: ResourceId
  }
  deriving (DisableHostedZoneDNSSEC -> DisableHostedZoneDNSSEC -> Bool
(DisableHostedZoneDNSSEC -> DisableHostedZoneDNSSEC -> Bool)
-> (DisableHostedZoneDNSSEC -> DisableHostedZoneDNSSEC -> Bool)
-> Eq DisableHostedZoneDNSSEC
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableHostedZoneDNSSEC -> DisableHostedZoneDNSSEC -> Bool
$c/= :: DisableHostedZoneDNSSEC -> DisableHostedZoneDNSSEC -> Bool
== :: DisableHostedZoneDNSSEC -> DisableHostedZoneDNSSEC -> Bool
$c== :: DisableHostedZoneDNSSEC -> DisableHostedZoneDNSSEC -> Bool
Prelude.Eq, ReadPrec [DisableHostedZoneDNSSEC]
ReadPrec DisableHostedZoneDNSSEC
Int -> ReadS DisableHostedZoneDNSSEC
ReadS [DisableHostedZoneDNSSEC]
(Int -> ReadS DisableHostedZoneDNSSEC)
-> ReadS [DisableHostedZoneDNSSEC]
-> ReadPrec DisableHostedZoneDNSSEC
-> ReadPrec [DisableHostedZoneDNSSEC]
-> Read DisableHostedZoneDNSSEC
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableHostedZoneDNSSEC]
$creadListPrec :: ReadPrec [DisableHostedZoneDNSSEC]
readPrec :: ReadPrec DisableHostedZoneDNSSEC
$creadPrec :: ReadPrec DisableHostedZoneDNSSEC
readList :: ReadS [DisableHostedZoneDNSSEC]
$creadList :: ReadS [DisableHostedZoneDNSSEC]
readsPrec :: Int -> ReadS DisableHostedZoneDNSSEC
$creadsPrec :: Int -> ReadS DisableHostedZoneDNSSEC
Prelude.Read, Int -> DisableHostedZoneDNSSEC -> ShowS
[DisableHostedZoneDNSSEC] -> ShowS
DisableHostedZoneDNSSEC -> String
(Int -> DisableHostedZoneDNSSEC -> ShowS)
-> (DisableHostedZoneDNSSEC -> String)
-> ([DisableHostedZoneDNSSEC] -> ShowS)
-> Show DisableHostedZoneDNSSEC
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableHostedZoneDNSSEC] -> ShowS
$cshowList :: [DisableHostedZoneDNSSEC] -> ShowS
show :: DisableHostedZoneDNSSEC -> String
$cshow :: DisableHostedZoneDNSSEC -> String
showsPrec :: Int -> DisableHostedZoneDNSSEC -> ShowS
$cshowsPrec :: Int -> DisableHostedZoneDNSSEC -> ShowS
Prelude.Show, (forall x.
 DisableHostedZoneDNSSEC -> Rep DisableHostedZoneDNSSEC x)
-> (forall x.
    Rep DisableHostedZoneDNSSEC x -> DisableHostedZoneDNSSEC)
-> Generic DisableHostedZoneDNSSEC
forall x. Rep DisableHostedZoneDNSSEC x -> DisableHostedZoneDNSSEC
forall x. DisableHostedZoneDNSSEC -> Rep DisableHostedZoneDNSSEC x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableHostedZoneDNSSEC x -> DisableHostedZoneDNSSEC
$cfrom :: forall x. DisableHostedZoneDNSSEC -> Rep DisableHostedZoneDNSSEC x
Prelude.Generic)

-- |
-- Create a value of 'DisableHostedZoneDNSSEC' 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:
--
-- 'hostedZoneId', 'disableHostedZoneDNSSEC_hostedZoneId' - A unique string used to identify a hosted zone.
newDisableHostedZoneDNSSEC ::
  -- | 'hostedZoneId'
  ResourceId ->
  DisableHostedZoneDNSSEC
newDisableHostedZoneDNSSEC :: ResourceId -> DisableHostedZoneDNSSEC
newDisableHostedZoneDNSSEC ResourceId
pHostedZoneId_ =
  DisableHostedZoneDNSSEC' :: ResourceId -> DisableHostedZoneDNSSEC
DisableHostedZoneDNSSEC'
    { $sel:hostedZoneId:DisableHostedZoneDNSSEC' :: ResourceId
hostedZoneId =
        ResourceId
pHostedZoneId_
    }

-- | A unique string used to identify a hosted zone.
disableHostedZoneDNSSEC_hostedZoneId :: Lens.Lens' DisableHostedZoneDNSSEC ResourceId
disableHostedZoneDNSSEC_hostedZoneId :: (ResourceId -> f ResourceId)
-> DisableHostedZoneDNSSEC -> f DisableHostedZoneDNSSEC
disableHostedZoneDNSSEC_hostedZoneId = (DisableHostedZoneDNSSEC -> ResourceId)
-> (DisableHostedZoneDNSSEC
    -> ResourceId -> DisableHostedZoneDNSSEC)
-> Lens
     DisableHostedZoneDNSSEC
     DisableHostedZoneDNSSEC
     ResourceId
     ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableHostedZoneDNSSEC' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:DisableHostedZoneDNSSEC' :: DisableHostedZoneDNSSEC -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: DisableHostedZoneDNSSEC
s@DisableHostedZoneDNSSEC' {} ResourceId
a -> DisableHostedZoneDNSSEC
s {$sel:hostedZoneId:DisableHostedZoneDNSSEC' :: ResourceId
hostedZoneId = ResourceId
a} :: DisableHostedZoneDNSSEC)

instance Core.AWSRequest DisableHostedZoneDNSSEC where
  type
    AWSResponse DisableHostedZoneDNSSEC =
      DisableHostedZoneDNSSECResponse
  request :: DisableHostedZoneDNSSEC -> Request DisableHostedZoneDNSSEC
request = Service
-> DisableHostedZoneDNSSEC -> Request DisableHostedZoneDNSSEC
forall a. ToRequest a => Service -> a -> Request a
Request.post Service
defaultService
  response :: Logger
-> Service
-> Proxy DisableHostedZoneDNSSEC
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisableHostedZoneDNSSEC)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse DisableHostedZoneDNSSEC))
-> Logger
-> Service
-> Proxy DisableHostedZoneDNSSEC
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisableHostedZoneDNSSEC)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> ChangeInfo -> DisableHostedZoneDNSSECResponse
DisableHostedZoneDNSSECResponse'
            (Int -> ChangeInfo -> DisableHostedZoneDNSSECResponse)
-> Either String Int
-> Either String (ChangeInfo -> DisableHostedZoneDNSSECResponse)
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))
            Either String (ChangeInfo -> DisableHostedZoneDNSSECResponse)
-> Either String ChangeInfo
-> Either String DisableHostedZoneDNSSECResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ChangeInfo
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ChangeInfo")
      )

instance Prelude.Hashable DisableHostedZoneDNSSEC

instance Prelude.NFData DisableHostedZoneDNSSEC

instance Core.ToHeaders DisableHostedZoneDNSSEC where
  toHeaders :: DisableHostedZoneDNSSEC -> ResponseHeaders
toHeaders = ResponseHeaders -> DisableHostedZoneDNSSEC -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DisableHostedZoneDNSSEC where
  toPath :: DisableHostedZoneDNSSEC -> ByteString
toPath DisableHostedZoneDNSSEC' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:DisableHostedZoneDNSSEC' :: DisableHostedZoneDNSSEC -> ResourceId
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2013-04-01/hostedzone/",
        ResourceId -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ResourceId
hostedZoneId,
        ByteString
"/disable-dnssec"
      ]

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

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

-- |
-- Create a value of 'DisableHostedZoneDNSSECResponse' 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', 'disableHostedZoneDNSSECResponse_httpStatus' - The response's http status code.
--
-- 'changeInfo', 'disableHostedZoneDNSSECResponse_changeInfo' - Undocumented member.
newDisableHostedZoneDNSSECResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'changeInfo'
  ChangeInfo ->
  DisableHostedZoneDNSSECResponse
newDisableHostedZoneDNSSECResponse :: Int -> ChangeInfo -> DisableHostedZoneDNSSECResponse
newDisableHostedZoneDNSSECResponse
  Int
pHttpStatus_
  ChangeInfo
pChangeInfo_ =
    DisableHostedZoneDNSSECResponse' :: Int -> ChangeInfo -> DisableHostedZoneDNSSECResponse
DisableHostedZoneDNSSECResponse'
      { $sel:httpStatus:DisableHostedZoneDNSSECResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:changeInfo:DisableHostedZoneDNSSECResponse' :: ChangeInfo
changeInfo = ChangeInfo
pChangeInfo_
      }

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

-- | Undocumented member.
disableHostedZoneDNSSECResponse_changeInfo :: Lens.Lens' DisableHostedZoneDNSSECResponse ChangeInfo
disableHostedZoneDNSSECResponse_changeInfo :: (ChangeInfo -> f ChangeInfo)
-> DisableHostedZoneDNSSECResponse
-> f DisableHostedZoneDNSSECResponse
disableHostedZoneDNSSECResponse_changeInfo = (DisableHostedZoneDNSSECResponse -> ChangeInfo)
-> (DisableHostedZoneDNSSECResponse
    -> ChangeInfo -> DisableHostedZoneDNSSECResponse)
-> Lens
     DisableHostedZoneDNSSECResponse
     DisableHostedZoneDNSSECResponse
     ChangeInfo
     ChangeInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableHostedZoneDNSSECResponse' {ChangeInfo
changeInfo :: ChangeInfo
$sel:changeInfo:DisableHostedZoneDNSSECResponse' :: DisableHostedZoneDNSSECResponse -> ChangeInfo
changeInfo} -> ChangeInfo
changeInfo) (\s :: DisableHostedZoneDNSSECResponse
s@DisableHostedZoneDNSSECResponse' {} ChangeInfo
a -> DisableHostedZoneDNSSECResponse
s {$sel:changeInfo:DisableHostedZoneDNSSECResponse' :: ChangeInfo
changeInfo = ChangeInfo
a} :: DisableHostedZoneDNSSECResponse)

instance
  Prelude.NFData
    DisableHostedZoneDNSSECResponse