{-# 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.CloudFront.DeleteFieldLevelEncryptionProfile
-- 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)
--
-- Remove a field-level encryption profile.
module Amazonka.CloudFront.DeleteFieldLevelEncryptionProfile
  ( -- * Creating a Request
    DeleteFieldLevelEncryptionProfile (..),
    newDeleteFieldLevelEncryptionProfile,

    -- * Request Lenses
    deleteFieldLevelEncryptionProfile_ifMatch,
    deleteFieldLevelEncryptionProfile_id,

    -- * Destructuring the Response
    DeleteFieldLevelEncryptionProfileResponse (..),
    newDeleteFieldLevelEncryptionProfileResponse,
  )
where

import Amazonka.CloudFront.Types
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

-- | /See:/ 'newDeleteFieldLevelEncryptionProfile' smart constructor.
data DeleteFieldLevelEncryptionProfile = DeleteFieldLevelEncryptionProfile'
  { -- | The value of the @ETag@ header that you received when retrieving the
    -- profile to delete. For example: @E2QWRUHAPOMQZL@.
    DeleteFieldLevelEncryptionProfile -> Maybe Text
ifMatch :: Prelude.Maybe Prelude.Text,
    -- | Request the ID of the profile you want to delete from CloudFront.
    DeleteFieldLevelEncryptionProfile -> Text
id :: Prelude.Text
  }
  deriving (DeleteFieldLevelEncryptionProfile
-> DeleteFieldLevelEncryptionProfile -> Bool
(DeleteFieldLevelEncryptionProfile
 -> DeleteFieldLevelEncryptionProfile -> Bool)
-> (DeleteFieldLevelEncryptionProfile
    -> DeleteFieldLevelEncryptionProfile -> Bool)
-> Eq DeleteFieldLevelEncryptionProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFieldLevelEncryptionProfile
-> DeleteFieldLevelEncryptionProfile -> Bool
$c/= :: DeleteFieldLevelEncryptionProfile
-> DeleteFieldLevelEncryptionProfile -> Bool
== :: DeleteFieldLevelEncryptionProfile
-> DeleteFieldLevelEncryptionProfile -> Bool
$c== :: DeleteFieldLevelEncryptionProfile
-> DeleteFieldLevelEncryptionProfile -> Bool
Prelude.Eq, ReadPrec [DeleteFieldLevelEncryptionProfile]
ReadPrec DeleteFieldLevelEncryptionProfile
Int -> ReadS DeleteFieldLevelEncryptionProfile
ReadS [DeleteFieldLevelEncryptionProfile]
(Int -> ReadS DeleteFieldLevelEncryptionProfile)
-> ReadS [DeleteFieldLevelEncryptionProfile]
-> ReadPrec DeleteFieldLevelEncryptionProfile
-> ReadPrec [DeleteFieldLevelEncryptionProfile]
-> Read DeleteFieldLevelEncryptionProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFieldLevelEncryptionProfile]
$creadListPrec :: ReadPrec [DeleteFieldLevelEncryptionProfile]
readPrec :: ReadPrec DeleteFieldLevelEncryptionProfile
$creadPrec :: ReadPrec DeleteFieldLevelEncryptionProfile
readList :: ReadS [DeleteFieldLevelEncryptionProfile]
$creadList :: ReadS [DeleteFieldLevelEncryptionProfile]
readsPrec :: Int -> ReadS DeleteFieldLevelEncryptionProfile
$creadsPrec :: Int -> ReadS DeleteFieldLevelEncryptionProfile
Prelude.Read, Int -> DeleteFieldLevelEncryptionProfile -> ShowS
[DeleteFieldLevelEncryptionProfile] -> ShowS
DeleteFieldLevelEncryptionProfile -> String
(Int -> DeleteFieldLevelEncryptionProfile -> ShowS)
-> (DeleteFieldLevelEncryptionProfile -> String)
-> ([DeleteFieldLevelEncryptionProfile] -> ShowS)
-> Show DeleteFieldLevelEncryptionProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFieldLevelEncryptionProfile] -> ShowS
$cshowList :: [DeleteFieldLevelEncryptionProfile] -> ShowS
show :: DeleteFieldLevelEncryptionProfile -> String
$cshow :: DeleteFieldLevelEncryptionProfile -> String
showsPrec :: Int -> DeleteFieldLevelEncryptionProfile -> ShowS
$cshowsPrec :: Int -> DeleteFieldLevelEncryptionProfile -> ShowS
Prelude.Show, (forall x.
 DeleteFieldLevelEncryptionProfile
 -> Rep DeleteFieldLevelEncryptionProfile x)
-> (forall x.
    Rep DeleteFieldLevelEncryptionProfile x
    -> DeleteFieldLevelEncryptionProfile)
-> Generic DeleteFieldLevelEncryptionProfile
forall x.
Rep DeleteFieldLevelEncryptionProfile x
-> DeleteFieldLevelEncryptionProfile
forall x.
DeleteFieldLevelEncryptionProfile
-> Rep DeleteFieldLevelEncryptionProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFieldLevelEncryptionProfile x
-> DeleteFieldLevelEncryptionProfile
$cfrom :: forall x.
DeleteFieldLevelEncryptionProfile
-> Rep DeleteFieldLevelEncryptionProfile x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFieldLevelEncryptionProfile' 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:
--
-- 'ifMatch', 'deleteFieldLevelEncryptionProfile_ifMatch' - The value of the @ETag@ header that you received when retrieving the
-- profile to delete. For example: @E2QWRUHAPOMQZL@.
--
-- 'id', 'deleteFieldLevelEncryptionProfile_id' - Request the ID of the profile you want to delete from CloudFront.
newDeleteFieldLevelEncryptionProfile ::
  -- | 'id'
  Prelude.Text ->
  DeleteFieldLevelEncryptionProfile
newDeleteFieldLevelEncryptionProfile :: Text -> DeleteFieldLevelEncryptionProfile
newDeleteFieldLevelEncryptionProfile Text
pId_ =
  DeleteFieldLevelEncryptionProfile' :: Maybe Text -> Text -> DeleteFieldLevelEncryptionProfile
DeleteFieldLevelEncryptionProfile'
    { $sel:ifMatch:DeleteFieldLevelEncryptionProfile' :: Maybe Text
ifMatch =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:DeleteFieldLevelEncryptionProfile' :: Text
id = Text
pId_
    }

-- | The value of the @ETag@ header that you received when retrieving the
-- profile to delete. For example: @E2QWRUHAPOMQZL@.
deleteFieldLevelEncryptionProfile_ifMatch :: Lens.Lens' DeleteFieldLevelEncryptionProfile (Prelude.Maybe Prelude.Text)
deleteFieldLevelEncryptionProfile_ifMatch :: (Maybe Text -> f (Maybe Text))
-> DeleteFieldLevelEncryptionProfile
-> f DeleteFieldLevelEncryptionProfile
deleteFieldLevelEncryptionProfile_ifMatch = (DeleteFieldLevelEncryptionProfile -> Maybe Text)
-> (DeleteFieldLevelEncryptionProfile
    -> Maybe Text -> DeleteFieldLevelEncryptionProfile)
-> Lens
     DeleteFieldLevelEncryptionProfile
     DeleteFieldLevelEncryptionProfile
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFieldLevelEncryptionProfile' {Maybe Text
ifMatch :: Maybe Text
$sel:ifMatch:DeleteFieldLevelEncryptionProfile' :: DeleteFieldLevelEncryptionProfile -> Maybe Text
ifMatch} -> Maybe Text
ifMatch) (\s :: DeleteFieldLevelEncryptionProfile
s@DeleteFieldLevelEncryptionProfile' {} Maybe Text
a -> DeleteFieldLevelEncryptionProfile
s {$sel:ifMatch:DeleteFieldLevelEncryptionProfile' :: Maybe Text
ifMatch = Maybe Text
a} :: DeleteFieldLevelEncryptionProfile)

-- | Request the ID of the profile you want to delete from CloudFront.
deleteFieldLevelEncryptionProfile_id :: Lens.Lens' DeleteFieldLevelEncryptionProfile Prelude.Text
deleteFieldLevelEncryptionProfile_id :: (Text -> f Text)
-> DeleteFieldLevelEncryptionProfile
-> f DeleteFieldLevelEncryptionProfile
deleteFieldLevelEncryptionProfile_id = (DeleteFieldLevelEncryptionProfile -> Text)
-> (DeleteFieldLevelEncryptionProfile
    -> Text -> DeleteFieldLevelEncryptionProfile)
-> Lens
     DeleteFieldLevelEncryptionProfile
     DeleteFieldLevelEncryptionProfile
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFieldLevelEncryptionProfile' {Text
id :: Text
$sel:id:DeleteFieldLevelEncryptionProfile' :: DeleteFieldLevelEncryptionProfile -> Text
id} -> Text
id) (\s :: DeleteFieldLevelEncryptionProfile
s@DeleteFieldLevelEncryptionProfile' {} Text
a -> DeleteFieldLevelEncryptionProfile
s {$sel:id:DeleteFieldLevelEncryptionProfile' :: Text
id = Text
a} :: DeleteFieldLevelEncryptionProfile)

instance
  Core.AWSRequest
    DeleteFieldLevelEncryptionProfile
  where
  type
    AWSResponse DeleteFieldLevelEncryptionProfile =
      DeleteFieldLevelEncryptionProfileResponse
  request :: DeleteFieldLevelEncryptionProfile
-> Request DeleteFieldLevelEncryptionProfile
request = Service
-> DeleteFieldLevelEncryptionProfile
-> Request DeleteFieldLevelEncryptionProfile
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteFieldLevelEncryptionProfile
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteFieldLevelEncryptionProfile)))
response =
    AWSResponse DeleteFieldLevelEncryptionProfile
-> Logger
-> Service
-> Proxy DeleteFieldLevelEncryptionProfile
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteFieldLevelEncryptionProfile)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteFieldLevelEncryptionProfile
DeleteFieldLevelEncryptionProfileResponse
DeleteFieldLevelEncryptionProfileResponse'

instance
  Prelude.Hashable
    DeleteFieldLevelEncryptionProfile

instance
  Prelude.NFData
    DeleteFieldLevelEncryptionProfile

instance
  Core.ToHeaders
    DeleteFieldLevelEncryptionProfile
  where
  toHeaders :: DeleteFieldLevelEncryptionProfile -> [Header]
toHeaders DeleteFieldLevelEncryptionProfile' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteFieldLevelEncryptionProfile' :: DeleteFieldLevelEncryptionProfile -> Text
$sel:ifMatch:DeleteFieldLevelEncryptionProfile' :: DeleteFieldLevelEncryptionProfile -> Maybe Text
..} =
    [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat [HeaderName
"If-Match" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
ifMatch]

instance
  Core.ToPath
    DeleteFieldLevelEncryptionProfile
  where
  toPath :: DeleteFieldLevelEncryptionProfile -> ByteString
toPath DeleteFieldLevelEncryptionProfile' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteFieldLevelEncryptionProfile' :: DeleteFieldLevelEncryptionProfile -> Text
$sel:ifMatch:DeleteFieldLevelEncryptionProfile' :: DeleteFieldLevelEncryptionProfile -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-05-31/field-level-encryption-profile/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id
      ]

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

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

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

instance
  Prelude.NFData
    DeleteFieldLevelEncryptionProfileResponse