{-# 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.MediaStore.DeleteLifecyclePolicy
(
DeleteLifecyclePolicy (..),
newDeleteLifecyclePolicy,
deleteLifecyclePolicy_containerName,
DeleteLifecyclePolicyResponse (..),
newDeleteLifecyclePolicyResponse,
deleteLifecyclePolicyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaStore.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteLifecyclePolicy = DeleteLifecyclePolicy'
{
DeleteLifecyclePolicy -> Text
containerName :: Prelude.Text
}
deriving (DeleteLifecyclePolicy -> DeleteLifecyclePolicy -> Bool
(DeleteLifecyclePolicy -> DeleteLifecyclePolicy -> Bool)
-> (DeleteLifecyclePolicy -> DeleteLifecyclePolicy -> Bool)
-> Eq DeleteLifecyclePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLifecyclePolicy -> DeleteLifecyclePolicy -> Bool
$c/= :: DeleteLifecyclePolicy -> DeleteLifecyclePolicy -> Bool
== :: DeleteLifecyclePolicy -> DeleteLifecyclePolicy -> Bool
$c== :: DeleteLifecyclePolicy -> DeleteLifecyclePolicy -> Bool
Prelude.Eq, ReadPrec [DeleteLifecyclePolicy]
ReadPrec DeleteLifecyclePolicy
Int -> ReadS DeleteLifecyclePolicy
ReadS [DeleteLifecyclePolicy]
(Int -> ReadS DeleteLifecyclePolicy)
-> ReadS [DeleteLifecyclePolicy]
-> ReadPrec DeleteLifecyclePolicy
-> ReadPrec [DeleteLifecyclePolicy]
-> Read DeleteLifecyclePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLifecyclePolicy]
$creadListPrec :: ReadPrec [DeleteLifecyclePolicy]
readPrec :: ReadPrec DeleteLifecyclePolicy
$creadPrec :: ReadPrec DeleteLifecyclePolicy
readList :: ReadS [DeleteLifecyclePolicy]
$creadList :: ReadS [DeleteLifecyclePolicy]
readsPrec :: Int -> ReadS DeleteLifecyclePolicy
$creadsPrec :: Int -> ReadS DeleteLifecyclePolicy
Prelude.Read, Int -> DeleteLifecyclePolicy -> ShowS
[DeleteLifecyclePolicy] -> ShowS
DeleteLifecyclePolicy -> String
(Int -> DeleteLifecyclePolicy -> ShowS)
-> (DeleteLifecyclePolicy -> String)
-> ([DeleteLifecyclePolicy] -> ShowS)
-> Show DeleteLifecyclePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLifecyclePolicy] -> ShowS
$cshowList :: [DeleteLifecyclePolicy] -> ShowS
show :: DeleteLifecyclePolicy -> String
$cshow :: DeleteLifecyclePolicy -> String
showsPrec :: Int -> DeleteLifecyclePolicy -> ShowS
$cshowsPrec :: Int -> DeleteLifecyclePolicy -> ShowS
Prelude.Show, (forall x. DeleteLifecyclePolicy -> Rep DeleteLifecyclePolicy x)
-> (forall x. Rep DeleteLifecyclePolicy x -> DeleteLifecyclePolicy)
-> Generic DeleteLifecyclePolicy
forall x. Rep DeleteLifecyclePolicy x -> DeleteLifecyclePolicy
forall x. DeleteLifecyclePolicy -> Rep DeleteLifecyclePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLifecyclePolicy x -> DeleteLifecyclePolicy
$cfrom :: forall x. DeleteLifecyclePolicy -> Rep DeleteLifecyclePolicy x
Prelude.Generic)
newDeleteLifecyclePolicy ::
Prelude.Text ->
DeleteLifecyclePolicy
newDeleteLifecyclePolicy :: Text -> DeleteLifecyclePolicy
newDeleteLifecyclePolicy Text
pContainerName_ =
DeleteLifecyclePolicy' :: Text -> DeleteLifecyclePolicy
DeleteLifecyclePolicy'
{ $sel:containerName:DeleteLifecyclePolicy' :: Text
containerName =
Text
pContainerName_
}
deleteLifecyclePolicy_containerName :: Lens.Lens' DeleteLifecyclePolicy Prelude.Text
deleteLifecyclePolicy_containerName :: (Text -> f Text)
-> DeleteLifecyclePolicy -> f DeleteLifecyclePolicy
deleteLifecyclePolicy_containerName = (DeleteLifecyclePolicy -> Text)
-> (DeleteLifecyclePolicy -> Text -> DeleteLifecyclePolicy)
-> Lens DeleteLifecyclePolicy DeleteLifecyclePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLifecyclePolicy' {Text
containerName :: Text
$sel:containerName:DeleteLifecyclePolicy' :: DeleteLifecyclePolicy -> Text
containerName} -> Text
containerName) (\s :: DeleteLifecyclePolicy
s@DeleteLifecyclePolicy' {} Text
a -> DeleteLifecyclePolicy
s {$sel:containerName:DeleteLifecyclePolicy' :: Text
containerName = Text
a} :: DeleteLifecyclePolicy)
instance Core.AWSRequest DeleteLifecyclePolicy where
type
AWSResponse DeleteLifecyclePolicy =
DeleteLifecyclePolicyResponse
request :: DeleteLifecyclePolicy -> Request DeleteLifecyclePolicy
request = Service -> DeleteLifecyclePolicy -> Request DeleteLifecyclePolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteLifecyclePolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteLifecyclePolicy)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteLifecyclePolicy))
-> Logger
-> Service
-> Proxy DeleteLifecyclePolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteLifecyclePolicy)))
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 -> DeleteLifecyclePolicyResponse
DeleteLifecyclePolicyResponse'
(Int -> DeleteLifecyclePolicyResponse)
-> Either String Int -> Either String DeleteLifecyclePolicyResponse
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 DeleteLifecyclePolicy
instance Prelude.NFData DeleteLifecyclePolicy
instance Core.ToHeaders DeleteLifecyclePolicy where
toHeaders :: DeleteLifecyclePolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteLifecyclePolicy -> 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
"MediaStore_20170901.DeleteLifecyclePolicy" ::
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 DeleteLifecyclePolicy where
toJSON :: DeleteLifecyclePolicy -> Value
toJSON DeleteLifecyclePolicy' {Text
containerName :: Text
$sel:containerName:DeleteLifecyclePolicy' :: DeleteLifecyclePolicy -> 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
"ContainerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
containerName)
]
)
instance Core.ToPath DeleteLifecyclePolicy where
toPath :: DeleteLifecyclePolicy -> ByteString
toPath = ByteString -> DeleteLifecyclePolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteLifecyclePolicy where
toQuery :: DeleteLifecyclePolicy -> QueryString
toQuery = QueryString -> DeleteLifecyclePolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteLifecyclePolicyResponse = DeleteLifecyclePolicyResponse'
{
DeleteLifecyclePolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteLifecyclePolicyResponse
-> DeleteLifecyclePolicyResponse -> Bool
(DeleteLifecyclePolicyResponse
-> DeleteLifecyclePolicyResponse -> Bool)
-> (DeleteLifecyclePolicyResponse
-> DeleteLifecyclePolicyResponse -> Bool)
-> Eq DeleteLifecyclePolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLifecyclePolicyResponse
-> DeleteLifecyclePolicyResponse -> Bool
$c/= :: DeleteLifecyclePolicyResponse
-> DeleteLifecyclePolicyResponse -> Bool
== :: DeleteLifecyclePolicyResponse
-> DeleteLifecyclePolicyResponse -> Bool
$c== :: DeleteLifecyclePolicyResponse
-> DeleteLifecyclePolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteLifecyclePolicyResponse]
ReadPrec DeleteLifecyclePolicyResponse
Int -> ReadS DeleteLifecyclePolicyResponse
ReadS [DeleteLifecyclePolicyResponse]
(Int -> ReadS DeleteLifecyclePolicyResponse)
-> ReadS [DeleteLifecyclePolicyResponse]
-> ReadPrec DeleteLifecyclePolicyResponse
-> ReadPrec [DeleteLifecyclePolicyResponse]
-> Read DeleteLifecyclePolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLifecyclePolicyResponse]
$creadListPrec :: ReadPrec [DeleteLifecyclePolicyResponse]
readPrec :: ReadPrec DeleteLifecyclePolicyResponse
$creadPrec :: ReadPrec DeleteLifecyclePolicyResponse
readList :: ReadS [DeleteLifecyclePolicyResponse]
$creadList :: ReadS [DeleteLifecyclePolicyResponse]
readsPrec :: Int -> ReadS DeleteLifecyclePolicyResponse
$creadsPrec :: Int -> ReadS DeleteLifecyclePolicyResponse
Prelude.Read, Int -> DeleteLifecyclePolicyResponse -> ShowS
[DeleteLifecyclePolicyResponse] -> ShowS
DeleteLifecyclePolicyResponse -> String
(Int -> DeleteLifecyclePolicyResponse -> ShowS)
-> (DeleteLifecyclePolicyResponse -> String)
-> ([DeleteLifecyclePolicyResponse] -> ShowS)
-> Show DeleteLifecyclePolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLifecyclePolicyResponse] -> ShowS
$cshowList :: [DeleteLifecyclePolicyResponse] -> ShowS
show :: DeleteLifecyclePolicyResponse -> String
$cshow :: DeleteLifecyclePolicyResponse -> String
showsPrec :: Int -> DeleteLifecyclePolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteLifecyclePolicyResponse -> ShowS
Prelude.Show, (forall x.
DeleteLifecyclePolicyResponse
-> Rep DeleteLifecyclePolicyResponse x)
-> (forall x.
Rep DeleteLifecyclePolicyResponse x
-> DeleteLifecyclePolicyResponse)
-> Generic DeleteLifecyclePolicyResponse
forall x.
Rep DeleteLifecyclePolicyResponse x
-> DeleteLifecyclePolicyResponse
forall x.
DeleteLifecyclePolicyResponse
-> Rep DeleteLifecyclePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteLifecyclePolicyResponse x
-> DeleteLifecyclePolicyResponse
$cfrom :: forall x.
DeleteLifecyclePolicyResponse
-> Rep DeleteLifecyclePolicyResponse x
Prelude.Generic)
newDeleteLifecyclePolicyResponse ::
Prelude.Int ->
DeleteLifecyclePolicyResponse
newDeleteLifecyclePolicyResponse :: Int -> DeleteLifecyclePolicyResponse
newDeleteLifecyclePolicyResponse Int
pHttpStatus_ =
DeleteLifecyclePolicyResponse' :: Int -> DeleteLifecyclePolicyResponse
DeleteLifecyclePolicyResponse'
{ $sel:httpStatus:DeleteLifecyclePolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteLifecyclePolicyResponse_httpStatus :: Lens.Lens' DeleteLifecyclePolicyResponse Prelude.Int
deleteLifecyclePolicyResponse_httpStatus :: (Int -> f Int)
-> DeleteLifecyclePolicyResponse -> f DeleteLifecyclePolicyResponse
deleteLifecyclePolicyResponse_httpStatus = (DeleteLifecyclePolicyResponse -> Int)
-> (DeleteLifecyclePolicyResponse
-> Int -> DeleteLifecyclePolicyResponse)
-> Lens
DeleteLifecyclePolicyResponse DeleteLifecyclePolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLifecyclePolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteLifecyclePolicyResponse' :: DeleteLifecyclePolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteLifecyclePolicyResponse
s@DeleteLifecyclePolicyResponse' {} Int
a -> DeleteLifecyclePolicyResponse
s {$sel:httpStatus:DeleteLifecyclePolicyResponse' :: Int
httpStatus = Int
a} :: DeleteLifecyclePolicyResponse)
instance Prelude.NFData DeleteLifecyclePolicyResponse