{-# 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.GetTrafficPolicyInstance
(
GetTrafficPolicyInstance (..),
newGetTrafficPolicyInstance,
getTrafficPolicyInstance_id,
GetTrafficPolicyInstanceResponse (..),
newGetTrafficPolicyInstanceResponse,
getTrafficPolicyInstanceResponse_httpStatus,
getTrafficPolicyInstanceResponse_trafficPolicyInstance,
)
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 GetTrafficPolicyInstance = GetTrafficPolicyInstance'
{
GetTrafficPolicyInstance -> Text
id :: Prelude.Text
}
deriving (GetTrafficPolicyInstance -> GetTrafficPolicyInstance -> Bool
(GetTrafficPolicyInstance -> GetTrafficPolicyInstance -> Bool)
-> (GetTrafficPolicyInstance -> GetTrafficPolicyInstance -> Bool)
-> Eq GetTrafficPolicyInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTrafficPolicyInstance -> GetTrafficPolicyInstance -> Bool
$c/= :: GetTrafficPolicyInstance -> GetTrafficPolicyInstance -> Bool
== :: GetTrafficPolicyInstance -> GetTrafficPolicyInstance -> Bool
$c== :: GetTrafficPolicyInstance -> GetTrafficPolicyInstance -> Bool
Prelude.Eq, ReadPrec [GetTrafficPolicyInstance]
ReadPrec GetTrafficPolicyInstance
Int -> ReadS GetTrafficPolicyInstance
ReadS [GetTrafficPolicyInstance]
(Int -> ReadS GetTrafficPolicyInstance)
-> ReadS [GetTrafficPolicyInstance]
-> ReadPrec GetTrafficPolicyInstance
-> ReadPrec [GetTrafficPolicyInstance]
-> Read GetTrafficPolicyInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTrafficPolicyInstance]
$creadListPrec :: ReadPrec [GetTrafficPolicyInstance]
readPrec :: ReadPrec GetTrafficPolicyInstance
$creadPrec :: ReadPrec GetTrafficPolicyInstance
readList :: ReadS [GetTrafficPolicyInstance]
$creadList :: ReadS [GetTrafficPolicyInstance]
readsPrec :: Int -> ReadS GetTrafficPolicyInstance
$creadsPrec :: Int -> ReadS GetTrafficPolicyInstance
Prelude.Read, Int -> GetTrafficPolicyInstance -> ShowS
[GetTrafficPolicyInstance] -> ShowS
GetTrafficPolicyInstance -> String
(Int -> GetTrafficPolicyInstance -> ShowS)
-> (GetTrafficPolicyInstance -> String)
-> ([GetTrafficPolicyInstance] -> ShowS)
-> Show GetTrafficPolicyInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTrafficPolicyInstance] -> ShowS
$cshowList :: [GetTrafficPolicyInstance] -> ShowS
show :: GetTrafficPolicyInstance -> String
$cshow :: GetTrafficPolicyInstance -> String
showsPrec :: Int -> GetTrafficPolicyInstance -> ShowS
$cshowsPrec :: Int -> GetTrafficPolicyInstance -> ShowS
Prelude.Show, (forall x.
GetTrafficPolicyInstance -> Rep GetTrafficPolicyInstance x)
-> (forall x.
Rep GetTrafficPolicyInstance x -> GetTrafficPolicyInstance)
-> Generic GetTrafficPolicyInstance
forall x.
Rep GetTrafficPolicyInstance x -> GetTrafficPolicyInstance
forall x.
GetTrafficPolicyInstance -> Rep GetTrafficPolicyInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTrafficPolicyInstance x -> GetTrafficPolicyInstance
$cfrom :: forall x.
GetTrafficPolicyInstance -> Rep GetTrafficPolicyInstance x
Prelude.Generic)
newGetTrafficPolicyInstance ::
Prelude.Text ->
GetTrafficPolicyInstance
newGetTrafficPolicyInstance :: Text -> GetTrafficPolicyInstance
newGetTrafficPolicyInstance Text
pId_ =
GetTrafficPolicyInstance' :: Text -> GetTrafficPolicyInstance
GetTrafficPolicyInstance' {$sel:id:GetTrafficPolicyInstance' :: Text
id = Text
pId_}
getTrafficPolicyInstance_id :: Lens.Lens' GetTrafficPolicyInstance Prelude.Text
getTrafficPolicyInstance_id :: (Text -> f Text)
-> GetTrafficPolicyInstance -> f GetTrafficPolicyInstance
getTrafficPolicyInstance_id = (GetTrafficPolicyInstance -> Text)
-> (GetTrafficPolicyInstance -> Text -> GetTrafficPolicyInstance)
-> Lens GetTrafficPolicyInstance GetTrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrafficPolicyInstance' {Text
id :: Text
$sel:id:GetTrafficPolicyInstance' :: GetTrafficPolicyInstance -> Text
id} -> Text
id) (\s :: GetTrafficPolicyInstance
s@GetTrafficPolicyInstance' {} Text
a -> GetTrafficPolicyInstance
s {$sel:id:GetTrafficPolicyInstance' :: Text
id = Text
a} :: GetTrafficPolicyInstance)
instance Core.AWSRequest GetTrafficPolicyInstance where
type
AWSResponse GetTrafficPolicyInstance =
GetTrafficPolicyInstanceResponse
request :: GetTrafficPolicyInstance -> Request GetTrafficPolicyInstance
request = Service
-> GetTrafficPolicyInstance -> Request GetTrafficPolicyInstance
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetTrafficPolicyInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetTrafficPolicyInstance)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetTrafficPolicyInstance))
-> Logger
-> Service
-> Proxy GetTrafficPolicyInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetTrafficPolicyInstance)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> TrafficPolicyInstance -> GetTrafficPolicyInstanceResponse
GetTrafficPolicyInstanceResponse'
(Int -> TrafficPolicyInstance -> GetTrafficPolicyInstanceResponse)
-> Either String Int
-> Either
String (TrafficPolicyInstance -> GetTrafficPolicyInstanceResponse)
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))
Either
String (TrafficPolicyInstance -> GetTrafficPolicyInstanceResponse)
-> Either String TrafficPolicyInstance
-> Either String GetTrafficPolicyInstanceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String TrafficPolicyInstance
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TrafficPolicyInstance")
)
instance Prelude.Hashable GetTrafficPolicyInstance
instance Prelude.NFData GetTrafficPolicyInstance
instance Core.ToHeaders GetTrafficPolicyInstance where
toHeaders :: GetTrafficPolicyInstance -> ResponseHeaders
toHeaders = ResponseHeaders -> GetTrafficPolicyInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetTrafficPolicyInstance where
toPath :: GetTrafficPolicyInstance -> ByteString
toPath GetTrafficPolicyInstance' {Text
id :: Text
$sel:id:GetTrafficPolicyInstance' :: GetTrafficPolicyInstance -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2013-04-01/trafficpolicyinstance/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery GetTrafficPolicyInstance where
toQuery :: GetTrafficPolicyInstance -> QueryString
toQuery = QueryString -> GetTrafficPolicyInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetTrafficPolicyInstanceResponse = GetTrafficPolicyInstanceResponse'
{
GetTrafficPolicyInstanceResponse -> Int
httpStatus :: Prelude.Int,
GetTrafficPolicyInstanceResponse -> TrafficPolicyInstance
trafficPolicyInstance :: TrafficPolicyInstance
}
deriving (GetTrafficPolicyInstanceResponse
-> GetTrafficPolicyInstanceResponse -> Bool
(GetTrafficPolicyInstanceResponse
-> GetTrafficPolicyInstanceResponse -> Bool)
-> (GetTrafficPolicyInstanceResponse
-> GetTrafficPolicyInstanceResponse -> Bool)
-> Eq GetTrafficPolicyInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTrafficPolicyInstanceResponse
-> GetTrafficPolicyInstanceResponse -> Bool
$c/= :: GetTrafficPolicyInstanceResponse
-> GetTrafficPolicyInstanceResponse -> Bool
== :: GetTrafficPolicyInstanceResponse
-> GetTrafficPolicyInstanceResponse -> Bool
$c== :: GetTrafficPolicyInstanceResponse
-> GetTrafficPolicyInstanceResponse -> Bool
Prelude.Eq, ReadPrec [GetTrafficPolicyInstanceResponse]
ReadPrec GetTrafficPolicyInstanceResponse
Int -> ReadS GetTrafficPolicyInstanceResponse
ReadS [GetTrafficPolicyInstanceResponse]
(Int -> ReadS GetTrafficPolicyInstanceResponse)
-> ReadS [GetTrafficPolicyInstanceResponse]
-> ReadPrec GetTrafficPolicyInstanceResponse
-> ReadPrec [GetTrafficPolicyInstanceResponse]
-> Read GetTrafficPolicyInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTrafficPolicyInstanceResponse]
$creadListPrec :: ReadPrec [GetTrafficPolicyInstanceResponse]
readPrec :: ReadPrec GetTrafficPolicyInstanceResponse
$creadPrec :: ReadPrec GetTrafficPolicyInstanceResponse
readList :: ReadS [GetTrafficPolicyInstanceResponse]
$creadList :: ReadS [GetTrafficPolicyInstanceResponse]
readsPrec :: Int -> ReadS GetTrafficPolicyInstanceResponse
$creadsPrec :: Int -> ReadS GetTrafficPolicyInstanceResponse
Prelude.Read, Int -> GetTrafficPolicyInstanceResponse -> ShowS
[GetTrafficPolicyInstanceResponse] -> ShowS
GetTrafficPolicyInstanceResponse -> String
(Int -> GetTrafficPolicyInstanceResponse -> ShowS)
-> (GetTrafficPolicyInstanceResponse -> String)
-> ([GetTrafficPolicyInstanceResponse] -> ShowS)
-> Show GetTrafficPolicyInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTrafficPolicyInstanceResponse] -> ShowS
$cshowList :: [GetTrafficPolicyInstanceResponse] -> ShowS
show :: GetTrafficPolicyInstanceResponse -> String
$cshow :: GetTrafficPolicyInstanceResponse -> String
showsPrec :: Int -> GetTrafficPolicyInstanceResponse -> ShowS
$cshowsPrec :: Int -> GetTrafficPolicyInstanceResponse -> ShowS
Prelude.Show, (forall x.
GetTrafficPolicyInstanceResponse
-> Rep GetTrafficPolicyInstanceResponse x)
-> (forall x.
Rep GetTrafficPolicyInstanceResponse x
-> GetTrafficPolicyInstanceResponse)
-> Generic GetTrafficPolicyInstanceResponse
forall x.
Rep GetTrafficPolicyInstanceResponse x
-> GetTrafficPolicyInstanceResponse
forall x.
GetTrafficPolicyInstanceResponse
-> Rep GetTrafficPolicyInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTrafficPolicyInstanceResponse x
-> GetTrafficPolicyInstanceResponse
$cfrom :: forall x.
GetTrafficPolicyInstanceResponse
-> Rep GetTrafficPolicyInstanceResponse x
Prelude.Generic)
newGetTrafficPolicyInstanceResponse ::
Prelude.Int ->
TrafficPolicyInstance ->
GetTrafficPolicyInstanceResponse
newGetTrafficPolicyInstanceResponse :: Int -> TrafficPolicyInstance -> GetTrafficPolicyInstanceResponse
newGetTrafficPolicyInstanceResponse
Int
pHttpStatus_
TrafficPolicyInstance
pTrafficPolicyInstance_ =
GetTrafficPolicyInstanceResponse' :: Int -> TrafficPolicyInstance -> GetTrafficPolicyInstanceResponse
GetTrafficPolicyInstanceResponse'
{ $sel:httpStatus:GetTrafficPolicyInstanceResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:trafficPolicyInstance:GetTrafficPolicyInstanceResponse' :: TrafficPolicyInstance
trafficPolicyInstance =
TrafficPolicyInstance
pTrafficPolicyInstance_
}
getTrafficPolicyInstanceResponse_httpStatus :: Lens.Lens' GetTrafficPolicyInstanceResponse Prelude.Int
getTrafficPolicyInstanceResponse_httpStatus :: (Int -> f Int)
-> GetTrafficPolicyInstanceResponse
-> f GetTrafficPolicyInstanceResponse
getTrafficPolicyInstanceResponse_httpStatus = (GetTrafficPolicyInstanceResponse -> Int)
-> (GetTrafficPolicyInstanceResponse
-> Int -> GetTrafficPolicyInstanceResponse)
-> Lens
GetTrafficPolicyInstanceResponse
GetTrafficPolicyInstanceResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrafficPolicyInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTrafficPolicyInstanceResponse' :: GetTrafficPolicyInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTrafficPolicyInstanceResponse
s@GetTrafficPolicyInstanceResponse' {} Int
a -> GetTrafficPolicyInstanceResponse
s {$sel:httpStatus:GetTrafficPolicyInstanceResponse' :: Int
httpStatus = Int
a} :: GetTrafficPolicyInstanceResponse)
getTrafficPolicyInstanceResponse_trafficPolicyInstance :: Lens.Lens' GetTrafficPolicyInstanceResponse TrafficPolicyInstance
getTrafficPolicyInstanceResponse_trafficPolicyInstance :: (TrafficPolicyInstance -> f TrafficPolicyInstance)
-> GetTrafficPolicyInstanceResponse
-> f GetTrafficPolicyInstanceResponse
getTrafficPolicyInstanceResponse_trafficPolicyInstance = (GetTrafficPolicyInstanceResponse -> TrafficPolicyInstance)
-> (GetTrafficPolicyInstanceResponse
-> TrafficPolicyInstance -> GetTrafficPolicyInstanceResponse)
-> Lens
GetTrafficPolicyInstanceResponse
GetTrafficPolicyInstanceResponse
TrafficPolicyInstance
TrafficPolicyInstance
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrafficPolicyInstanceResponse' {TrafficPolicyInstance
trafficPolicyInstance :: TrafficPolicyInstance
$sel:trafficPolicyInstance:GetTrafficPolicyInstanceResponse' :: GetTrafficPolicyInstanceResponse -> TrafficPolicyInstance
trafficPolicyInstance} -> TrafficPolicyInstance
trafficPolicyInstance) (\s :: GetTrafficPolicyInstanceResponse
s@GetTrafficPolicyInstanceResponse' {} TrafficPolicyInstance
a -> GetTrafficPolicyInstanceResponse
s {$sel:trafficPolicyInstance:GetTrafficPolicyInstanceResponse' :: TrafficPolicyInstance
trafficPolicyInstance = TrafficPolicyInstance
a} :: GetTrafficPolicyInstanceResponse)
instance
Prelude.NFData
GetTrafficPolicyInstanceResponse