{-# 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.SNS.DeletePlatformApplication
-- 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 platform application object for one of the supported push
-- notification services, such as APNS and GCM (Firebase Cloud Messaging).
-- For more information, see
-- <https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html Using Amazon SNS Mobile Push Notifications>.
module Amazonka.SNS.DeletePlatformApplication
  ( -- * Creating a Request
    DeletePlatformApplication (..),
    newDeletePlatformApplication,

    -- * Request Lenses
    deletePlatformApplication_platformApplicationArn,

    -- * Destructuring the Response
    DeletePlatformApplicationResponse (..),
    newDeletePlatformApplicationResponse,
  )
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.SNS.Types

-- | Input for DeletePlatformApplication action.
--
-- /See:/ 'newDeletePlatformApplication' smart constructor.
data DeletePlatformApplication = DeletePlatformApplication'
  { -- | PlatformApplicationArn of platform application object to delete.
    DeletePlatformApplication -> Text
platformApplicationArn :: Prelude.Text
  }
  deriving (DeletePlatformApplication -> DeletePlatformApplication -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePlatformApplication -> DeletePlatformApplication -> Bool
$c/= :: DeletePlatformApplication -> DeletePlatformApplication -> Bool
== :: DeletePlatformApplication -> DeletePlatformApplication -> Bool
$c== :: DeletePlatformApplication -> DeletePlatformApplication -> Bool
Prelude.Eq, ReadPrec [DeletePlatformApplication]
ReadPrec DeletePlatformApplication
Int -> ReadS DeletePlatformApplication
ReadS [DeletePlatformApplication]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePlatformApplication]
$creadListPrec :: ReadPrec [DeletePlatformApplication]
readPrec :: ReadPrec DeletePlatformApplication
$creadPrec :: ReadPrec DeletePlatformApplication
readList :: ReadS [DeletePlatformApplication]
$creadList :: ReadS [DeletePlatformApplication]
readsPrec :: Int -> ReadS DeletePlatformApplication
$creadsPrec :: Int -> ReadS DeletePlatformApplication
Prelude.Read, Int -> DeletePlatformApplication -> ShowS
[DeletePlatformApplication] -> ShowS
DeletePlatformApplication -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePlatformApplication] -> ShowS
$cshowList :: [DeletePlatformApplication] -> ShowS
show :: DeletePlatformApplication -> String
$cshow :: DeletePlatformApplication -> String
showsPrec :: Int -> DeletePlatformApplication -> ShowS
$cshowsPrec :: Int -> DeletePlatformApplication -> ShowS
Prelude.Show, forall x.
Rep DeletePlatformApplication x -> DeletePlatformApplication
forall x.
DeletePlatformApplication -> Rep DeletePlatformApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePlatformApplication x -> DeletePlatformApplication
$cfrom :: forall x.
DeletePlatformApplication -> Rep DeletePlatformApplication x
Prelude.Generic)

-- |
-- Create a value of 'DeletePlatformApplication' 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:
--
-- 'platformApplicationArn', 'deletePlatformApplication_platformApplicationArn' - PlatformApplicationArn of platform application object to delete.
newDeletePlatformApplication ::
  -- | 'platformApplicationArn'
  Prelude.Text ->
  DeletePlatformApplication
newDeletePlatformApplication :: Text -> DeletePlatformApplication
newDeletePlatformApplication Text
pPlatformApplicationArn_ =
  DeletePlatformApplication'
    { $sel:platformApplicationArn:DeletePlatformApplication' :: Text
platformApplicationArn =
        Text
pPlatformApplicationArn_
    }

-- | PlatformApplicationArn of platform application object to delete.
deletePlatformApplication_platformApplicationArn :: Lens.Lens' DeletePlatformApplication Prelude.Text
deletePlatformApplication_platformApplicationArn :: Lens' DeletePlatformApplication Text
deletePlatformApplication_platformApplicationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePlatformApplication' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:DeletePlatformApplication' :: DeletePlatformApplication -> Text
platformApplicationArn} -> Text
platformApplicationArn) (\s :: DeletePlatformApplication
s@DeletePlatformApplication' {} Text
a -> DeletePlatformApplication
s {$sel:platformApplicationArn:DeletePlatformApplication' :: Text
platformApplicationArn = Text
a} :: DeletePlatformApplication)

instance Core.AWSRequest DeletePlatformApplication where
  type
    AWSResponse DeletePlatformApplication =
      DeletePlatformApplicationResponse
  request :: (Service -> Service)
-> DeletePlatformApplication -> Request DeletePlatformApplication
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeletePlatformApplication
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeletePlatformApplication)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeletePlatformApplicationResponse
DeletePlatformApplicationResponse'

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

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

instance Data.ToHeaders DeletePlatformApplication where
  toHeaders :: DeletePlatformApplication -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery DeletePlatformApplication where
  toQuery :: DeletePlatformApplication -> QueryString
toQuery DeletePlatformApplication' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:DeletePlatformApplication' :: DeletePlatformApplication -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeletePlatformApplication" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
        ByteString
"PlatformApplicationArn"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
platformApplicationArn
      ]

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

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

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