{-# 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.DataExchange.DeleteRevision
-- 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)
--
-- This operation deletes a revision.
module Amazonka.DataExchange.DeleteRevision
  ( -- * Creating a Request
    DeleteRevision (..),
    newDeleteRevision,

    -- * Request Lenses
    deleteRevision_revisionId,
    deleteRevision_dataSetId,

    -- * Destructuring the Response
    DeleteRevisionResponse (..),
    newDeleteRevisionResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataExchange.Types
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:/ 'newDeleteRevision' smart constructor.
data DeleteRevision = DeleteRevision'
  { -- | The unique identifier for a revision.
    DeleteRevision -> Text
revisionId :: Prelude.Text,
    -- | The unique identifier for a data set.
    DeleteRevision -> Text
dataSetId :: Prelude.Text
  }
  deriving (DeleteRevision -> DeleteRevision -> Bool
(DeleteRevision -> DeleteRevision -> Bool)
-> (DeleteRevision -> DeleteRevision -> Bool) -> Eq DeleteRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRevision -> DeleteRevision -> Bool
$c/= :: DeleteRevision -> DeleteRevision -> Bool
== :: DeleteRevision -> DeleteRevision -> Bool
$c== :: DeleteRevision -> DeleteRevision -> Bool
Prelude.Eq, ReadPrec [DeleteRevision]
ReadPrec DeleteRevision
Int -> ReadS DeleteRevision
ReadS [DeleteRevision]
(Int -> ReadS DeleteRevision)
-> ReadS [DeleteRevision]
-> ReadPrec DeleteRevision
-> ReadPrec [DeleteRevision]
-> Read DeleteRevision
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRevision]
$creadListPrec :: ReadPrec [DeleteRevision]
readPrec :: ReadPrec DeleteRevision
$creadPrec :: ReadPrec DeleteRevision
readList :: ReadS [DeleteRevision]
$creadList :: ReadS [DeleteRevision]
readsPrec :: Int -> ReadS DeleteRevision
$creadsPrec :: Int -> ReadS DeleteRevision
Prelude.Read, Int -> DeleteRevision -> ShowS
[DeleteRevision] -> ShowS
DeleteRevision -> String
(Int -> DeleteRevision -> ShowS)
-> (DeleteRevision -> String)
-> ([DeleteRevision] -> ShowS)
-> Show DeleteRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRevision] -> ShowS
$cshowList :: [DeleteRevision] -> ShowS
show :: DeleteRevision -> String
$cshow :: DeleteRevision -> String
showsPrec :: Int -> DeleteRevision -> ShowS
$cshowsPrec :: Int -> DeleteRevision -> ShowS
Prelude.Show, (forall x. DeleteRevision -> Rep DeleteRevision x)
-> (forall x. Rep DeleteRevision x -> DeleteRevision)
-> Generic DeleteRevision
forall x. Rep DeleteRevision x -> DeleteRevision
forall x. DeleteRevision -> Rep DeleteRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRevision x -> DeleteRevision
$cfrom :: forall x. DeleteRevision -> Rep DeleteRevision x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRevision' 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:
--
-- 'revisionId', 'deleteRevision_revisionId' - The unique identifier for a revision.
--
-- 'dataSetId', 'deleteRevision_dataSetId' - The unique identifier for a data set.
newDeleteRevision ::
  -- | 'revisionId'
  Prelude.Text ->
  -- | 'dataSetId'
  Prelude.Text ->
  DeleteRevision
newDeleteRevision :: Text -> Text -> DeleteRevision
newDeleteRevision Text
pRevisionId_ Text
pDataSetId_ =
  DeleteRevision' :: Text -> Text -> DeleteRevision
DeleteRevision'
    { $sel:revisionId:DeleteRevision' :: Text
revisionId = Text
pRevisionId_,
      $sel:dataSetId:DeleteRevision' :: Text
dataSetId = Text
pDataSetId_
    }

-- | The unique identifier for a revision.
deleteRevision_revisionId :: Lens.Lens' DeleteRevision Prelude.Text
deleteRevision_revisionId :: (Text -> f Text) -> DeleteRevision -> f DeleteRevision
deleteRevision_revisionId = (DeleteRevision -> Text)
-> (DeleteRevision -> Text -> DeleteRevision)
-> Lens DeleteRevision DeleteRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRevision' {Text
revisionId :: Text
$sel:revisionId:DeleteRevision' :: DeleteRevision -> Text
revisionId} -> Text
revisionId) (\s :: DeleteRevision
s@DeleteRevision' {} Text
a -> DeleteRevision
s {$sel:revisionId:DeleteRevision' :: Text
revisionId = Text
a} :: DeleteRevision)

-- | The unique identifier for a data set.
deleteRevision_dataSetId :: Lens.Lens' DeleteRevision Prelude.Text
deleteRevision_dataSetId :: (Text -> f Text) -> DeleteRevision -> f DeleteRevision
deleteRevision_dataSetId = (DeleteRevision -> Text)
-> (DeleteRevision -> Text -> DeleteRevision)
-> Lens DeleteRevision DeleteRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRevision' {Text
dataSetId :: Text
$sel:dataSetId:DeleteRevision' :: DeleteRevision -> Text
dataSetId} -> Text
dataSetId) (\s :: DeleteRevision
s@DeleteRevision' {} Text
a -> DeleteRevision
s {$sel:dataSetId:DeleteRevision' :: Text
dataSetId = Text
a} :: DeleteRevision)

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

instance Prelude.Hashable DeleteRevision

instance Prelude.NFData DeleteRevision

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

instance Core.ToPath DeleteRevision where
  toPath :: DeleteRevision -> ByteString
toPath DeleteRevision' {Text
dataSetId :: Text
revisionId :: Text
$sel:dataSetId:DeleteRevision' :: DeleteRevision -> Text
$sel:revisionId:DeleteRevision' :: DeleteRevision -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/data-sets/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dataSetId,
        ByteString
"/revisions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
revisionId
      ]

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

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

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

instance Prelude.NFData DeleteRevisionResponse