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