{-# 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-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 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.Lens as Lens
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
(DeleteRegistry -> DeleteRegistry -> Bool)
-> (DeleteRegistry -> DeleteRegistry -> Bool) -> Eq DeleteRegistry
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]
(Int -> ReadS DeleteRegistry)
-> ReadS [DeleteRegistry]
-> ReadPrec DeleteRegistry
-> ReadPrec [DeleteRegistry]
-> Read 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
(Int -> DeleteRegistry -> ShowS)
-> (DeleteRegistry -> String)
-> ([DeleteRegistry] -> ShowS)
-> Show DeleteRegistry
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. DeleteRegistry -> Rep DeleteRegistry x)
-> (forall x. Rep DeleteRegistry x -> DeleteRegistry)
-> Generic DeleteRegistry
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' :: Text -> DeleteRegistry
DeleteRegistry' {$sel:registryName:DeleteRegistry' :: Text
registryName = Text
pRegistryName_}

-- | The name of the registry.
deleteRegistry_registryName :: Lens.Lens' DeleteRegistry Prelude.Text
deleteRegistry_registryName :: (Text -> f Text) -> DeleteRegistry -> f DeleteRegistry
deleteRegistry_registryName = (DeleteRegistry -> Text)
-> (DeleteRegistry -> Text -> DeleteRegistry)
-> Lens DeleteRegistry DeleteRegistry Text Text
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 :: DeleteRegistry -> Request DeleteRegistry
request = Service -> DeleteRegistry -> Request DeleteRegistry
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteRegistry
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRegistry)))
response =
    AWSResponse DeleteRegistry
-> Logger
-> Service
-> Proxy DeleteRegistry
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRegistry)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteRegistry
DeleteRegistryResponse
DeleteRegistryResponse'

instance Prelude.Hashable DeleteRegistry

instance Prelude.NFData DeleteRegistry

instance Core.ToHeaders DeleteRegistry where
  toHeaders :: DeleteRegistry -> [Header]
toHeaders =
    [Header] -> DeleteRegistry -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeleteRegistry where
  toPath :: DeleteRegistry -> ByteString
toPath DeleteRegistry' {Text
registryName :: Text
$sel:registryName:DeleteRegistry' :: DeleteRegistry -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/registries/name/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
registryName]

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

-- | /See:/ 'newDeleteRegistryResponse' smart constructor.
data DeleteRegistryResponse = DeleteRegistryResponse'
  {
  }
  deriving (DeleteRegistryResponse -> DeleteRegistryResponse -> Bool
(DeleteRegistryResponse -> DeleteRegistryResponse -> Bool)
-> (DeleteRegistryResponse -> DeleteRegistryResponse -> Bool)
-> Eq DeleteRegistryResponse
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]
(Int -> ReadS DeleteRegistryResponse)
-> ReadS [DeleteRegistryResponse]
-> ReadPrec DeleteRegistryResponse
-> ReadPrec [DeleteRegistryResponse]
-> Read 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
(Int -> DeleteRegistryResponse -> ShowS)
-> (DeleteRegistryResponse -> String)
-> ([DeleteRegistryResponse] -> ShowS)
-> Show DeleteRegistryResponse
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. DeleteRegistryResponse -> Rep DeleteRegistryResponse x)
-> (forall x.
    Rep DeleteRegistryResponse x -> DeleteRegistryResponse)
-> Generic DeleteRegistryResponse
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