{-# 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.IoTAnalytics.DeleteDatastore
-- 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 the specified data store.
module Amazonka.IoTAnalytics.DeleteDatastore
  ( -- * Creating a Request
    DeleteDatastore (..),
    newDeleteDatastore,

    -- * Request Lenses
    deleteDatastore_datastoreName,

    -- * Destructuring the Response
    DeleteDatastoreResponse (..),
    newDeleteDatastoreResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.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:/ 'newDeleteDatastore' smart constructor.
data DeleteDatastore = DeleteDatastore'
  { -- | The name of the data store to delete.
    DeleteDatastore -> Text
datastoreName :: Prelude.Text
  }
  deriving (DeleteDatastore -> DeleteDatastore -> Bool
(DeleteDatastore -> DeleteDatastore -> Bool)
-> (DeleteDatastore -> DeleteDatastore -> Bool)
-> Eq DeleteDatastore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDatastore -> DeleteDatastore -> Bool
$c/= :: DeleteDatastore -> DeleteDatastore -> Bool
== :: DeleteDatastore -> DeleteDatastore -> Bool
$c== :: DeleteDatastore -> DeleteDatastore -> Bool
Prelude.Eq, ReadPrec [DeleteDatastore]
ReadPrec DeleteDatastore
Int -> ReadS DeleteDatastore
ReadS [DeleteDatastore]
(Int -> ReadS DeleteDatastore)
-> ReadS [DeleteDatastore]
-> ReadPrec DeleteDatastore
-> ReadPrec [DeleteDatastore]
-> Read DeleteDatastore
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDatastore]
$creadListPrec :: ReadPrec [DeleteDatastore]
readPrec :: ReadPrec DeleteDatastore
$creadPrec :: ReadPrec DeleteDatastore
readList :: ReadS [DeleteDatastore]
$creadList :: ReadS [DeleteDatastore]
readsPrec :: Int -> ReadS DeleteDatastore
$creadsPrec :: Int -> ReadS DeleteDatastore
Prelude.Read, Int -> DeleteDatastore -> ShowS
[DeleteDatastore] -> ShowS
DeleteDatastore -> String
(Int -> DeleteDatastore -> ShowS)
-> (DeleteDatastore -> String)
-> ([DeleteDatastore] -> ShowS)
-> Show DeleteDatastore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDatastore] -> ShowS
$cshowList :: [DeleteDatastore] -> ShowS
show :: DeleteDatastore -> String
$cshow :: DeleteDatastore -> String
showsPrec :: Int -> DeleteDatastore -> ShowS
$cshowsPrec :: Int -> DeleteDatastore -> ShowS
Prelude.Show, (forall x. DeleteDatastore -> Rep DeleteDatastore x)
-> (forall x. Rep DeleteDatastore x -> DeleteDatastore)
-> Generic DeleteDatastore
forall x. Rep DeleteDatastore x -> DeleteDatastore
forall x. DeleteDatastore -> Rep DeleteDatastore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDatastore x -> DeleteDatastore
$cfrom :: forall x. DeleteDatastore -> Rep DeleteDatastore x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDatastore' 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:
--
-- 'datastoreName', 'deleteDatastore_datastoreName' - The name of the data store to delete.
newDeleteDatastore ::
  -- | 'datastoreName'
  Prelude.Text ->
  DeleteDatastore
newDeleteDatastore :: Text -> DeleteDatastore
newDeleteDatastore Text
pDatastoreName_ =
  DeleteDatastore' :: Text -> DeleteDatastore
DeleteDatastore' {$sel:datastoreName:DeleteDatastore' :: Text
datastoreName = Text
pDatastoreName_}

-- | The name of the data store to delete.
deleteDatastore_datastoreName :: Lens.Lens' DeleteDatastore Prelude.Text
deleteDatastore_datastoreName :: (Text -> f Text) -> DeleteDatastore -> f DeleteDatastore
deleteDatastore_datastoreName = (DeleteDatastore -> Text)
-> (DeleteDatastore -> Text -> DeleteDatastore)
-> Lens DeleteDatastore DeleteDatastore Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDatastore' {Text
datastoreName :: Text
$sel:datastoreName:DeleteDatastore' :: DeleteDatastore -> Text
datastoreName} -> Text
datastoreName) (\s :: DeleteDatastore
s@DeleteDatastore' {} Text
a -> DeleteDatastore
s {$sel:datastoreName:DeleteDatastore' :: Text
datastoreName = Text
a} :: DeleteDatastore)

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

instance Prelude.Hashable DeleteDatastore

instance Prelude.NFData DeleteDatastore

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

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

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

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

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

instance Prelude.NFData DeleteDatastoreResponse