{-# 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.Omics.DeleteAnnotationStore
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes an annotation store.
module Amazonka.Omics.DeleteAnnotationStore
  ( -- * Creating a Request
    DeleteAnnotationStore (..),
    newDeleteAnnotationStore,

    -- * Request Lenses
    deleteAnnotationStore_force,
    deleteAnnotationStore_name,

    -- * Destructuring the Response
    DeleteAnnotationStoreResponse (..),
    newDeleteAnnotationStoreResponse,

    -- * Response Lenses
    deleteAnnotationStoreResponse_httpStatus,
    deleteAnnotationStoreResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Omics.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteAnnotationStore' smart constructor.
data DeleteAnnotationStore = DeleteAnnotationStore'
  { -- | Whether to force deletion.
    DeleteAnnotationStore -> Maybe Bool
force :: Prelude.Maybe Prelude.Bool,
    -- | The store\'s name.
    DeleteAnnotationStore -> Text
name :: Prelude.Text
  }
  deriving (DeleteAnnotationStore -> DeleteAnnotationStore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAnnotationStore -> DeleteAnnotationStore -> Bool
$c/= :: DeleteAnnotationStore -> DeleteAnnotationStore -> Bool
== :: DeleteAnnotationStore -> DeleteAnnotationStore -> Bool
$c== :: DeleteAnnotationStore -> DeleteAnnotationStore -> Bool
Prelude.Eq, ReadPrec [DeleteAnnotationStore]
ReadPrec DeleteAnnotationStore
Int -> ReadS DeleteAnnotationStore
ReadS [DeleteAnnotationStore]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAnnotationStore]
$creadListPrec :: ReadPrec [DeleteAnnotationStore]
readPrec :: ReadPrec DeleteAnnotationStore
$creadPrec :: ReadPrec DeleteAnnotationStore
readList :: ReadS [DeleteAnnotationStore]
$creadList :: ReadS [DeleteAnnotationStore]
readsPrec :: Int -> ReadS DeleteAnnotationStore
$creadsPrec :: Int -> ReadS DeleteAnnotationStore
Prelude.Read, Int -> DeleteAnnotationStore -> ShowS
[DeleteAnnotationStore] -> ShowS
DeleteAnnotationStore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAnnotationStore] -> ShowS
$cshowList :: [DeleteAnnotationStore] -> ShowS
show :: DeleteAnnotationStore -> String
$cshow :: DeleteAnnotationStore -> String
showsPrec :: Int -> DeleteAnnotationStore -> ShowS
$cshowsPrec :: Int -> DeleteAnnotationStore -> ShowS
Prelude.Show, forall x. Rep DeleteAnnotationStore x -> DeleteAnnotationStore
forall x. DeleteAnnotationStore -> Rep DeleteAnnotationStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAnnotationStore x -> DeleteAnnotationStore
$cfrom :: forall x. DeleteAnnotationStore -> Rep DeleteAnnotationStore x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAnnotationStore' 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:
--
-- 'force', 'deleteAnnotationStore_force' - Whether to force deletion.
--
-- 'name', 'deleteAnnotationStore_name' - The store\'s name.
newDeleteAnnotationStore ::
  -- | 'name'
  Prelude.Text ->
  DeleteAnnotationStore
newDeleteAnnotationStore :: Text -> DeleteAnnotationStore
newDeleteAnnotationStore Text
pName_ =
  DeleteAnnotationStore'
    { $sel:force:DeleteAnnotationStore' :: Maybe Bool
force = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DeleteAnnotationStore' :: Text
name = Text
pName_
    }

-- | Whether to force deletion.
deleteAnnotationStore_force :: Lens.Lens' DeleteAnnotationStore (Prelude.Maybe Prelude.Bool)
deleteAnnotationStore_force :: Lens' DeleteAnnotationStore (Maybe Bool)
deleteAnnotationStore_force = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnnotationStore' {Maybe Bool
force :: Maybe Bool
$sel:force:DeleteAnnotationStore' :: DeleteAnnotationStore -> Maybe Bool
force} -> Maybe Bool
force) (\s :: DeleteAnnotationStore
s@DeleteAnnotationStore' {} Maybe Bool
a -> DeleteAnnotationStore
s {$sel:force:DeleteAnnotationStore' :: Maybe Bool
force = Maybe Bool
a} :: DeleteAnnotationStore)

-- | The store\'s name.
deleteAnnotationStore_name :: Lens.Lens' DeleteAnnotationStore Prelude.Text
deleteAnnotationStore_name :: Lens' DeleteAnnotationStore Text
deleteAnnotationStore_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnnotationStore' {Text
name :: Text
$sel:name:DeleteAnnotationStore' :: DeleteAnnotationStore -> Text
name} -> Text
name) (\s :: DeleteAnnotationStore
s@DeleteAnnotationStore' {} Text
a -> DeleteAnnotationStore
s {$sel:name:DeleteAnnotationStore' :: Text
name = Text
a} :: DeleteAnnotationStore)

instance Core.AWSRequest DeleteAnnotationStore where
  type
    AWSResponse DeleteAnnotationStore =
      DeleteAnnotationStoreResponse
  request :: (Service -> Service)
-> DeleteAnnotationStore -> Request DeleteAnnotationStore
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteAnnotationStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAnnotationStore)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> StoreStatus -> DeleteAnnotationStoreResponse
DeleteAnnotationStoreResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"status")
      )

instance Prelude.Hashable DeleteAnnotationStore where
  hashWithSalt :: Int -> DeleteAnnotationStore -> Int
hashWithSalt Int
_salt DeleteAnnotationStore' {Maybe Bool
Text
name :: Text
force :: Maybe Bool
$sel:name:DeleteAnnotationStore' :: DeleteAnnotationStore -> Text
$sel:force:DeleteAnnotationStore' :: DeleteAnnotationStore -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
force
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData DeleteAnnotationStore where
  rnf :: DeleteAnnotationStore -> ()
rnf DeleteAnnotationStore' {Maybe Bool
Text
name :: Text
force :: Maybe Bool
$sel:name:DeleteAnnotationStore' :: DeleteAnnotationStore -> Text
$sel:force:DeleteAnnotationStore' :: DeleteAnnotationStore -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
force seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

instance Data.ToPath DeleteAnnotationStore where
  toPath :: DeleteAnnotationStore -> ByteString
toPath DeleteAnnotationStore' {Maybe Bool
Text
name :: Text
force :: Maybe Bool
$sel:name:DeleteAnnotationStore' :: DeleteAnnotationStore -> Text
$sel:force:DeleteAnnotationStore' :: DeleteAnnotationStore -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/annotationStore/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]

instance Data.ToQuery DeleteAnnotationStore where
  toQuery :: DeleteAnnotationStore -> QueryString
toQuery DeleteAnnotationStore' {Maybe Bool
Text
name :: Text
force :: Maybe Bool
$sel:name:DeleteAnnotationStore' :: DeleteAnnotationStore -> Text
$sel:force:DeleteAnnotationStore' :: DeleteAnnotationStore -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"force" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
force]

-- | /See:/ 'newDeleteAnnotationStoreResponse' smart constructor.
data DeleteAnnotationStoreResponse = DeleteAnnotationStoreResponse'
  { -- | The response's http status code.
    DeleteAnnotationStoreResponse -> Int
httpStatus :: Prelude.Int,
    -- | The store\'s status.
    DeleteAnnotationStoreResponse -> StoreStatus
status :: StoreStatus
  }
  deriving (DeleteAnnotationStoreResponse
-> DeleteAnnotationStoreResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAnnotationStoreResponse
-> DeleteAnnotationStoreResponse -> Bool
$c/= :: DeleteAnnotationStoreResponse
-> DeleteAnnotationStoreResponse -> Bool
== :: DeleteAnnotationStoreResponse
-> DeleteAnnotationStoreResponse -> Bool
$c== :: DeleteAnnotationStoreResponse
-> DeleteAnnotationStoreResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAnnotationStoreResponse]
ReadPrec DeleteAnnotationStoreResponse
Int -> ReadS DeleteAnnotationStoreResponse
ReadS [DeleteAnnotationStoreResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAnnotationStoreResponse]
$creadListPrec :: ReadPrec [DeleteAnnotationStoreResponse]
readPrec :: ReadPrec DeleteAnnotationStoreResponse
$creadPrec :: ReadPrec DeleteAnnotationStoreResponse
readList :: ReadS [DeleteAnnotationStoreResponse]
$creadList :: ReadS [DeleteAnnotationStoreResponse]
readsPrec :: Int -> ReadS DeleteAnnotationStoreResponse
$creadsPrec :: Int -> ReadS DeleteAnnotationStoreResponse
Prelude.Read, Int -> DeleteAnnotationStoreResponse -> ShowS
[DeleteAnnotationStoreResponse] -> ShowS
DeleteAnnotationStoreResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAnnotationStoreResponse] -> ShowS
$cshowList :: [DeleteAnnotationStoreResponse] -> ShowS
show :: DeleteAnnotationStoreResponse -> String
$cshow :: DeleteAnnotationStoreResponse -> String
showsPrec :: Int -> DeleteAnnotationStoreResponse -> ShowS
$cshowsPrec :: Int -> DeleteAnnotationStoreResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteAnnotationStoreResponse x
-> DeleteAnnotationStoreResponse
forall x.
DeleteAnnotationStoreResponse
-> Rep DeleteAnnotationStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAnnotationStoreResponse x
-> DeleteAnnotationStoreResponse
$cfrom :: forall x.
DeleteAnnotationStoreResponse
-> Rep DeleteAnnotationStoreResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAnnotationStoreResponse' 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:
--
-- 'httpStatus', 'deleteAnnotationStoreResponse_httpStatus' - The response's http status code.
--
-- 'status', 'deleteAnnotationStoreResponse_status' - The store\'s status.
newDeleteAnnotationStoreResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'status'
  StoreStatus ->
  DeleteAnnotationStoreResponse
newDeleteAnnotationStoreResponse :: Int -> StoreStatus -> DeleteAnnotationStoreResponse
newDeleteAnnotationStoreResponse
  Int
pHttpStatus_
  StoreStatus
pStatus_ =
    DeleteAnnotationStoreResponse'
      { $sel:httpStatus:DeleteAnnotationStoreResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:status:DeleteAnnotationStoreResponse' :: StoreStatus
status = StoreStatus
pStatus_
      }

-- | The response's http status code.
deleteAnnotationStoreResponse_httpStatus :: Lens.Lens' DeleteAnnotationStoreResponse Prelude.Int
deleteAnnotationStoreResponse_httpStatus :: Lens' DeleteAnnotationStoreResponse Int
deleteAnnotationStoreResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnnotationStoreResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAnnotationStoreResponse' :: DeleteAnnotationStoreResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAnnotationStoreResponse
s@DeleteAnnotationStoreResponse' {} Int
a -> DeleteAnnotationStoreResponse
s {$sel:httpStatus:DeleteAnnotationStoreResponse' :: Int
httpStatus = Int
a} :: DeleteAnnotationStoreResponse)

-- | The store\'s status.
deleteAnnotationStoreResponse_status :: Lens.Lens' DeleteAnnotationStoreResponse StoreStatus
deleteAnnotationStoreResponse_status :: Lens' DeleteAnnotationStoreResponse StoreStatus
deleteAnnotationStoreResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnnotationStoreResponse' {StoreStatus
status :: StoreStatus
$sel:status:DeleteAnnotationStoreResponse' :: DeleteAnnotationStoreResponse -> StoreStatus
status} -> StoreStatus
status) (\s :: DeleteAnnotationStoreResponse
s@DeleteAnnotationStoreResponse' {} StoreStatus
a -> DeleteAnnotationStoreResponse
s {$sel:status:DeleteAnnotationStoreResponse' :: StoreStatus
status = StoreStatus
a} :: DeleteAnnotationStoreResponse)

instance Prelude.NFData DeleteAnnotationStoreResponse where
  rnf :: DeleteAnnotationStoreResponse -> ()
rnf DeleteAnnotationStoreResponse' {Int
StoreStatus
status :: StoreStatus
httpStatus :: Int
$sel:status:DeleteAnnotationStoreResponse' :: DeleteAnnotationStoreResponse -> StoreStatus
$sel:httpStatus:DeleteAnnotationStoreResponse' :: DeleteAnnotationStoreResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StoreStatus
status