{-# 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.StorageGateway.DeleteAutomaticTapeCreationPolicy
-- 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 the automatic tape creation policy of a gateway. If you delete
-- this policy, new virtual tapes must be created manually. Use the Amazon
-- Resource Name (ARN) of the gateway in your request to remove the policy.
module Amazonka.StorageGateway.DeleteAutomaticTapeCreationPolicy
  ( -- * Creating a Request
    DeleteAutomaticTapeCreationPolicy (..),
    newDeleteAutomaticTapeCreationPolicy,

    -- * Request Lenses
    deleteAutomaticTapeCreationPolicy_gatewayARN,

    -- * Destructuring the Response
    DeleteAutomaticTapeCreationPolicyResponse (..),
    newDeleteAutomaticTapeCreationPolicyResponse,

    -- * Response Lenses
    deleteAutomaticTapeCreationPolicyResponse_gatewayARN,
    deleteAutomaticTapeCreationPolicyResponse_httpStatus,
  )
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.StorageGateway.Types

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

-- |
-- Create a value of 'DeleteAutomaticTapeCreationPolicy' 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:
--
-- 'gatewayARN', 'deleteAutomaticTapeCreationPolicy_gatewayARN' - Undocumented member.
newDeleteAutomaticTapeCreationPolicy ::
  -- | 'gatewayARN'
  Prelude.Text ->
  DeleteAutomaticTapeCreationPolicy
newDeleteAutomaticTapeCreationPolicy :: Text -> DeleteAutomaticTapeCreationPolicy
newDeleteAutomaticTapeCreationPolicy Text
pGatewayARN_ =
  DeleteAutomaticTapeCreationPolicy'
    { $sel:gatewayARN:DeleteAutomaticTapeCreationPolicy' :: Text
gatewayARN =
        Text
pGatewayARN_
    }

-- | Undocumented member.
deleteAutomaticTapeCreationPolicy_gatewayARN :: Lens.Lens' DeleteAutomaticTapeCreationPolicy Prelude.Text
deleteAutomaticTapeCreationPolicy_gatewayARN :: Lens' DeleteAutomaticTapeCreationPolicy Text
deleteAutomaticTapeCreationPolicy_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAutomaticTapeCreationPolicy' {Text
gatewayARN :: Text
$sel:gatewayARN:DeleteAutomaticTapeCreationPolicy' :: DeleteAutomaticTapeCreationPolicy -> Text
gatewayARN} -> Text
gatewayARN) (\s :: DeleteAutomaticTapeCreationPolicy
s@DeleteAutomaticTapeCreationPolicy' {} Text
a -> DeleteAutomaticTapeCreationPolicy
s {$sel:gatewayARN:DeleteAutomaticTapeCreationPolicy' :: Text
gatewayARN = Text
a} :: DeleteAutomaticTapeCreationPolicy)

instance
  Core.AWSRequest
    DeleteAutomaticTapeCreationPolicy
  where
  type
    AWSResponse DeleteAutomaticTapeCreationPolicy =
      DeleteAutomaticTapeCreationPolicyResponse
  request :: (Service -> Service)
-> DeleteAutomaticTapeCreationPolicy
-> Request DeleteAutomaticTapeCreationPolicy
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteAutomaticTapeCreationPolicy
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteAutomaticTapeCreationPolicy)))
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 ->
          Maybe Text -> Int -> DeleteAutomaticTapeCreationPolicyResponse
DeleteAutomaticTapeCreationPolicyResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GatewayARN")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

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

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

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

instance
  Data.ToJSON
    DeleteAutomaticTapeCreationPolicy
  where
  toJSON :: DeleteAutomaticTapeCreationPolicy -> Value
toJSON DeleteAutomaticTapeCreationPolicy' {Text
gatewayARN :: Text
$sel:gatewayARN:DeleteAutomaticTapeCreationPolicy' :: DeleteAutomaticTapeCreationPolicy -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"GatewayARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayARN)]
      )

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

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

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

-- |
-- Create a value of 'DeleteAutomaticTapeCreationPolicyResponse' 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:
--
-- 'gatewayARN', 'deleteAutomaticTapeCreationPolicyResponse_gatewayARN' - Undocumented member.
--
-- 'httpStatus', 'deleteAutomaticTapeCreationPolicyResponse_httpStatus' - The response's http status code.
newDeleteAutomaticTapeCreationPolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteAutomaticTapeCreationPolicyResponse
newDeleteAutomaticTapeCreationPolicyResponse :: Int -> DeleteAutomaticTapeCreationPolicyResponse
newDeleteAutomaticTapeCreationPolicyResponse
  Int
pHttpStatus_ =
    DeleteAutomaticTapeCreationPolicyResponse'
      { $sel:gatewayARN:DeleteAutomaticTapeCreationPolicyResponse' :: Maybe Text
gatewayARN =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DeleteAutomaticTapeCreationPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Undocumented member.
deleteAutomaticTapeCreationPolicyResponse_gatewayARN :: Lens.Lens' DeleteAutomaticTapeCreationPolicyResponse (Prelude.Maybe Prelude.Text)
deleteAutomaticTapeCreationPolicyResponse_gatewayARN :: Lens' DeleteAutomaticTapeCreationPolicyResponse (Maybe Text)
deleteAutomaticTapeCreationPolicyResponse_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAutomaticTapeCreationPolicyResponse' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:DeleteAutomaticTapeCreationPolicyResponse' :: DeleteAutomaticTapeCreationPolicyResponse -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: DeleteAutomaticTapeCreationPolicyResponse
s@DeleteAutomaticTapeCreationPolicyResponse' {} Maybe Text
a -> DeleteAutomaticTapeCreationPolicyResponse
s {$sel:gatewayARN:DeleteAutomaticTapeCreationPolicyResponse' :: Maybe Text
gatewayARN = Maybe Text
a} :: DeleteAutomaticTapeCreationPolicyResponse)

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

instance
  Prelude.NFData
    DeleteAutomaticTapeCreationPolicyResponse
  where
  rnf :: DeleteAutomaticTapeCreationPolicyResponse -> ()
rnf DeleteAutomaticTapeCreationPolicyResponse' {Int
Maybe Text
httpStatus :: Int
gatewayARN :: Maybe Text
$sel:httpStatus:DeleteAutomaticTapeCreationPolicyResponse' :: DeleteAutomaticTapeCreationPolicyResponse -> Int
$sel:gatewayARN:DeleteAutomaticTapeCreationPolicyResponse' :: DeleteAutomaticTapeCreationPolicyResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus