{-# 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.GlobalAccelerator.DescribeAcceleratorAttributes
(
DescribeAcceleratorAttributes (..),
newDescribeAcceleratorAttributes,
describeAcceleratorAttributes_acceleratorArn,
DescribeAcceleratorAttributesResponse (..),
newDescribeAcceleratorAttributesResponse,
describeAcceleratorAttributesResponse_acceleratorAttributes,
describeAcceleratorAttributesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeAcceleratorAttributes = DescribeAcceleratorAttributes'
{
DescribeAcceleratorAttributes -> Text
acceleratorArn :: Prelude.Text
}
deriving (DescribeAcceleratorAttributes
-> DescribeAcceleratorAttributes -> Bool
(DescribeAcceleratorAttributes
-> DescribeAcceleratorAttributes -> Bool)
-> (DescribeAcceleratorAttributes
-> DescribeAcceleratorAttributes -> Bool)
-> Eq DescribeAcceleratorAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAcceleratorAttributes
-> DescribeAcceleratorAttributes -> Bool
$c/= :: DescribeAcceleratorAttributes
-> DescribeAcceleratorAttributes -> Bool
== :: DescribeAcceleratorAttributes
-> DescribeAcceleratorAttributes -> Bool
$c== :: DescribeAcceleratorAttributes
-> DescribeAcceleratorAttributes -> Bool
Prelude.Eq, ReadPrec [DescribeAcceleratorAttributes]
ReadPrec DescribeAcceleratorAttributes
Int -> ReadS DescribeAcceleratorAttributes
ReadS [DescribeAcceleratorAttributes]
(Int -> ReadS DescribeAcceleratorAttributes)
-> ReadS [DescribeAcceleratorAttributes]
-> ReadPrec DescribeAcceleratorAttributes
-> ReadPrec [DescribeAcceleratorAttributes]
-> Read DescribeAcceleratorAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAcceleratorAttributes]
$creadListPrec :: ReadPrec [DescribeAcceleratorAttributes]
readPrec :: ReadPrec DescribeAcceleratorAttributes
$creadPrec :: ReadPrec DescribeAcceleratorAttributes
readList :: ReadS [DescribeAcceleratorAttributes]
$creadList :: ReadS [DescribeAcceleratorAttributes]
readsPrec :: Int -> ReadS DescribeAcceleratorAttributes
$creadsPrec :: Int -> ReadS DescribeAcceleratorAttributes
Prelude.Read, Int -> DescribeAcceleratorAttributes -> ShowS
[DescribeAcceleratorAttributes] -> ShowS
DescribeAcceleratorAttributes -> String
(Int -> DescribeAcceleratorAttributes -> ShowS)
-> (DescribeAcceleratorAttributes -> String)
-> ([DescribeAcceleratorAttributes] -> ShowS)
-> Show DescribeAcceleratorAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAcceleratorAttributes] -> ShowS
$cshowList :: [DescribeAcceleratorAttributes] -> ShowS
show :: DescribeAcceleratorAttributes -> String
$cshow :: DescribeAcceleratorAttributes -> String
showsPrec :: Int -> DescribeAcceleratorAttributes -> ShowS
$cshowsPrec :: Int -> DescribeAcceleratorAttributes -> ShowS
Prelude.Show, (forall x.
DescribeAcceleratorAttributes
-> Rep DescribeAcceleratorAttributes x)
-> (forall x.
Rep DescribeAcceleratorAttributes x
-> DescribeAcceleratorAttributes)
-> Generic DescribeAcceleratorAttributes
forall x.
Rep DescribeAcceleratorAttributes x
-> DescribeAcceleratorAttributes
forall x.
DescribeAcceleratorAttributes
-> Rep DescribeAcceleratorAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAcceleratorAttributes x
-> DescribeAcceleratorAttributes
$cfrom :: forall x.
DescribeAcceleratorAttributes
-> Rep DescribeAcceleratorAttributes x
Prelude.Generic)
newDescribeAcceleratorAttributes ::
Prelude.Text ->
DescribeAcceleratorAttributes
newDescribeAcceleratorAttributes :: Text -> DescribeAcceleratorAttributes
newDescribeAcceleratorAttributes Text
pAcceleratorArn_ =
DescribeAcceleratorAttributes' :: Text -> DescribeAcceleratorAttributes
DescribeAcceleratorAttributes'
{ $sel:acceleratorArn:DescribeAcceleratorAttributes' :: Text
acceleratorArn =
Text
pAcceleratorArn_
}
describeAcceleratorAttributes_acceleratorArn :: Lens.Lens' DescribeAcceleratorAttributes Prelude.Text
describeAcceleratorAttributes_acceleratorArn :: (Text -> f Text)
-> DescribeAcceleratorAttributes -> f DescribeAcceleratorAttributes
describeAcceleratorAttributes_acceleratorArn = (DescribeAcceleratorAttributes -> Text)
-> (DescribeAcceleratorAttributes
-> Text -> DescribeAcceleratorAttributes)
-> Lens
DescribeAcceleratorAttributes
DescribeAcceleratorAttributes
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAcceleratorAttributes' {Text
acceleratorArn :: Text
$sel:acceleratorArn:DescribeAcceleratorAttributes' :: DescribeAcceleratorAttributes -> Text
acceleratorArn} -> Text
acceleratorArn) (\s :: DescribeAcceleratorAttributes
s@DescribeAcceleratorAttributes' {} Text
a -> DescribeAcceleratorAttributes
s {$sel:acceleratorArn:DescribeAcceleratorAttributes' :: Text
acceleratorArn = Text
a} :: DescribeAcceleratorAttributes)
instance
Core.AWSRequest
DescribeAcceleratorAttributes
where
type
AWSResponse DescribeAcceleratorAttributes =
DescribeAcceleratorAttributesResponse
request :: DescribeAcceleratorAttributes
-> Request DescribeAcceleratorAttributes
request = Service
-> DescribeAcceleratorAttributes
-> Request DescribeAcceleratorAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeAcceleratorAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAcceleratorAttributes)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeAcceleratorAttributes))
-> Logger
-> Service
-> Proxy DescribeAcceleratorAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAcceleratorAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe AcceleratorAttributes
-> Int -> DescribeAcceleratorAttributesResponse
DescribeAcceleratorAttributesResponse'
(Maybe AcceleratorAttributes
-> Int -> DescribeAcceleratorAttributesResponse)
-> Either String (Maybe AcceleratorAttributes)
-> Either String (Int -> DescribeAcceleratorAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AcceleratorAttributes)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AcceleratorAttributes")
Either String (Int -> DescribeAcceleratorAttributesResponse)
-> Either String Int
-> Either String DescribeAcceleratorAttributesResponse
forall (f :: * -> *) a b. Applicative f => 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
DescribeAcceleratorAttributes
instance Prelude.NFData DescribeAcceleratorAttributes
instance Core.ToHeaders DescribeAcceleratorAttributes where
toHeaders :: DescribeAcceleratorAttributes -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeAcceleratorAttributes -> 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
"GlobalAccelerator_V20180706.DescribeAcceleratorAttributes" ::
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 DescribeAcceleratorAttributes where
toJSON :: DescribeAcceleratorAttributes -> Value
toJSON DescribeAcceleratorAttributes' {Text
acceleratorArn :: Text
$sel:acceleratorArn:DescribeAcceleratorAttributes' :: DescribeAcceleratorAttributes -> 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
"AcceleratorArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
acceleratorArn)
]
)
instance Core.ToPath DescribeAcceleratorAttributes where
toPath :: DescribeAcceleratorAttributes -> ByteString
toPath = ByteString -> DescribeAcceleratorAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeAcceleratorAttributes where
toQuery :: DescribeAcceleratorAttributes -> QueryString
toQuery = QueryString -> DescribeAcceleratorAttributes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeAcceleratorAttributesResponse = DescribeAcceleratorAttributesResponse'
{
DescribeAcceleratorAttributesResponse
-> Maybe AcceleratorAttributes
acceleratorAttributes :: Prelude.Maybe AcceleratorAttributes,
DescribeAcceleratorAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeAcceleratorAttributesResponse
-> DescribeAcceleratorAttributesResponse -> Bool
(DescribeAcceleratorAttributesResponse
-> DescribeAcceleratorAttributesResponse -> Bool)
-> (DescribeAcceleratorAttributesResponse
-> DescribeAcceleratorAttributesResponse -> Bool)
-> Eq DescribeAcceleratorAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAcceleratorAttributesResponse
-> DescribeAcceleratorAttributesResponse -> Bool
$c/= :: DescribeAcceleratorAttributesResponse
-> DescribeAcceleratorAttributesResponse -> Bool
== :: DescribeAcceleratorAttributesResponse
-> DescribeAcceleratorAttributesResponse -> Bool
$c== :: DescribeAcceleratorAttributesResponse
-> DescribeAcceleratorAttributesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAcceleratorAttributesResponse]
ReadPrec DescribeAcceleratorAttributesResponse
Int -> ReadS DescribeAcceleratorAttributesResponse
ReadS [DescribeAcceleratorAttributesResponse]
(Int -> ReadS DescribeAcceleratorAttributesResponse)
-> ReadS [DescribeAcceleratorAttributesResponse]
-> ReadPrec DescribeAcceleratorAttributesResponse
-> ReadPrec [DescribeAcceleratorAttributesResponse]
-> Read DescribeAcceleratorAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAcceleratorAttributesResponse]
$creadListPrec :: ReadPrec [DescribeAcceleratorAttributesResponse]
readPrec :: ReadPrec DescribeAcceleratorAttributesResponse
$creadPrec :: ReadPrec DescribeAcceleratorAttributesResponse
readList :: ReadS [DescribeAcceleratorAttributesResponse]
$creadList :: ReadS [DescribeAcceleratorAttributesResponse]
readsPrec :: Int -> ReadS DescribeAcceleratorAttributesResponse
$creadsPrec :: Int -> ReadS DescribeAcceleratorAttributesResponse
Prelude.Read, Int -> DescribeAcceleratorAttributesResponse -> ShowS
[DescribeAcceleratorAttributesResponse] -> ShowS
DescribeAcceleratorAttributesResponse -> String
(Int -> DescribeAcceleratorAttributesResponse -> ShowS)
-> (DescribeAcceleratorAttributesResponse -> String)
-> ([DescribeAcceleratorAttributesResponse] -> ShowS)
-> Show DescribeAcceleratorAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAcceleratorAttributesResponse] -> ShowS
$cshowList :: [DescribeAcceleratorAttributesResponse] -> ShowS
show :: DescribeAcceleratorAttributesResponse -> String
$cshow :: DescribeAcceleratorAttributesResponse -> String
showsPrec :: Int -> DescribeAcceleratorAttributesResponse -> ShowS
$cshowsPrec :: Int -> DescribeAcceleratorAttributesResponse -> ShowS
Prelude.Show, (forall x.
DescribeAcceleratorAttributesResponse
-> Rep DescribeAcceleratorAttributesResponse x)
-> (forall x.
Rep DescribeAcceleratorAttributesResponse x
-> DescribeAcceleratorAttributesResponse)
-> Generic DescribeAcceleratorAttributesResponse
forall x.
Rep DescribeAcceleratorAttributesResponse x
-> DescribeAcceleratorAttributesResponse
forall x.
DescribeAcceleratorAttributesResponse
-> Rep DescribeAcceleratorAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAcceleratorAttributesResponse x
-> DescribeAcceleratorAttributesResponse
$cfrom :: forall x.
DescribeAcceleratorAttributesResponse
-> Rep DescribeAcceleratorAttributesResponse x
Prelude.Generic)
newDescribeAcceleratorAttributesResponse ::
Prelude.Int ->
DescribeAcceleratorAttributesResponse
newDescribeAcceleratorAttributesResponse :: Int -> DescribeAcceleratorAttributesResponse
newDescribeAcceleratorAttributesResponse Int
pHttpStatus_ =
DescribeAcceleratorAttributesResponse' :: Maybe AcceleratorAttributes
-> Int -> DescribeAcceleratorAttributesResponse
DescribeAcceleratorAttributesResponse'
{ $sel:acceleratorAttributes:DescribeAcceleratorAttributesResponse' :: Maybe AcceleratorAttributes
acceleratorAttributes =
Maybe AcceleratorAttributes
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeAcceleratorAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeAcceleratorAttributesResponse_acceleratorAttributes :: Lens.Lens' DescribeAcceleratorAttributesResponse (Prelude.Maybe AcceleratorAttributes)
describeAcceleratorAttributesResponse_acceleratorAttributes :: (Maybe AcceleratorAttributes -> f (Maybe AcceleratorAttributes))
-> DescribeAcceleratorAttributesResponse
-> f DescribeAcceleratorAttributesResponse
describeAcceleratorAttributesResponse_acceleratorAttributes = (DescribeAcceleratorAttributesResponse
-> Maybe AcceleratorAttributes)
-> (DescribeAcceleratorAttributesResponse
-> Maybe AcceleratorAttributes
-> DescribeAcceleratorAttributesResponse)
-> Lens
DescribeAcceleratorAttributesResponse
DescribeAcceleratorAttributesResponse
(Maybe AcceleratorAttributes)
(Maybe AcceleratorAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAcceleratorAttributesResponse' {Maybe AcceleratorAttributes
acceleratorAttributes :: Maybe AcceleratorAttributes
$sel:acceleratorAttributes:DescribeAcceleratorAttributesResponse' :: DescribeAcceleratorAttributesResponse
-> Maybe AcceleratorAttributes
acceleratorAttributes} -> Maybe AcceleratorAttributes
acceleratorAttributes) (\s :: DescribeAcceleratorAttributesResponse
s@DescribeAcceleratorAttributesResponse' {} Maybe AcceleratorAttributes
a -> DescribeAcceleratorAttributesResponse
s {$sel:acceleratorAttributes:DescribeAcceleratorAttributesResponse' :: Maybe AcceleratorAttributes
acceleratorAttributes = Maybe AcceleratorAttributes
a} :: DescribeAcceleratorAttributesResponse)
describeAcceleratorAttributesResponse_httpStatus :: Lens.Lens' DescribeAcceleratorAttributesResponse Prelude.Int
describeAcceleratorAttributesResponse_httpStatus :: (Int -> f Int)
-> DescribeAcceleratorAttributesResponse
-> f DescribeAcceleratorAttributesResponse
describeAcceleratorAttributesResponse_httpStatus = (DescribeAcceleratorAttributesResponse -> Int)
-> (DescribeAcceleratorAttributesResponse
-> Int -> DescribeAcceleratorAttributesResponse)
-> Lens
DescribeAcceleratorAttributesResponse
DescribeAcceleratorAttributesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAcceleratorAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAcceleratorAttributesResponse' :: DescribeAcceleratorAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAcceleratorAttributesResponse
s@DescribeAcceleratorAttributesResponse' {} Int
a -> DescribeAcceleratorAttributesResponse
s {$sel:httpStatus:DescribeAcceleratorAttributesResponse' :: Int
httpStatus = Int
a} :: DescribeAcceleratorAttributesResponse)
instance
Prelude.NFData
DescribeAcceleratorAttributesResponse