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

-- | PlatformApplicationArn of platform application object to delete.
deletePlatformApplication_platformApplicationArn :: Lens.Lens' DeletePlatformApplication Prelude.Text
deletePlatformApplication_platformApplicationArn :: (Text -> f Text)
-> DeletePlatformApplication -> f DeletePlatformApplication
deletePlatformApplication_platformApplicationArn = (DeletePlatformApplication -> Text)
-> (DeletePlatformApplication -> Text -> DeletePlatformApplication)
-> Lens
     DeletePlatformApplication DeletePlatformApplication Text Text
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 :: DeletePlatformApplication -> Request DeletePlatformApplication
request = Service
-> DeletePlatformApplication -> Request DeletePlatformApplication
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeletePlatformApplication
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeletePlatformApplication)))
response =
    AWSResponse DeletePlatformApplication
-> Logger
-> Service
-> Proxy DeletePlatformApplication
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeletePlatformApplication)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeletePlatformApplication
DeletePlatformApplicationResponse
DeletePlatformApplicationResponse'

instance Prelude.Hashable DeletePlatformApplication

instance Prelude.NFData DeletePlatformApplication

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

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

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

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