{-# 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.SageMaker.DeleteFeatureGroup
-- 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)
--
-- Delete the @FeatureGroup@ and any data that was written to the
-- @OnlineStore@ of the @FeatureGroup@. Data cannot be accessed from the
-- @OnlineStore@ immediately after @DeleteFeatureGroup@ is called.
--
-- Data written into the @OfflineStore@ will not be deleted. The Amazon Web
-- Services Glue database and tables that are automatically created for
-- your @OfflineStore@ are not deleted.
module Amazonka.SageMaker.DeleteFeatureGroup
  ( -- * Creating a Request
    DeleteFeatureGroup (..),
    newDeleteFeatureGroup,

    -- * Request Lenses
    deleteFeatureGroup_featureGroupName,

    -- * Destructuring the Response
    DeleteFeatureGroupResponse (..),
    newDeleteFeatureGroupResponse,
  )
where

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

-- | /See:/ 'newDeleteFeatureGroup' smart constructor.
data DeleteFeatureGroup = DeleteFeatureGroup'
  { -- | The name of the @FeatureGroup@ you want to delete. The name must be
    -- unique within an Amazon Web Services Region in an Amazon Web Services
    -- account.
    DeleteFeatureGroup -> Text
featureGroupName :: Prelude.Text
  }
  deriving (DeleteFeatureGroup -> DeleteFeatureGroup -> Bool
(DeleteFeatureGroup -> DeleteFeatureGroup -> Bool)
-> (DeleteFeatureGroup -> DeleteFeatureGroup -> Bool)
-> Eq DeleteFeatureGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFeatureGroup -> DeleteFeatureGroup -> Bool
$c/= :: DeleteFeatureGroup -> DeleteFeatureGroup -> Bool
== :: DeleteFeatureGroup -> DeleteFeatureGroup -> Bool
$c== :: DeleteFeatureGroup -> DeleteFeatureGroup -> Bool
Prelude.Eq, ReadPrec [DeleteFeatureGroup]
ReadPrec DeleteFeatureGroup
Int -> ReadS DeleteFeatureGroup
ReadS [DeleteFeatureGroup]
(Int -> ReadS DeleteFeatureGroup)
-> ReadS [DeleteFeatureGroup]
-> ReadPrec DeleteFeatureGroup
-> ReadPrec [DeleteFeatureGroup]
-> Read DeleteFeatureGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFeatureGroup]
$creadListPrec :: ReadPrec [DeleteFeatureGroup]
readPrec :: ReadPrec DeleteFeatureGroup
$creadPrec :: ReadPrec DeleteFeatureGroup
readList :: ReadS [DeleteFeatureGroup]
$creadList :: ReadS [DeleteFeatureGroup]
readsPrec :: Int -> ReadS DeleteFeatureGroup
$creadsPrec :: Int -> ReadS DeleteFeatureGroup
Prelude.Read, Int -> DeleteFeatureGroup -> ShowS
[DeleteFeatureGroup] -> ShowS
DeleteFeatureGroup -> String
(Int -> DeleteFeatureGroup -> ShowS)
-> (DeleteFeatureGroup -> String)
-> ([DeleteFeatureGroup] -> ShowS)
-> Show DeleteFeatureGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFeatureGroup] -> ShowS
$cshowList :: [DeleteFeatureGroup] -> ShowS
show :: DeleteFeatureGroup -> String
$cshow :: DeleteFeatureGroup -> String
showsPrec :: Int -> DeleteFeatureGroup -> ShowS
$cshowsPrec :: Int -> DeleteFeatureGroup -> ShowS
Prelude.Show, (forall x. DeleteFeatureGroup -> Rep DeleteFeatureGroup x)
-> (forall x. Rep DeleteFeatureGroup x -> DeleteFeatureGroup)
-> Generic DeleteFeatureGroup
forall x. Rep DeleteFeatureGroup x -> DeleteFeatureGroup
forall x. DeleteFeatureGroup -> Rep DeleteFeatureGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFeatureGroup x -> DeleteFeatureGroup
$cfrom :: forall x. DeleteFeatureGroup -> Rep DeleteFeatureGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFeatureGroup' 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:
--
-- 'featureGroupName', 'deleteFeatureGroup_featureGroupName' - The name of the @FeatureGroup@ you want to delete. The name must be
-- unique within an Amazon Web Services Region in an Amazon Web Services
-- account.
newDeleteFeatureGroup ::
  -- | 'featureGroupName'
  Prelude.Text ->
  DeleteFeatureGroup
newDeleteFeatureGroup :: Text -> DeleteFeatureGroup
newDeleteFeatureGroup Text
pFeatureGroupName_ =
  DeleteFeatureGroup' :: Text -> DeleteFeatureGroup
DeleteFeatureGroup'
    { $sel:featureGroupName:DeleteFeatureGroup' :: Text
featureGroupName =
        Text
pFeatureGroupName_
    }

-- | The name of the @FeatureGroup@ you want to delete. The name must be
-- unique within an Amazon Web Services Region in an Amazon Web Services
-- account.
deleteFeatureGroup_featureGroupName :: Lens.Lens' DeleteFeatureGroup Prelude.Text
deleteFeatureGroup_featureGroupName :: (Text -> f Text) -> DeleteFeatureGroup -> f DeleteFeatureGroup
deleteFeatureGroup_featureGroupName = (DeleteFeatureGroup -> Text)
-> (DeleteFeatureGroup -> Text -> DeleteFeatureGroup)
-> Lens DeleteFeatureGroup DeleteFeatureGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFeatureGroup' {Text
featureGroupName :: Text
$sel:featureGroupName:DeleteFeatureGroup' :: DeleteFeatureGroup -> Text
featureGroupName} -> Text
featureGroupName) (\s :: DeleteFeatureGroup
s@DeleteFeatureGroup' {} Text
a -> DeleteFeatureGroup
s {$sel:featureGroupName:DeleteFeatureGroup' :: Text
featureGroupName = Text
a} :: DeleteFeatureGroup)

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

instance Prelude.Hashable DeleteFeatureGroup

instance Prelude.NFData DeleteFeatureGroup

instance Core.ToHeaders DeleteFeatureGroup where
  toHeaders :: DeleteFeatureGroup -> [Header]
toHeaders =
    [Header] -> DeleteFeatureGroup -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"SageMaker.DeleteFeatureGroup" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DeleteFeatureGroup where
  toJSON :: DeleteFeatureGroup -> Value
toJSON DeleteFeatureGroup' {Text
featureGroupName :: Text
$sel:featureGroupName:DeleteFeatureGroup' :: DeleteFeatureGroup -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"FeatureGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
featureGroupName)
          ]
      )

instance Core.ToPath DeleteFeatureGroup where
  toPath :: DeleteFeatureGroup -> ByteString
toPath = ByteString -> DeleteFeatureGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

instance Prelude.NFData DeleteFeatureGroupResponse