{-# 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 #-}
module Amazonka.Pinpoint.DeleteJourney
(
DeleteJourney (..),
newDeleteJourney,
deleteJourney_journeyId,
deleteJourney_applicationId,
DeleteJourneyResponse (..),
newDeleteJourneyResponse,
deleteJourneyResponse_httpStatus,
deleteJourneyResponse_journeyResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteJourney = DeleteJourney'
{
DeleteJourney -> Text
journeyId :: Prelude.Text,
DeleteJourney -> Text
applicationId :: Prelude.Text
}
deriving (DeleteJourney -> DeleteJourney -> Bool
(DeleteJourney -> DeleteJourney -> Bool)
-> (DeleteJourney -> DeleteJourney -> Bool) -> Eq DeleteJourney
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteJourney -> DeleteJourney -> Bool
$c/= :: DeleteJourney -> DeleteJourney -> Bool
== :: DeleteJourney -> DeleteJourney -> Bool
$c== :: DeleteJourney -> DeleteJourney -> Bool
Prelude.Eq, ReadPrec [DeleteJourney]
ReadPrec DeleteJourney
Int -> ReadS DeleteJourney
ReadS [DeleteJourney]
(Int -> ReadS DeleteJourney)
-> ReadS [DeleteJourney]
-> ReadPrec DeleteJourney
-> ReadPrec [DeleteJourney]
-> Read DeleteJourney
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteJourney]
$creadListPrec :: ReadPrec [DeleteJourney]
readPrec :: ReadPrec DeleteJourney
$creadPrec :: ReadPrec DeleteJourney
readList :: ReadS [DeleteJourney]
$creadList :: ReadS [DeleteJourney]
readsPrec :: Int -> ReadS DeleteJourney
$creadsPrec :: Int -> ReadS DeleteJourney
Prelude.Read, Int -> DeleteJourney -> ShowS
[DeleteJourney] -> ShowS
DeleteJourney -> String
(Int -> DeleteJourney -> ShowS)
-> (DeleteJourney -> String)
-> ([DeleteJourney] -> ShowS)
-> Show DeleteJourney
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteJourney] -> ShowS
$cshowList :: [DeleteJourney] -> ShowS
show :: DeleteJourney -> String
$cshow :: DeleteJourney -> String
showsPrec :: Int -> DeleteJourney -> ShowS
$cshowsPrec :: Int -> DeleteJourney -> ShowS
Prelude.Show, (forall x. DeleteJourney -> Rep DeleteJourney x)
-> (forall x. Rep DeleteJourney x -> DeleteJourney)
-> Generic DeleteJourney
forall x. Rep DeleteJourney x -> DeleteJourney
forall x. DeleteJourney -> Rep DeleteJourney x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteJourney x -> DeleteJourney
$cfrom :: forall x. DeleteJourney -> Rep DeleteJourney x
Prelude.Generic)
newDeleteJourney ::
Prelude.Text ->
Prelude.Text ->
DeleteJourney
newDeleteJourney :: Text -> Text -> DeleteJourney
newDeleteJourney Text
pJourneyId_ Text
pApplicationId_ =
DeleteJourney' :: Text -> Text -> DeleteJourney
DeleteJourney'
{ $sel:journeyId:DeleteJourney' :: Text
journeyId = Text
pJourneyId_,
$sel:applicationId:DeleteJourney' :: Text
applicationId = Text
pApplicationId_
}
deleteJourney_journeyId :: Lens.Lens' DeleteJourney Prelude.Text
deleteJourney_journeyId :: (Text -> f Text) -> DeleteJourney -> f DeleteJourney
deleteJourney_journeyId = (DeleteJourney -> Text)
-> (DeleteJourney -> Text -> DeleteJourney)
-> Lens DeleteJourney DeleteJourney Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJourney' {Text
journeyId :: Text
$sel:journeyId:DeleteJourney' :: DeleteJourney -> Text
journeyId} -> Text
journeyId) (\s :: DeleteJourney
s@DeleteJourney' {} Text
a -> DeleteJourney
s {$sel:journeyId:DeleteJourney' :: Text
journeyId = Text
a} :: DeleteJourney)
deleteJourney_applicationId :: Lens.Lens' DeleteJourney Prelude.Text
deleteJourney_applicationId :: (Text -> f Text) -> DeleteJourney -> f DeleteJourney
deleteJourney_applicationId = (DeleteJourney -> Text)
-> (DeleteJourney -> Text -> DeleteJourney)
-> Lens DeleteJourney DeleteJourney Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJourney' {Text
applicationId :: Text
$sel:applicationId:DeleteJourney' :: DeleteJourney -> Text
applicationId} -> Text
applicationId) (\s :: DeleteJourney
s@DeleteJourney' {} Text
a -> DeleteJourney
s {$sel:applicationId:DeleteJourney' :: Text
applicationId = Text
a} :: DeleteJourney)
instance Core.AWSRequest DeleteJourney where
type
AWSResponse DeleteJourney =
DeleteJourneyResponse
request :: DeleteJourney -> Request DeleteJourney
request = Service -> DeleteJourney -> Request DeleteJourney
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteJourney
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteJourney)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteJourney))
-> Logger
-> Service
-> Proxy DeleteJourney
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteJourney)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> JourneyResponse -> DeleteJourneyResponse
DeleteJourneyResponse'
(Int -> JourneyResponse -> DeleteJourneyResponse)
-> Either String Int
-> Either String (JourneyResponse -> DeleteJourneyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (JourneyResponse -> DeleteJourneyResponse)
-> Either String JourneyResponse
-> Either String DeleteJourneyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String JourneyResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable DeleteJourney
instance Prelude.NFData DeleteJourney
instance Core.ToHeaders DeleteJourney where
toHeaders :: DeleteJourney -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteJourney -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteJourney where
toPath :: DeleteJourney -> ByteString
toPath DeleteJourney' {Text
applicationId :: Text
journeyId :: Text
$sel:applicationId:DeleteJourney' :: DeleteJourney -> Text
$sel:journeyId:DeleteJourney' :: DeleteJourney -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apps/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
ByteString
"/journeys/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
journeyId
]
instance Core.ToQuery DeleteJourney where
toQuery :: DeleteJourney -> QueryString
toQuery = QueryString -> DeleteJourney -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteJourneyResponse = DeleteJourneyResponse'
{
DeleteJourneyResponse -> Int
httpStatus :: Prelude.Int,
DeleteJourneyResponse -> JourneyResponse
journeyResponse :: JourneyResponse
}
deriving (DeleteJourneyResponse -> DeleteJourneyResponse -> Bool
(DeleteJourneyResponse -> DeleteJourneyResponse -> Bool)
-> (DeleteJourneyResponse -> DeleteJourneyResponse -> Bool)
-> Eq DeleteJourneyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteJourneyResponse -> DeleteJourneyResponse -> Bool
$c/= :: DeleteJourneyResponse -> DeleteJourneyResponse -> Bool
== :: DeleteJourneyResponse -> DeleteJourneyResponse -> Bool
$c== :: DeleteJourneyResponse -> DeleteJourneyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteJourneyResponse]
ReadPrec DeleteJourneyResponse
Int -> ReadS DeleteJourneyResponse
ReadS [DeleteJourneyResponse]
(Int -> ReadS DeleteJourneyResponse)
-> ReadS [DeleteJourneyResponse]
-> ReadPrec DeleteJourneyResponse
-> ReadPrec [DeleteJourneyResponse]
-> Read DeleteJourneyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteJourneyResponse]
$creadListPrec :: ReadPrec [DeleteJourneyResponse]
readPrec :: ReadPrec DeleteJourneyResponse
$creadPrec :: ReadPrec DeleteJourneyResponse
readList :: ReadS [DeleteJourneyResponse]
$creadList :: ReadS [DeleteJourneyResponse]
readsPrec :: Int -> ReadS DeleteJourneyResponse
$creadsPrec :: Int -> ReadS DeleteJourneyResponse
Prelude.Read, Int -> DeleteJourneyResponse -> ShowS
[DeleteJourneyResponse] -> ShowS
DeleteJourneyResponse -> String
(Int -> DeleteJourneyResponse -> ShowS)
-> (DeleteJourneyResponse -> String)
-> ([DeleteJourneyResponse] -> ShowS)
-> Show DeleteJourneyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteJourneyResponse] -> ShowS
$cshowList :: [DeleteJourneyResponse] -> ShowS
show :: DeleteJourneyResponse -> String
$cshow :: DeleteJourneyResponse -> String
showsPrec :: Int -> DeleteJourneyResponse -> ShowS
$cshowsPrec :: Int -> DeleteJourneyResponse -> ShowS
Prelude.Show, (forall x. DeleteJourneyResponse -> Rep DeleteJourneyResponse x)
-> (forall x. Rep DeleteJourneyResponse x -> DeleteJourneyResponse)
-> Generic DeleteJourneyResponse
forall x. Rep DeleteJourneyResponse x -> DeleteJourneyResponse
forall x. DeleteJourneyResponse -> Rep DeleteJourneyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteJourneyResponse x -> DeleteJourneyResponse
$cfrom :: forall x. DeleteJourneyResponse -> Rep DeleteJourneyResponse x
Prelude.Generic)
newDeleteJourneyResponse ::
Prelude.Int ->
JourneyResponse ->
DeleteJourneyResponse
newDeleteJourneyResponse :: Int -> JourneyResponse -> DeleteJourneyResponse
newDeleteJourneyResponse
Int
pHttpStatus_
JourneyResponse
pJourneyResponse_ =
DeleteJourneyResponse' :: Int -> JourneyResponse -> DeleteJourneyResponse
DeleteJourneyResponse'
{ $sel:httpStatus:DeleteJourneyResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:journeyResponse:DeleteJourneyResponse' :: JourneyResponse
journeyResponse = JourneyResponse
pJourneyResponse_
}
deleteJourneyResponse_httpStatus :: Lens.Lens' DeleteJourneyResponse Prelude.Int
deleteJourneyResponse_httpStatus :: (Int -> f Int) -> DeleteJourneyResponse -> f DeleteJourneyResponse
deleteJourneyResponse_httpStatus = (DeleteJourneyResponse -> Int)
-> (DeleteJourneyResponse -> Int -> DeleteJourneyResponse)
-> Lens DeleteJourneyResponse DeleteJourneyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJourneyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteJourneyResponse' :: DeleteJourneyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteJourneyResponse
s@DeleteJourneyResponse' {} Int
a -> DeleteJourneyResponse
s {$sel:httpStatus:DeleteJourneyResponse' :: Int
httpStatus = Int
a} :: DeleteJourneyResponse)
deleteJourneyResponse_journeyResponse :: Lens.Lens' DeleteJourneyResponse JourneyResponse
deleteJourneyResponse_journeyResponse :: (JourneyResponse -> f JourneyResponse)
-> DeleteJourneyResponse -> f DeleteJourneyResponse
deleteJourneyResponse_journeyResponse = (DeleteJourneyResponse -> JourneyResponse)
-> (DeleteJourneyResponse
-> JourneyResponse -> DeleteJourneyResponse)
-> Lens
DeleteJourneyResponse
DeleteJourneyResponse
JourneyResponse
JourneyResponse
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJourneyResponse' {JourneyResponse
journeyResponse :: JourneyResponse
$sel:journeyResponse:DeleteJourneyResponse' :: DeleteJourneyResponse -> JourneyResponse
journeyResponse} -> JourneyResponse
journeyResponse) (\s :: DeleteJourneyResponse
s@DeleteJourneyResponse' {} JourneyResponse
a -> DeleteJourneyResponse
s {$sel:journeyResponse:DeleteJourneyResponse' :: JourneyResponse
journeyResponse = JourneyResponse
a} :: DeleteJourneyResponse)
instance Prelude.NFData DeleteJourneyResponse