{-# 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.MediaPackage.DeleteOriginEndpoint
(
DeleteOriginEndpoint (..),
newDeleteOriginEndpoint,
deleteOriginEndpoint_id,
DeleteOriginEndpointResponse (..),
newDeleteOriginEndpointResponse,
deleteOriginEndpointResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaPackage.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteOriginEndpoint = DeleteOriginEndpoint'
{
DeleteOriginEndpoint -> Text
id :: Prelude.Text
}
deriving (DeleteOriginEndpoint -> DeleteOriginEndpoint -> Bool
(DeleteOriginEndpoint -> DeleteOriginEndpoint -> Bool)
-> (DeleteOriginEndpoint -> DeleteOriginEndpoint -> Bool)
-> Eq DeleteOriginEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOriginEndpoint -> DeleteOriginEndpoint -> Bool
$c/= :: DeleteOriginEndpoint -> DeleteOriginEndpoint -> Bool
== :: DeleteOriginEndpoint -> DeleteOriginEndpoint -> Bool
$c== :: DeleteOriginEndpoint -> DeleteOriginEndpoint -> Bool
Prelude.Eq, ReadPrec [DeleteOriginEndpoint]
ReadPrec DeleteOriginEndpoint
Int -> ReadS DeleteOriginEndpoint
ReadS [DeleteOriginEndpoint]
(Int -> ReadS DeleteOriginEndpoint)
-> ReadS [DeleteOriginEndpoint]
-> ReadPrec DeleteOriginEndpoint
-> ReadPrec [DeleteOriginEndpoint]
-> Read DeleteOriginEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOriginEndpoint]
$creadListPrec :: ReadPrec [DeleteOriginEndpoint]
readPrec :: ReadPrec DeleteOriginEndpoint
$creadPrec :: ReadPrec DeleteOriginEndpoint
readList :: ReadS [DeleteOriginEndpoint]
$creadList :: ReadS [DeleteOriginEndpoint]
readsPrec :: Int -> ReadS DeleteOriginEndpoint
$creadsPrec :: Int -> ReadS DeleteOriginEndpoint
Prelude.Read, Int -> DeleteOriginEndpoint -> ShowS
[DeleteOriginEndpoint] -> ShowS
DeleteOriginEndpoint -> String
(Int -> DeleteOriginEndpoint -> ShowS)
-> (DeleteOriginEndpoint -> String)
-> ([DeleteOriginEndpoint] -> ShowS)
-> Show DeleteOriginEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOriginEndpoint] -> ShowS
$cshowList :: [DeleteOriginEndpoint] -> ShowS
show :: DeleteOriginEndpoint -> String
$cshow :: DeleteOriginEndpoint -> String
showsPrec :: Int -> DeleteOriginEndpoint -> ShowS
$cshowsPrec :: Int -> DeleteOriginEndpoint -> ShowS
Prelude.Show, (forall x. DeleteOriginEndpoint -> Rep DeleteOriginEndpoint x)
-> (forall x. Rep DeleteOriginEndpoint x -> DeleteOriginEndpoint)
-> Generic DeleteOriginEndpoint
forall x. Rep DeleteOriginEndpoint x -> DeleteOriginEndpoint
forall x. DeleteOriginEndpoint -> Rep DeleteOriginEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteOriginEndpoint x -> DeleteOriginEndpoint
$cfrom :: forall x. DeleteOriginEndpoint -> Rep DeleteOriginEndpoint x
Prelude.Generic)
newDeleteOriginEndpoint ::
Prelude.Text ->
DeleteOriginEndpoint
newDeleteOriginEndpoint :: Text -> DeleteOriginEndpoint
newDeleteOriginEndpoint Text
pId_ =
DeleteOriginEndpoint' :: Text -> DeleteOriginEndpoint
DeleteOriginEndpoint' {$sel:id:DeleteOriginEndpoint' :: Text
id = Text
pId_}
deleteOriginEndpoint_id :: Lens.Lens' DeleteOriginEndpoint Prelude.Text
deleteOriginEndpoint_id :: (Text -> f Text) -> DeleteOriginEndpoint -> f DeleteOriginEndpoint
deleteOriginEndpoint_id = (DeleteOriginEndpoint -> Text)
-> (DeleteOriginEndpoint -> Text -> DeleteOriginEndpoint)
-> Lens DeleteOriginEndpoint DeleteOriginEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOriginEndpoint' {Text
id :: Text
$sel:id:DeleteOriginEndpoint' :: DeleteOriginEndpoint -> Text
id} -> Text
id) (\s :: DeleteOriginEndpoint
s@DeleteOriginEndpoint' {} Text
a -> DeleteOriginEndpoint
s {$sel:id:DeleteOriginEndpoint' :: Text
id = Text
a} :: DeleteOriginEndpoint)
instance Core.AWSRequest DeleteOriginEndpoint where
type
AWSResponse DeleteOriginEndpoint =
DeleteOriginEndpointResponse
request :: DeleteOriginEndpoint -> Request DeleteOriginEndpoint
request = Service -> DeleteOriginEndpoint -> Request DeleteOriginEndpoint
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteOriginEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteOriginEndpoint)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteOriginEndpoint))
-> Logger
-> Service
-> Proxy DeleteOriginEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteOriginEndpoint)))
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 -> DeleteOriginEndpointResponse
DeleteOriginEndpointResponse'
(Int -> DeleteOriginEndpointResponse)
-> Either String Int -> Either String DeleteOriginEndpointResponse
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 DeleteOriginEndpoint
instance Prelude.NFData DeleteOriginEndpoint
instance Core.ToHeaders DeleteOriginEndpoint where
toHeaders :: DeleteOriginEndpoint -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteOriginEndpoint -> 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 DeleteOriginEndpoint where
toPath :: DeleteOriginEndpoint -> ByteString
toPath DeleteOriginEndpoint' {Text
id :: Text
$sel:id:DeleteOriginEndpoint' :: DeleteOriginEndpoint -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/origin_endpoints/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery DeleteOriginEndpoint where
toQuery :: DeleteOriginEndpoint -> QueryString
toQuery = QueryString -> DeleteOriginEndpoint -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteOriginEndpointResponse = DeleteOriginEndpointResponse'
{
DeleteOriginEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteOriginEndpointResponse
-> DeleteOriginEndpointResponse -> Bool
(DeleteOriginEndpointResponse
-> DeleteOriginEndpointResponse -> Bool)
-> (DeleteOriginEndpointResponse
-> DeleteOriginEndpointResponse -> Bool)
-> Eq DeleteOriginEndpointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOriginEndpointResponse
-> DeleteOriginEndpointResponse -> Bool
$c/= :: DeleteOriginEndpointResponse
-> DeleteOriginEndpointResponse -> Bool
== :: DeleteOriginEndpointResponse
-> DeleteOriginEndpointResponse -> Bool
$c== :: DeleteOriginEndpointResponse
-> DeleteOriginEndpointResponse -> Bool
Prelude.Eq, ReadPrec [DeleteOriginEndpointResponse]
ReadPrec DeleteOriginEndpointResponse
Int -> ReadS DeleteOriginEndpointResponse
ReadS [DeleteOriginEndpointResponse]
(Int -> ReadS DeleteOriginEndpointResponse)
-> ReadS [DeleteOriginEndpointResponse]
-> ReadPrec DeleteOriginEndpointResponse
-> ReadPrec [DeleteOriginEndpointResponse]
-> Read DeleteOriginEndpointResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOriginEndpointResponse]
$creadListPrec :: ReadPrec [DeleteOriginEndpointResponse]
readPrec :: ReadPrec DeleteOriginEndpointResponse
$creadPrec :: ReadPrec DeleteOriginEndpointResponse
readList :: ReadS [DeleteOriginEndpointResponse]
$creadList :: ReadS [DeleteOriginEndpointResponse]
readsPrec :: Int -> ReadS DeleteOriginEndpointResponse
$creadsPrec :: Int -> ReadS DeleteOriginEndpointResponse
Prelude.Read, Int -> DeleteOriginEndpointResponse -> ShowS
[DeleteOriginEndpointResponse] -> ShowS
DeleteOriginEndpointResponse -> String
(Int -> DeleteOriginEndpointResponse -> ShowS)
-> (DeleteOriginEndpointResponse -> String)
-> ([DeleteOriginEndpointResponse] -> ShowS)
-> Show DeleteOriginEndpointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOriginEndpointResponse] -> ShowS
$cshowList :: [DeleteOriginEndpointResponse] -> ShowS
show :: DeleteOriginEndpointResponse -> String
$cshow :: DeleteOriginEndpointResponse -> String
showsPrec :: Int -> DeleteOriginEndpointResponse -> ShowS
$cshowsPrec :: Int -> DeleteOriginEndpointResponse -> ShowS
Prelude.Show, (forall x.
DeleteOriginEndpointResponse -> Rep DeleteOriginEndpointResponse x)
-> (forall x.
Rep DeleteOriginEndpointResponse x -> DeleteOriginEndpointResponse)
-> Generic DeleteOriginEndpointResponse
forall x.
Rep DeleteOriginEndpointResponse x -> DeleteOriginEndpointResponse
forall x.
DeleteOriginEndpointResponse -> Rep DeleteOriginEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteOriginEndpointResponse x -> DeleteOriginEndpointResponse
$cfrom :: forall x.
DeleteOriginEndpointResponse -> Rep DeleteOriginEndpointResponse x
Prelude.Generic)
newDeleteOriginEndpointResponse ::
Prelude.Int ->
DeleteOriginEndpointResponse
newDeleteOriginEndpointResponse :: Int -> DeleteOriginEndpointResponse
newDeleteOriginEndpointResponse Int
pHttpStatus_ =
DeleteOriginEndpointResponse' :: Int -> DeleteOriginEndpointResponse
DeleteOriginEndpointResponse'
{ $sel:httpStatus:DeleteOriginEndpointResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteOriginEndpointResponse_httpStatus :: Lens.Lens' DeleteOriginEndpointResponse Prelude.Int
deleteOriginEndpointResponse_httpStatus :: (Int -> f Int)
-> DeleteOriginEndpointResponse -> f DeleteOriginEndpointResponse
deleteOriginEndpointResponse_httpStatus = (DeleteOriginEndpointResponse -> Int)
-> (DeleteOriginEndpointResponse
-> Int -> DeleteOriginEndpointResponse)
-> Lens
DeleteOriginEndpointResponse DeleteOriginEndpointResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOriginEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteOriginEndpointResponse' :: DeleteOriginEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteOriginEndpointResponse
s@DeleteOriginEndpointResponse' {} Int
a -> DeleteOriginEndpointResponse
s {$sel:httpStatus:DeleteOriginEndpointResponse' :: Int
httpStatus = Int
a} :: DeleteOriginEndpointResponse)
instance Prelude.NFData DeleteOriginEndpointResponse