{-# 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.WorkMail.DeleteEmailMonitoringConfiguration
-- 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 email monitoring configuration for a specified organization.
module Amazonka.WorkMail.DeleteEmailMonitoringConfiguration
  ( -- * Creating a Request
    DeleteEmailMonitoringConfiguration (..),
    newDeleteEmailMonitoringConfiguration,

    -- * Request Lenses
    deleteEmailMonitoringConfiguration_organizationId,

    -- * Destructuring the Response
    DeleteEmailMonitoringConfigurationResponse (..),
    newDeleteEmailMonitoringConfigurationResponse,

    -- * Response Lenses
    deleteEmailMonitoringConfigurationResponse_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.WorkMail.Types

-- | /See:/ 'newDeleteEmailMonitoringConfiguration' smart constructor.
data DeleteEmailMonitoringConfiguration = DeleteEmailMonitoringConfiguration'
  { -- | The ID of the organization from which the email monitoring configuration
    -- is deleted.
    DeleteEmailMonitoringConfiguration -> Text
organizationId :: Prelude.Text
  }
  deriving (DeleteEmailMonitoringConfiguration
-> DeleteEmailMonitoringConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEmailMonitoringConfiguration
-> DeleteEmailMonitoringConfiguration -> Bool
$c/= :: DeleteEmailMonitoringConfiguration
-> DeleteEmailMonitoringConfiguration -> Bool
== :: DeleteEmailMonitoringConfiguration
-> DeleteEmailMonitoringConfiguration -> Bool
$c== :: DeleteEmailMonitoringConfiguration
-> DeleteEmailMonitoringConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteEmailMonitoringConfiguration]
ReadPrec DeleteEmailMonitoringConfiguration
Int -> ReadS DeleteEmailMonitoringConfiguration
ReadS [DeleteEmailMonitoringConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEmailMonitoringConfiguration]
$creadListPrec :: ReadPrec [DeleteEmailMonitoringConfiguration]
readPrec :: ReadPrec DeleteEmailMonitoringConfiguration
$creadPrec :: ReadPrec DeleteEmailMonitoringConfiguration
readList :: ReadS [DeleteEmailMonitoringConfiguration]
$creadList :: ReadS [DeleteEmailMonitoringConfiguration]
readsPrec :: Int -> ReadS DeleteEmailMonitoringConfiguration
$creadsPrec :: Int -> ReadS DeleteEmailMonitoringConfiguration
Prelude.Read, Int -> DeleteEmailMonitoringConfiguration -> ShowS
[DeleteEmailMonitoringConfiguration] -> ShowS
DeleteEmailMonitoringConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEmailMonitoringConfiguration] -> ShowS
$cshowList :: [DeleteEmailMonitoringConfiguration] -> ShowS
show :: DeleteEmailMonitoringConfiguration -> String
$cshow :: DeleteEmailMonitoringConfiguration -> String
showsPrec :: Int -> DeleteEmailMonitoringConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteEmailMonitoringConfiguration -> ShowS
Prelude.Show, forall x.
Rep DeleteEmailMonitoringConfiguration x
-> DeleteEmailMonitoringConfiguration
forall x.
DeleteEmailMonitoringConfiguration
-> Rep DeleteEmailMonitoringConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteEmailMonitoringConfiguration x
-> DeleteEmailMonitoringConfiguration
$cfrom :: forall x.
DeleteEmailMonitoringConfiguration
-> Rep DeleteEmailMonitoringConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteEmailMonitoringConfiguration' 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:
--
-- 'organizationId', 'deleteEmailMonitoringConfiguration_organizationId' - The ID of the organization from which the email monitoring configuration
-- is deleted.
newDeleteEmailMonitoringConfiguration ::
  -- | 'organizationId'
  Prelude.Text ->
  DeleteEmailMonitoringConfiguration
newDeleteEmailMonitoringConfiguration :: Text -> DeleteEmailMonitoringConfiguration
newDeleteEmailMonitoringConfiguration
  Text
pOrganizationId_ =
    DeleteEmailMonitoringConfiguration'
      { $sel:organizationId:DeleteEmailMonitoringConfiguration' :: Text
organizationId =
          Text
pOrganizationId_
      }

-- | The ID of the organization from which the email monitoring configuration
-- is deleted.
deleteEmailMonitoringConfiguration_organizationId :: Lens.Lens' DeleteEmailMonitoringConfiguration Prelude.Text
deleteEmailMonitoringConfiguration_organizationId :: Lens' DeleteEmailMonitoringConfiguration Text
deleteEmailMonitoringConfiguration_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEmailMonitoringConfiguration' {Text
organizationId :: Text
$sel:organizationId:DeleteEmailMonitoringConfiguration' :: DeleteEmailMonitoringConfiguration -> Text
organizationId} -> Text
organizationId) (\s :: DeleteEmailMonitoringConfiguration
s@DeleteEmailMonitoringConfiguration' {} Text
a -> DeleteEmailMonitoringConfiguration
s {$sel:organizationId:DeleteEmailMonitoringConfiguration' :: Text
organizationId = Text
a} :: DeleteEmailMonitoringConfiguration)

instance
  Core.AWSRequest
    DeleteEmailMonitoringConfiguration
  where
  type
    AWSResponse DeleteEmailMonitoringConfiguration =
      DeleteEmailMonitoringConfigurationResponse
  request :: (Service -> Service)
-> DeleteEmailMonitoringConfiguration
-> Request DeleteEmailMonitoringConfiguration
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 DeleteEmailMonitoringConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteEmailMonitoringConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteEmailMonitoringConfigurationResponse
DeleteEmailMonitoringConfigurationResponse'
            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))
      )

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

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

instance
  Data.ToHeaders
    DeleteEmailMonitoringConfiguration
  where
  toHeaders :: DeleteEmailMonitoringConfiguration -> 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
"WorkMailService.DeleteEmailMonitoringConfiguration" ::
                          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
    DeleteEmailMonitoringConfiguration
  where
  toJSON :: DeleteEmailMonitoringConfiguration -> Value
toJSON DeleteEmailMonitoringConfiguration' {Text
organizationId :: Text
$sel:organizationId:DeleteEmailMonitoringConfiguration' :: DeleteEmailMonitoringConfiguration -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId)
          ]
      )

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

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

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

-- |
-- Create a value of 'DeleteEmailMonitoringConfigurationResponse' 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', 'deleteEmailMonitoringConfigurationResponse_httpStatus' - The response's http status code.
newDeleteEmailMonitoringConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteEmailMonitoringConfigurationResponse
newDeleteEmailMonitoringConfigurationResponse :: Int -> DeleteEmailMonitoringConfigurationResponse
newDeleteEmailMonitoringConfigurationResponse
  Int
pHttpStatus_ =
    DeleteEmailMonitoringConfigurationResponse'
      { $sel:httpStatus:DeleteEmailMonitoringConfigurationResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

instance
  Prelude.NFData
    DeleteEmailMonitoringConfigurationResponse
  where
  rnf :: DeleteEmailMonitoringConfigurationResponse -> ()
rnf DeleteEmailMonitoringConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteEmailMonitoringConfigurationResponse' :: DeleteEmailMonitoringConfigurationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus