{-# 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.DeleteVariantStore
-- 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 a variant store.
module Amazonka.Omics.DeleteVariantStore
  ( -- * Creating a Request
    DeleteVariantStore (..),
    newDeleteVariantStore,

    -- * Request Lenses
    deleteVariantStore_force,
    deleteVariantStore_name,

    -- * Destructuring the Response
    DeleteVariantStoreResponse (..),
    newDeleteVariantStoreResponse,

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

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

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

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

instance Core.AWSRequest DeleteVariantStore where
  type
    AWSResponse DeleteVariantStore =
      DeleteVariantStoreResponse
  request :: (Service -> Service)
-> DeleteVariantStore -> Request DeleteVariantStore
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 DeleteVariantStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteVariantStore)))
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 -> DeleteVariantStoreResponse
DeleteVariantStoreResponse'
            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 DeleteVariantStore where
  hashWithSalt :: Int -> DeleteVariantStore -> Int
hashWithSalt Int
_salt DeleteVariantStore' {Maybe Bool
Text
name :: Text
force :: Maybe Bool
$sel:name:DeleteVariantStore' :: DeleteVariantStore -> Text
$sel:force:DeleteVariantStore' :: DeleteVariantStore -> 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 DeleteVariantStore where
  rnf :: DeleteVariantStore -> ()
rnf DeleteVariantStore' {Maybe Bool
Text
name :: Text
force :: Maybe Bool
$sel:name:DeleteVariantStore' :: DeleteVariantStore -> Text
$sel:force:DeleteVariantStore' :: DeleteVariantStore -> 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 DeleteVariantStore where
  toHeaders :: DeleteVariantStore -> 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 DeleteVariantStore where
  toPath :: DeleteVariantStore -> ByteString
toPath DeleteVariantStore' {Maybe Bool
Text
name :: Text
force :: Maybe Bool
$sel:name:DeleteVariantStore' :: DeleteVariantStore -> Text
$sel:force:DeleteVariantStore' :: DeleteVariantStore -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/variantStore/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]

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

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

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

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

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

instance Prelude.NFData DeleteVariantStoreResponse where
  rnf :: DeleteVariantStoreResponse -> ()
rnf DeleteVariantStoreResponse' {Int
StoreStatus
status :: StoreStatus
httpStatus :: Int
$sel:status:DeleteVariantStoreResponse' :: DeleteVariantStoreResponse -> StoreStatus
$sel:httpStatus:DeleteVariantStoreResponse' :: DeleteVariantStoreResponse -> 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