{-# 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.DeleteAsset
-- 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 an asset.
module Amazonka.DataExchange.DeleteAsset
  ( -- * Creating a Request
    DeleteAsset (..),
    newDeleteAsset,

    -- * Request Lenses
    deleteAsset_revisionId,
    deleteAsset_assetId,
    deleteAsset_dataSetId,

    -- * Destructuring the Response
    DeleteAssetResponse (..),
    newDeleteAssetResponse,
  )
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:/ 'newDeleteAsset' smart constructor.
data DeleteAsset = DeleteAsset'
  { -- | The unique identifier for a revision.
    DeleteAsset -> Text
revisionId :: Prelude.Text,
    -- | The unique identifier for an asset.
    DeleteAsset -> Text
assetId :: Prelude.Text,
    -- | The unique identifier for a data set.
    DeleteAsset -> Text
dataSetId :: Prelude.Text
  }
  deriving (DeleteAsset -> DeleteAsset -> Bool
(DeleteAsset -> DeleteAsset -> Bool)
-> (DeleteAsset -> DeleteAsset -> Bool) -> Eq DeleteAsset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAsset -> DeleteAsset -> Bool
$c/= :: DeleteAsset -> DeleteAsset -> Bool
== :: DeleteAsset -> DeleteAsset -> Bool
$c== :: DeleteAsset -> DeleteAsset -> Bool
Prelude.Eq, ReadPrec [DeleteAsset]
ReadPrec DeleteAsset
Int -> ReadS DeleteAsset
ReadS [DeleteAsset]
(Int -> ReadS DeleteAsset)
-> ReadS [DeleteAsset]
-> ReadPrec DeleteAsset
-> ReadPrec [DeleteAsset]
-> Read DeleteAsset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAsset]
$creadListPrec :: ReadPrec [DeleteAsset]
readPrec :: ReadPrec DeleteAsset
$creadPrec :: ReadPrec DeleteAsset
readList :: ReadS [DeleteAsset]
$creadList :: ReadS [DeleteAsset]
readsPrec :: Int -> ReadS DeleteAsset
$creadsPrec :: Int -> ReadS DeleteAsset
Prelude.Read, Int -> DeleteAsset -> ShowS
[DeleteAsset] -> ShowS
DeleteAsset -> String
(Int -> DeleteAsset -> ShowS)
-> (DeleteAsset -> String)
-> ([DeleteAsset] -> ShowS)
-> Show DeleteAsset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAsset] -> ShowS
$cshowList :: [DeleteAsset] -> ShowS
show :: DeleteAsset -> String
$cshow :: DeleteAsset -> String
showsPrec :: Int -> DeleteAsset -> ShowS
$cshowsPrec :: Int -> DeleteAsset -> ShowS
Prelude.Show, (forall x. DeleteAsset -> Rep DeleteAsset x)
-> (forall x. Rep DeleteAsset x -> DeleteAsset)
-> Generic DeleteAsset
forall x. Rep DeleteAsset x -> DeleteAsset
forall x. DeleteAsset -> Rep DeleteAsset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAsset x -> DeleteAsset
$cfrom :: forall x. DeleteAsset -> Rep DeleteAsset x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAsset' 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', 'deleteAsset_revisionId' - The unique identifier for a revision.
--
-- 'assetId', 'deleteAsset_assetId' - The unique identifier for an asset.
--
-- 'dataSetId', 'deleteAsset_dataSetId' - The unique identifier for a data set.
newDeleteAsset ::
  -- | 'revisionId'
  Prelude.Text ->
  -- | 'assetId'
  Prelude.Text ->
  -- | 'dataSetId'
  Prelude.Text ->
  DeleteAsset
newDeleteAsset :: Text -> Text -> Text -> DeleteAsset
newDeleteAsset Text
pRevisionId_ Text
pAssetId_ Text
pDataSetId_ =
  DeleteAsset' :: Text -> Text -> Text -> DeleteAsset
DeleteAsset'
    { $sel:revisionId:DeleteAsset' :: Text
revisionId = Text
pRevisionId_,
      $sel:assetId:DeleteAsset' :: Text
assetId = Text
pAssetId_,
      $sel:dataSetId:DeleteAsset' :: Text
dataSetId = Text
pDataSetId_
    }

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

-- | The unique identifier for an asset.
deleteAsset_assetId :: Lens.Lens' DeleteAsset Prelude.Text
deleteAsset_assetId :: (Text -> f Text) -> DeleteAsset -> f DeleteAsset
deleteAsset_assetId = (DeleteAsset -> Text)
-> (DeleteAsset -> Text -> DeleteAsset)
-> Lens DeleteAsset DeleteAsset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAsset' {Text
assetId :: Text
$sel:assetId:DeleteAsset' :: DeleteAsset -> Text
assetId} -> Text
assetId) (\s :: DeleteAsset
s@DeleteAsset' {} Text
a -> DeleteAsset
s {$sel:assetId:DeleteAsset' :: Text
assetId = Text
a} :: DeleteAsset)

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

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

instance Prelude.Hashable DeleteAsset

instance Prelude.NFData DeleteAsset

instance Core.ToHeaders DeleteAsset where
  toHeaders :: DeleteAsset -> [Header]
toHeaders =
    [Header] -> DeleteAsset -> [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 DeleteAsset where
  toPath :: DeleteAsset -> ByteString
toPath DeleteAsset' {Text
dataSetId :: Text
assetId :: Text
revisionId :: Text
$sel:dataSetId:DeleteAsset' :: DeleteAsset -> Text
$sel:assetId:DeleteAsset' :: DeleteAsset -> Text
$sel:revisionId:DeleteAsset' :: DeleteAsset -> 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,
        ByteString
"/assets/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assetId
      ]

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

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

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

instance Prelude.NFData DeleteAssetResponse