{-# 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.DataSync.DeleteLocation
(
DeleteLocation (..),
newDeleteLocation,
deleteLocation_locationArn,
DeleteLocationResponse (..),
newDeleteLocationResponse,
deleteLocationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DataSync.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteLocation = DeleteLocation'
{
DeleteLocation -> Text
locationArn :: Prelude.Text
}
deriving (DeleteLocation -> DeleteLocation -> Bool
(DeleteLocation -> DeleteLocation -> Bool)
-> (DeleteLocation -> DeleteLocation -> Bool) -> Eq DeleteLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLocation -> DeleteLocation -> Bool
$c/= :: DeleteLocation -> DeleteLocation -> Bool
== :: DeleteLocation -> DeleteLocation -> Bool
$c== :: DeleteLocation -> DeleteLocation -> Bool
Prelude.Eq, ReadPrec [DeleteLocation]
ReadPrec DeleteLocation
Int -> ReadS DeleteLocation
ReadS [DeleteLocation]
(Int -> ReadS DeleteLocation)
-> ReadS [DeleteLocation]
-> ReadPrec DeleteLocation
-> ReadPrec [DeleteLocation]
-> Read DeleteLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLocation]
$creadListPrec :: ReadPrec [DeleteLocation]
readPrec :: ReadPrec DeleteLocation
$creadPrec :: ReadPrec DeleteLocation
readList :: ReadS [DeleteLocation]
$creadList :: ReadS [DeleteLocation]
readsPrec :: Int -> ReadS DeleteLocation
$creadsPrec :: Int -> ReadS DeleteLocation
Prelude.Read, Int -> DeleteLocation -> ShowS
[DeleteLocation] -> ShowS
DeleteLocation -> String
(Int -> DeleteLocation -> ShowS)
-> (DeleteLocation -> String)
-> ([DeleteLocation] -> ShowS)
-> Show DeleteLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLocation] -> ShowS
$cshowList :: [DeleteLocation] -> ShowS
show :: DeleteLocation -> String
$cshow :: DeleteLocation -> String
showsPrec :: Int -> DeleteLocation -> ShowS
$cshowsPrec :: Int -> DeleteLocation -> ShowS
Prelude.Show, (forall x. DeleteLocation -> Rep DeleteLocation x)
-> (forall x. Rep DeleteLocation x -> DeleteLocation)
-> Generic DeleteLocation
forall x. Rep DeleteLocation x -> DeleteLocation
forall x. DeleteLocation -> Rep DeleteLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLocation x -> DeleteLocation
$cfrom :: forall x. DeleteLocation -> Rep DeleteLocation x
Prelude.Generic)
newDeleteLocation ::
Prelude.Text ->
DeleteLocation
newDeleteLocation :: Text -> DeleteLocation
newDeleteLocation Text
pLocationArn_ =
DeleteLocation' :: Text -> DeleteLocation
DeleteLocation' {$sel:locationArn:DeleteLocation' :: Text
locationArn = Text
pLocationArn_}
deleteLocation_locationArn :: Lens.Lens' DeleteLocation Prelude.Text
deleteLocation_locationArn :: (Text -> f Text) -> DeleteLocation -> f DeleteLocation
deleteLocation_locationArn = (DeleteLocation -> Text)
-> (DeleteLocation -> Text -> DeleteLocation)
-> Lens DeleteLocation DeleteLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLocation' {Text
locationArn :: Text
$sel:locationArn:DeleteLocation' :: DeleteLocation -> Text
locationArn} -> Text
locationArn) (\s :: DeleteLocation
s@DeleteLocation' {} Text
a -> DeleteLocation
s {$sel:locationArn:DeleteLocation' :: Text
locationArn = Text
a} :: DeleteLocation)
instance Core.AWSRequest DeleteLocation where
type
AWSResponse DeleteLocation =
DeleteLocationResponse
request :: DeleteLocation -> Request DeleteLocation
request = Service -> DeleteLocation -> Request DeleteLocation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteLocation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLocation)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteLocation))
-> Logger
-> Service
-> Proxy DeleteLocation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLocation)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteLocationResponse
DeleteLocationResponse'
(Int -> DeleteLocationResponse)
-> Either String Int -> Either String DeleteLocationResponse
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))
)
instance Prelude.Hashable DeleteLocation
instance Prelude.NFData DeleteLocation
instance Core.ToHeaders DeleteLocation where
toHeaders :: DeleteLocation -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteLocation -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"FmrsService.DeleteLocation" :: Prelude.ByteString),
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.ToJSON DeleteLocation where
toJSON :: DeleteLocation -> Value
toJSON DeleteLocation' {Text
locationArn :: Text
$sel:locationArn:DeleteLocation' :: DeleteLocation -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LocationArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
locationArn)]
)
instance Core.ToPath DeleteLocation where
toPath :: DeleteLocation -> ByteString
toPath = ByteString -> DeleteLocation -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteLocation where
toQuery :: DeleteLocation -> QueryString
toQuery = QueryString -> DeleteLocation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteLocationResponse = DeleteLocationResponse'
{
DeleteLocationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteLocationResponse -> DeleteLocationResponse -> Bool
(DeleteLocationResponse -> DeleteLocationResponse -> Bool)
-> (DeleteLocationResponse -> DeleteLocationResponse -> Bool)
-> Eq DeleteLocationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLocationResponse -> DeleteLocationResponse -> Bool
$c/= :: DeleteLocationResponse -> DeleteLocationResponse -> Bool
== :: DeleteLocationResponse -> DeleteLocationResponse -> Bool
$c== :: DeleteLocationResponse -> DeleteLocationResponse -> Bool
Prelude.Eq, ReadPrec [DeleteLocationResponse]
ReadPrec DeleteLocationResponse
Int -> ReadS DeleteLocationResponse
ReadS [DeleteLocationResponse]
(Int -> ReadS DeleteLocationResponse)
-> ReadS [DeleteLocationResponse]
-> ReadPrec DeleteLocationResponse
-> ReadPrec [DeleteLocationResponse]
-> Read DeleteLocationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLocationResponse]
$creadListPrec :: ReadPrec [DeleteLocationResponse]
readPrec :: ReadPrec DeleteLocationResponse
$creadPrec :: ReadPrec DeleteLocationResponse
readList :: ReadS [DeleteLocationResponse]
$creadList :: ReadS [DeleteLocationResponse]
readsPrec :: Int -> ReadS DeleteLocationResponse
$creadsPrec :: Int -> ReadS DeleteLocationResponse
Prelude.Read, Int -> DeleteLocationResponse -> ShowS
[DeleteLocationResponse] -> ShowS
DeleteLocationResponse -> String
(Int -> DeleteLocationResponse -> ShowS)
-> (DeleteLocationResponse -> String)
-> ([DeleteLocationResponse] -> ShowS)
-> Show DeleteLocationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLocationResponse] -> ShowS
$cshowList :: [DeleteLocationResponse] -> ShowS
show :: DeleteLocationResponse -> String
$cshow :: DeleteLocationResponse -> String
showsPrec :: Int -> DeleteLocationResponse -> ShowS
$cshowsPrec :: Int -> DeleteLocationResponse -> ShowS
Prelude.Show, (forall x. DeleteLocationResponse -> Rep DeleteLocationResponse x)
-> (forall x.
Rep DeleteLocationResponse x -> DeleteLocationResponse)
-> Generic DeleteLocationResponse
forall x. Rep DeleteLocationResponse x -> DeleteLocationResponse
forall x. DeleteLocationResponse -> Rep DeleteLocationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLocationResponse x -> DeleteLocationResponse
$cfrom :: forall x. DeleteLocationResponse -> Rep DeleteLocationResponse x
Prelude.Generic)
newDeleteLocationResponse ::
Prelude.Int ->
DeleteLocationResponse
newDeleteLocationResponse :: Int -> DeleteLocationResponse
newDeleteLocationResponse Int
pHttpStatus_ =
DeleteLocationResponse' :: Int -> DeleteLocationResponse
DeleteLocationResponse' {$sel:httpStatus:DeleteLocationResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteLocationResponse_httpStatus :: Lens.Lens' DeleteLocationResponse Prelude.Int
deleteLocationResponse_httpStatus :: (Int -> f Int)
-> DeleteLocationResponse -> f DeleteLocationResponse
deleteLocationResponse_httpStatus = (DeleteLocationResponse -> Int)
-> (DeleteLocationResponse -> Int -> DeleteLocationResponse)
-> Lens DeleteLocationResponse DeleteLocationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLocationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteLocationResponse' :: DeleteLocationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteLocationResponse
s@DeleteLocationResponse' {} Int
a -> DeleteLocationResponse
s {$sel:httpStatus:DeleteLocationResponse' :: Int
httpStatus = Int
a} :: DeleteLocationResponse)
instance Prelude.NFData DeleteLocationResponse