{-# 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.Route53RecoveryControlConfig.DeleteRoutingControl
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a routing control.
module Amazonka.Route53RecoveryControlConfig.DeleteRoutingControl
  ( -- * Creating a Request
    DeleteRoutingControl (..),
    newDeleteRoutingControl,

    -- * Request Lenses
    deleteRoutingControl_routingControlArn,

    -- * Destructuring the Response
    DeleteRoutingControlResponse (..),
    newDeleteRoutingControlResponse,

    -- * Response Lenses
    deleteRoutingControlResponse_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.Route53RecoveryControlConfig.Types

-- | /See:/ 'newDeleteRoutingControl' smart constructor.
data DeleteRoutingControl = DeleteRoutingControl'
  { -- | The Amazon Resource Name (ARN) of the routing control that you\'re
    -- deleting.
    DeleteRoutingControl -> Text
routingControlArn :: Prelude.Text
  }
  deriving (DeleteRoutingControl -> DeleteRoutingControl -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRoutingControl -> DeleteRoutingControl -> Bool
$c/= :: DeleteRoutingControl -> DeleteRoutingControl -> Bool
== :: DeleteRoutingControl -> DeleteRoutingControl -> Bool
$c== :: DeleteRoutingControl -> DeleteRoutingControl -> Bool
Prelude.Eq, ReadPrec [DeleteRoutingControl]
ReadPrec DeleteRoutingControl
Int -> ReadS DeleteRoutingControl
ReadS [DeleteRoutingControl]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRoutingControl]
$creadListPrec :: ReadPrec [DeleteRoutingControl]
readPrec :: ReadPrec DeleteRoutingControl
$creadPrec :: ReadPrec DeleteRoutingControl
readList :: ReadS [DeleteRoutingControl]
$creadList :: ReadS [DeleteRoutingControl]
readsPrec :: Int -> ReadS DeleteRoutingControl
$creadsPrec :: Int -> ReadS DeleteRoutingControl
Prelude.Read, Int -> DeleteRoutingControl -> ShowS
[DeleteRoutingControl] -> ShowS
DeleteRoutingControl -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRoutingControl] -> ShowS
$cshowList :: [DeleteRoutingControl] -> ShowS
show :: DeleteRoutingControl -> String
$cshow :: DeleteRoutingControl -> String
showsPrec :: Int -> DeleteRoutingControl -> ShowS
$cshowsPrec :: Int -> DeleteRoutingControl -> ShowS
Prelude.Show, forall x. Rep DeleteRoutingControl x -> DeleteRoutingControl
forall x. DeleteRoutingControl -> Rep DeleteRoutingControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRoutingControl x -> DeleteRoutingControl
$cfrom :: forall x. DeleteRoutingControl -> Rep DeleteRoutingControl x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRoutingControl' 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:
--
-- 'routingControlArn', 'deleteRoutingControl_routingControlArn' - The Amazon Resource Name (ARN) of the routing control that you\'re
-- deleting.
newDeleteRoutingControl ::
  -- | 'routingControlArn'
  Prelude.Text ->
  DeleteRoutingControl
newDeleteRoutingControl :: Text -> DeleteRoutingControl
newDeleteRoutingControl Text
pRoutingControlArn_ =
  DeleteRoutingControl'
    { $sel:routingControlArn:DeleteRoutingControl' :: Text
routingControlArn =
        Text
pRoutingControlArn_
    }

-- | The Amazon Resource Name (ARN) of the routing control that you\'re
-- deleting.
deleteRoutingControl_routingControlArn :: Lens.Lens' DeleteRoutingControl Prelude.Text
deleteRoutingControl_routingControlArn :: Lens' DeleteRoutingControl Text
deleteRoutingControl_routingControlArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRoutingControl' {Text
routingControlArn :: Text
$sel:routingControlArn:DeleteRoutingControl' :: DeleteRoutingControl -> Text
routingControlArn} -> Text
routingControlArn) (\s :: DeleteRoutingControl
s@DeleteRoutingControl' {} Text
a -> DeleteRoutingControl
s {$sel:routingControlArn:DeleteRoutingControl' :: Text
routingControlArn = Text
a} :: DeleteRoutingControl)

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

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

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

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

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

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

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

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