{-# 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.Schemas.DeleteRegistry
-- 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 Registry.
module Amazonka.Schemas.DeleteRegistry
  ( -- * Creating a Request
    DeleteRegistry (..),
    newDeleteRegistry,

    -- * Request Lenses
    deleteRegistry_registryName,

    -- * Destructuring the Response
    DeleteRegistryResponse (..),
    newDeleteRegistryResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteRegistry' 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:
--
-- 'registryName', 'deleteRegistry_registryName' - The name of the registry.
newDeleteRegistry ::
  -- | 'registryName'
  Prelude.Text ->
  DeleteRegistry
newDeleteRegistry :: Text -> DeleteRegistry
newDeleteRegistry Text
pRegistryName_ =
  DeleteRegistry' {$sel:registryName:DeleteRegistry' :: Text
registryName = Text
pRegistryName_}

-- | The name of the registry.
deleteRegistry_registryName :: Lens.Lens' DeleteRegistry Prelude.Text
deleteRegistry_registryName :: Lens' DeleteRegistry Text
deleteRegistry_registryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRegistry' {Text
registryName :: Text
$sel:registryName:DeleteRegistry' :: DeleteRegistry -> Text
registryName} -> Text
registryName) (\s :: DeleteRegistry
s@DeleteRegistry' {} Text
a -> DeleteRegistry
s {$sel:registryName:DeleteRegistry' :: Text
registryName = Text
a} :: DeleteRegistry)

instance Core.AWSRequest DeleteRegistry where
  type
    AWSResponse DeleteRegistry =
      DeleteRegistryResponse
  request :: (Service -> Service) -> DeleteRegistry -> Request DeleteRegistry
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 DeleteRegistry
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRegistry)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteRegistryResponse
DeleteRegistryResponse'

instance Prelude.Hashable DeleteRegistry where
  hashWithSalt :: Int -> DeleteRegistry -> Int
hashWithSalt Int
_salt DeleteRegistry' {Text
registryName :: Text
$sel:registryName:DeleteRegistry' :: DeleteRegistry -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
registryName

instance Prelude.NFData DeleteRegistry where
  rnf :: DeleteRegistry -> ()
rnf DeleteRegistry' {Text
registryName :: Text
$sel:registryName:DeleteRegistry' :: DeleteRegistry -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
registryName

instance Data.ToHeaders DeleteRegistry where
  toHeaders :: DeleteRegistry -> [Header]
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 -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeleteRegistry where
  toPath :: DeleteRegistry -> ByteString
toPath DeleteRegistry' {Text
registryName :: Text
$sel:registryName:DeleteRegistry' :: DeleteRegistry -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/registries/name/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
registryName]

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

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

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

instance Prelude.NFData DeleteRegistryResponse where
  rnf :: DeleteRegistryResponse -> ()
rnf DeleteRegistryResponse
_ = ()