{-# 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.DeleteContainerPolicy
(
DeleteContainerPolicy (..),
newDeleteContainerPolicy,
deleteContainerPolicy_containerName,
DeleteContainerPolicyResponse (..),
newDeleteContainerPolicyResponse,
deleteContainerPolicyResponse_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 DeleteContainerPolicy = DeleteContainerPolicy'
{
DeleteContainerPolicy -> Text
containerName :: Prelude.Text
}
deriving (DeleteContainerPolicy -> DeleteContainerPolicy -> Bool
(DeleteContainerPolicy -> DeleteContainerPolicy -> Bool)
-> (DeleteContainerPolicy -> DeleteContainerPolicy -> Bool)
-> Eq DeleteContainerPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContainerPolicy -> DeleteContainerPolicy -> Bool
$c/= :: DeleteContainerPolicy -> DeleteContainerPolicy -> Bool
== :: DeleteContainerPolicy -> DeleteContainerPolicy -> Bool
$c== :: DeleteContainerPolicy -> DeleteContainerPolicy -> Bool
Prelude.Eq, ReadPrec [DeleteContainerPolicy]
ReadPrec DeleteContainerPolicy
Int -> ReadS DeleteContainerPolicy
ReadS [DeleteContainerPolicy]
(Int -> ReadS DeleteContainerPolicy)
-> ReadS [DeleteContainerPolicy]
-> ReadPrec DeleteContainerPolicy
-> ReadPrec [DeleteContainerPolicy]
-> Read DeleteContainerPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContainerPolicy]
$creadListPrec :: ReadPrec [DeleteContainerPolicy]
readPrec :: ReadPrec DeleteContainerPolicy
$creadPrec :: ReadPrec DeleteContainerPolicy
readList :: ReadS [DeleteContainerPolicy]
$creadList :: ReadS [DeleteContainerPolicy]
readsPrec :: Int -> ReadS DeleteContainerPolicy
$creadsPrec :: Int -> ReadS DeleteContainerPolicy
Prelude.Read, Int -> DeleteContainerPolicy -> ShowS
[DeleteContainerPolicy] -> ShowS
DeleteContainerPolicy -> String
(Int -> DeleteContainerPolicy -> ShowS)
-> (DeleteContainerPolicy -> String)
-> ([DeleteContainerPolicy] -> ShowS)
-> Show DeleteContainerPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContainerPolicy] -> ShowS
$cshowList :: [DeleteContainerPolicy] -> ShowS
show :: DeleteContainerPolicy -> String
$cshow :: DeleteContainerPolicy -> String
showsPrec :: Int -> DeleteContainerPolicy -> ShowS
$cshowsPrec :: Int -> DeleteContainerPolicy -> ShowS
Prelude.Show, (forall x. DeleteContainerPolicy -> Rep DeleteContainerPolicy x)
-> (forall x. Rep DeleteContainerPolicy x -> DeleteContainerPolicy)
-> Generic DeleteContainerPolicy
forall x. Rep DeleteContainerPolicy x -> DeleteContainerPolicy
forall x. DeleteContainerPolicy -> Rep DeleteContainerPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteContainerPolicy x -> DeleteContainerPolicy
$cfrom :: forall x. DeleteContainerPolicy -> Rep DeleteContainerPolicy x
Prelude.Generic)
newDeleteContainerPolicy ::
Prelude.Text ->
DeleteContainerPolicy
newDeleteContainerPolicy :: Text -> DeleteContainerPolicy
newDeleteContainerPolicy Text
pContainerName_ =
DeleteContainerPolicy' :: Text -> DeleteContainerPolicy
DeleteContainerPolicy'
{ $sel:containerName:DeleteContainerPolicy' :: Text
containerName =
Text
pContainerName_
}
deleteContainerPolicy_containerName :: Lens.Lens' DeleteContainerPolicy Prelude.Text
deleteContainerPolicy_containerName :: (Text -> f Text)
-> DeleteContainerPolicy -> f DeleteContainerPolicy
deleteContainerPolicy_containerName = (DeleteContainerPolicy -> Text)
-> (DeleteContainerPolicy -> Text -> DeleteContainerPolicy)
-> Lens DeleteContainerPolicy DeleteContainerPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContainerPolicy' {Text
containerName :: Text
$sel:containerName:DeleteContainerPolicy' :: DeleteContainerPolicy -> Text
containerName} -> Text
containerName) (\s :: DeleteContainerPolicy
s@DeleteContainerPolicy' {} Text
a -> DeleteContainerPolicy
s {$sel:containerName:DeleteContainerPolicy' :: Text
containerName = Text
a} :: DeleteContainerPolicy)
instance Core.AWSRequest DeleteContainerPolicy where
type
AWSResponse DeleteContainerPolicy =
DeleteContainerPolicyResponse
request :: DeleteContainerPolicy -> Request DeleteContainerPolicy
request = Service -> DeleteContainerPolicy -> Request DeleteContainerPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteContainerPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteContainerPolicy)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteContainerPolicy))
-> Logger
-> Service
-> Proxy DeleteContainerPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteContainerPolicy)))
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 -> DeleteContainerPolicyResponse
DeleteContainerPolicyResponse'
(Int -> DeleteContainerPolicyResponse)
-> Either String Int -> Either String DeleteContainerPolicyResponse
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 DeleteContainerPolicy
instance Prelude.NFData DeleteContainerPolicy
instance Core.ToHeaders DeleteContainerPolicy where
toHeaders :: DeleteContainerPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteContainerPolicy -> 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.DeleteContainerPolicy" ::
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 DeleteContainerPolicy where
toJSON :: DeleteContainerPolicy -> Value
toJSON DeleteContainerPolicy' {Text
containerName :: Text
$sel:containerName:DeleteContainerPolicy' :: DeleteContainerPolicy -> 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 DeleteContainerPolicy where
toPath :: DeleteContainerPolicy -> ByteString
toPath = ByteString -> DeleteContainerPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteContainerPolicy where
toQuery :: DeleteContainerPolicy -> QueryString
toQuery = QueryString -> DeleteContainerPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteContainerPolicyResponse = DeleteContainerPolicyResponse'
{
DeleteContainerPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteContainerPolicyResponse
-> DeleteContainerPolicyResponse -> Bool
(DeleteContainerPolicyResponse
-> DeleteContainerPolicyResponse -> Bool)
-> (DeleteContainerPolicyResponse
-> DeleteContainerPolicyResponse -> Bool)
-> Eq DeleteContainerPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContainerPolicyResponse
-> DeleteContainerPolicyResponse -> Bool
$c/= :: DeleteContainerPolicyResponse
-> DeleteContainerPolicyResponse -> Bool
== :: DeleteContainerPolicyResponse
-> DeleteContainerPolicyResponse -> Bool
$c== :: DeleteContainerPolicyResponse
-> DeleteContainerPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteContainerPolicyResponse]
ReadPrec DeleteContainerPolicyResponse
Int -> ReadS DeleteContainerPolicyResponse
ReadS [DeleteContainerPolicyResponse]
(Int -> ReadS DeleteContainerPolicyResponse)
-> ReadS [DeleteContainerPolicyResponse]
-> ReadPrec DeleteContainerPolicyResponse
-> ReadPrec [DeleteContainerPolicyResponse]
-> Read DeleteContainerPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContainerPolicyResponse]
$creadListPrec :: ReadPrec [DeleteContainerPolicyResponse]
readPrec :: ReadPrec DeleteContainerPolicyResponse
$creadPrec :: ReadPrec DeleteContainerPolicyResponse
readList :: ReadS [DeleteContainerPolicyResponse]
$creadList :: ReadS [DeleteContainerPolicyResponse]
readsPrec :: Int -> ReadS DeleteContainerPolicyResponse
$creadsPrec :: Int -> ReadS DeleteContainerPolicyResponse
Prelude.Read, Int -> DeleteContainerPolicyResponse -> ShowS
[DeleteContainerPolicyResponse] -> ShowS
DeleteContainerPolicyResponse -> String
(Int -> DeleteContainerPolicyResponse -> ShowS)
-> (DeleteContainerPolicyResponse -> String)
-> ([DeleteContainerPolicyResponse] -> ShowS)
-> Show DeleteContainerPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContainerPolicyResponse] -> ShowS
$cshowList :: [DeleteContainerPolicyResponse] -> ShowS
show :: DeleteContainerPolicyResponse -> String
$cshow :: DeleteContainerPolicyResponse -> String
showsPrec :: Int -> DeleteContainerPolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteContainerPolicyResponse -> ShowS
Prelude.Show, (forall x.
DeleteContainerPolicyResponse
-> Rep DeleteContainerPolicyResponse x)
-> (forall x.
Rep DeleteContainerPolicyResponse x
-> DeleteContainerPolicyResponse)
-> Generic DeleteContainerPolicyResponse
forall x.
Rep DeleteContainerPolicyResponse x
-> DeleteContainerPolicyResponse
forall x.
DeleteContainerPolicyResponse
-> Rep DeleteContainerPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteContainerPolicyResponse x
-> DeleteContainerPolicyResponse
$cfrom :: forall x.
DeleteContainerPolicyResponse
-> Rep DeleteContainerPolicyResponse x
Prelude.Generic)
newDeleteContainerPolicyResponse ::
Prelude.Int ->
DeleteContainerPolicyResponse
newDeleteContainerPolicyResponse :: Int -> DeleteContainerPolicyResponse
newDeleteContainerPolicyResponse Int
pHttpStatus_ =
DeleteContainerPolicyResponse' :: Int -> DeleteContainerPolicyResponse
DeleteContainerPolicyResponse'
{ $sel:httpStatus:DeleteContainerPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteContainerPolicyResponse_httpStatus :: Lens.Lens' DeleteContainerPolicyResponse Prelude.Int
deleteContainerPolicyResponse_httpStatus :: (Int -> f Int)
-> DeleteContainerPolicyResponse -> f DeleteContainerPolicyResponse
deleteContainerPolicyResponse_httpStatus = (DeleteContainerPolicyResponse -> Int)
-> (DeleteContainerPolicyResponse
-> Int -> DeleteContainerPolicyResponse)
-> Lens
DeleteContainerPolicyResponse DeleteContainerPolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContainerPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteContainerPolicyResponse' :: DeleteContainerPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteContainerPolicyResponse
s@DeleteContainerPolicyResponse' {} Int
a -> DeleteContainerPolicyResponse
s {$sel:httpStatus:DeleteContainerPolicyResponse' :: Int
httpStatus = Int
a} :: DeleteContainerPolicyResponse)
instance Prelude.NFData DeleteContainerPolicyResponse