{-# 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.Chime.DeleteSipRule
-- 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)
--
-- Deletes a SIP rule. You must disable a SIP rule before you can delete
-- it.
module Amazonka.Chime.DeleteSipRule
  ( -- * Creating a Request
    DeleteSipRule (..),
    newDeleteSipRule,

    -- * Request Lenses
    deleteSipRule_sipRuleId,

    -- * Destructuring the Response
    DeleteSipRuleResponse (..),
    newDeleteSipRuleResponse,
  )
where

import Amazonka.Chime.Types
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

-- | /See:/ 'newDeleteSipRule' smart constructor.
data DeleteSipRule = DeleteSipRule'
  { -- | The SIP rule ID.
    DeleteSipRule -> Text
sipRuleId :: Prelude.Text
  }
  deriving (DeleteSipRule -> DeleteSipRule -> Bool
(DeleteSipRule -> DeleteSipRule -> Bool)
-> (DeleteSipRule -> DeleteSipRule -> Bool) -> Eq DeleteSipRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSipRule -> DeleteSipRule -> Bool
$c/= :: DeleteSipRule -> DeleteSipRule -> Bool
== :: DeleteSipRule -> DeleteSipRule -> Bool
$c== :: DeleteSipRule -> DeleteSipRule -> Bool
Prelude.Eq, ReadPrec [DeleteSipRule]
ReadPrec DeleteSipRule
Int -> ReadS DeleteSipRule
ReadS [DeleteSipRule]
(Int -> ReadS DeleteSipRule)
-> ReadS [DeleteSipRule]
-> ReadPrec DeleteSipRule
-> ReadPrec [DeleteSipRule]
-> Read DeleteSipRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSipRule]
$creadListPrec :: ReadPrec [DeleteSipRule]
readPrec :: ReadPrec DeleteSipRule
$creadPrec :: ReadPrec DeleteSipRule
readList :: ReadS [DeleteSipRule]
$creadList :: ReadS [DeleteSipRule]
readsPrec :: Int -> ReadS DeleteSipRule
$creadsPrec :: Int -> ReadS DeleteSipRule
Prelude.Read, Int -> DeleteSipRule -> ShowS
[DeleteSipRule] -> ShowS
DeleteSipRule -> String
(Int -> DeleteSipRule -> ShowS)
-> (DeleteSipRule -> String)
-> ([DeleteSipRule] -> ShowS)
-> Show DeleteSipRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSipRule] -> ShowS
$cshowList :: [DeleteSipRule] -> ShowS
show :: DeleteSipRule -> String
$cshow :: DeleteSipRule -> String
showsPrec :: Int -> DeleteSipRule -> ShowS
$cshowsPrec :: Int -> DeleteSipRule -> ShowS
Prelude.Show, (forall x. DeleteSipRule -> Rep DeleteSipRule x)
-> (forall x. Rep DeleteSipRule x -> DeleteSipRule)
-> Generic DeleteSipRule
forall x. Rep DeleteSipRule x -> DeleteSipRule
forall x. DeleteSipRule -> Rep DeleteSipRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSipRule x -> DeleteSipRule
$cfrom :: forall x. DeleteSipRule -> Rep DeleteSipRule x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSipRule' 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:
--
-- 'sipRuleId', 'deleteSipRule_sipRuleId' - The SIP rule ID.
newDeleteSipRule ::
  -- | 'sipRuleId'
  Prelude.Text ->
  DeleteSipRule
newDeleteSipRule :: Text -> DeleteSipRule
newDeleteSipRule Text
pSipRuleId_ =
  DeleteSipRule' :: Text -> DeleteSipRule
DeleteSipRule' {$sel:sipRuleId:DeleteSipRule' :: Text
sipRuleId = Text
pSipRuleId_}

-- | The SIP rule ID.
deleteSipRule_sipRuleId :: Lens.Lens' DeleteSipRule Prelude.Text
deleteSipRule_sipRuleId :: (Text -> f Text) -> DeleteSipRule -> f DeleteSipRule
deleteSipRule_sipRuleId = (DeleteSipRule -> Text)
-> (DeleteSipRule -> Text -> DeleteSipRule)
-> Lens DeleteSipRule DeleteSipRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSipRule' {Text
sipRuleId :: Text
$sel:sipRuleId:DeleteSipRule' :: DeleteSipRule -> Text
sipRuleId} -> Text
sipRuleId) (\s :: DeleteSipRule
s@DeleteSipRule' {} Text
a -> DeleteSipRule
s {$sel:sipRuleId:DeleteSipRule' :: Text
sipRuleId = Text
a} :: DeleteSipRule)

instance Core.AWSRequest DeleteSipRule where
  type
    AWSResponse DeleteSipRule =
      DeleteSipRuleResponse
  request :: DeleteSipRule -> Request DeleteSipRule
request = Service -> DeleteSipRule -> Request DeleteSipRule
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteSipRule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSipRule)))
response =
    AWSResponse DeleteSipRule
-> Logger
-> Service
-> Proxy DeleteSipRule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSipRule)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteSipRule
DeleteSipRuleResponse
DeleteSipRuleResponse'

instance Prelude.Hashable DeleteSipRule

instance Prelude.NFData DeleteSipRule

instance Core.ToHeaders DeleteSipRule where
  toHeaders :: DeleteSipRule -> [Header]
toHeaders = [Header] -> DeleteSipRule -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DeleteSipRule where
  toPath :: DeleteSipRule -> ByteString
toPath DeleteSipRule' {Text
sipRuleId :: Text
$sel:sipRuleId:DeleteSipRule' :: DeleteSipRule -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/sip-rules/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
sipRuleId]

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

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

-- |
-- Create a value of 'DeleteSipRuleResponse' 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.
newDeleteSipRuleResponse ::
  DeleteSipRuleResponse
newDeleteSipRuleResponse :: DeleteSipRuleResponse
newDeleteSipRuleResponse = DeleteSipRuleResponse
DeleteSipRuleResponse'

instance Prelude.NFData DeleteSipRuleResponse