{-# 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.DirectConnect.DescribeLoa
(
DescribeLoa (..),
newDescribeLoa,
describeLoa_loaContentType,
describeLoa_providerName,
describeLoa_connectionId,
DescribeLoaResponse (..),
newDescribeLoaResponse,
describeLoaResponse_loaContent,
describeLoaResponse_loaContentType,
describeLoaResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeLoa = DescribeLoa'
{
DescribeLoa -> Maybe LoaContentType
loaContentType :: Prelude.Maybe LoaContentType,
DescribeLoa -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text,
DescribeLoa -> Text
connectionId :: Prelude.Text
}
deriving (DescribeLoa -> DescribeLoa -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLoa -> DescribeLoa -> Bool
$c/= :: DescribeLoa -> DescribeLoa -> Bool
== :: DescribeLoa -> DescribeLoa -> Bool
$c== :: DescribeLoa -> DescribeLoa -> Bool
Prelude.Eq, ReadPrec [DescribeLoa]
ReadPrec DescribeLoa
Int -> ReadS DescribeLoa
ReadS [DescribeLoa]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLoa]
$creadListPrec :: ReadPrec [DescribeLoa]
readPrec :: ReadPrec DescribeLoa
$creadPrec :: ReadPrec DescribeLoa
readList :: ReadS [DescribeLoa]
$creadList :: ReadS [DescribeLoa]
readsPrec :: Int -> ReadS DescribeLoa
$creadsPrec :: Int -> ReadS DescribeLoa
Prelude.Read, Int -> DescribeLoa -> ShowS
[DescribeLoa] -> ShowS
DescribeLoa -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLoa] -> ShowS
$cshowList :: [DescribeLoa] -> ShowS
show :: DescribeLoa -> String
$cshow :: DescribeLoa -> String
showsPrec :: Int -> DescribeLoa -> ShowS
$cshowsPrec :: Int -> DescribeLoa -> ShowS
Prelude.Show, forall x. Rep DescribeLoa x -> DescribeLoa
forall x. DescribeLoa -> Rep DescribeLoa x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeLoa x -> DescribeLoa
$cfrom :: forall x. DescribeLoa -> Rep DescribeLoa x
Prelude.Generic)
newDescribeLoa ::
Prelude.Text ->
DescribeLoa
newDescribeLoa :: Text -> DescribeLoa
newDescribeLoa Text
pConnectionId_ =
DescribeLoa'
{ $sel:loaContentType:DescribeLoa' :: Maybe LoaContentType
loaContentType = forall a. Maybe a
Prelude.Nothing,
$sel:providerName:DescribeLoa' :: Maybe Text
providerName = forall a. Maybe a
Prelude.Nothing,
$sel:connectionId:DescribeLoa' :: Text
connectionId = Text
pConnectionId_
}
describeLoa_loaContentType :: Lens.Lens' DescribeLoa (Prelude.Maybe LoaContentType)
describeLoa_loaContentType :: Lens' DescribeLoa (Maybe LoaContentType)
describeLoa_loaContentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoa' {Maybe LoaContentType
loaContentType :: Maybe LoaContentType
$sel:loaContentType:DescribeLoa' :: DescribeLoa -> Maybe LoaContentType
loaContentType} -> Maybe LoaContentType
loaContentType) (\s :: DescribeLoa
s@DescribeLoa' {} Maybe LoaContentType
a -> DescribeLoa
s {$sel:loaContentType:DescribeLoa' :: Maybe LoaContentType
loaContentType = Maybe LoaContentType
a} :: DescribeLoa)
describeLoa_providerName :: Lens.Lens' DescribeLoa (Prelude.Maybe Prelude.Text)
describeLoa_providerName :: Lens' DescribeLoa (Maybe Text)
describeLoa_providerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoa' {Maybe Text
providerName :: Maybe Text
$sel:providerName:DescribeLoa' :: DescribeLoa -> Maybe Text
providerName} -> Maybe Text
providerName) (\s :: DescribeLoa
s@DescribeLoa' {} Maybe Text
a -> DescribeLoa
s {$sel:providerName:DescribeLoa' :: Maybe Text
providerName = Maybe Text
a} :: DescribeLoa)
describeLoa_connectionId :: Lens.Lens' DescribeLoa Prelude.Text
describeLoa_connectionId :: Lens' DescribeLoa Text
describeLoa_connectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoa' {Text
connectionId :: Text
$sel:connectionId:DescribeLoa' :: DescribeLoa -> Text
connectionId} -> Text
connectionId) (\s :: DescribeLoa
s@DescribeLoa' {} Text
a -> DescribeLoa
s {$sel:connectionId:DescribeLoa' :: Text
connectionId = Text
a} :: DescribeLoa)
instance Core.AWSRequest DescribeLoa where
type AWSResponse DescribeLoa = DescribeLoaResponse
request :: (Service -> Service) -> DescribeLoa -> Request DescribeLoa
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeLoa
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeLoa)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Base64 -> Maybe LoaContentType -> Int -> DescribeLoaResponse
DescribeLoaResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"loaContent")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"loaContentType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeLoa where
hashWithSalt :: Int -> DescribeLoa -> Int
hashWithSalt Int
_salt DescribeLoa' {Maybe Text
Maybe LoaContentType
Text
connectionId :: Text
providerName :: Maybe Text
loaContentType :: Maybe LoaContentType
$sel:connectionId:DescribeLoa' :: DescribeLoa -> Text
$sel:providerName:DescribeLoa' :: DescribeLoa -> Maybe Text
$sel:loaContentType:DescribeLoa' :: DescribeLoa -> Maybe LoaContentType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoaContentType
loaContentType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
providerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionId
instance Prelude.NFData DescribeLoa where
rnf :: DescribeLoa -> ()
rnf DescribeLoa' {Maybe Text
Maybe LoaContentType
Text
connectionId :: Text
providerName :: Maybe Text
loaContentType :: Maybe LoaContentType
$sel:connectionId:DescribeLoa' :: DescribeLoa -> Text
$sel:providerName:DescribeLoa' :: DescribeLoa -> Maybe Text
$sel:loaContentType:DescribeLoa' :: DescribeLoa -> Maybe LoaContentType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe LoaContentType
loaContentType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
providerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectionId
instance Data.ToHeaders DescribeLoa where
toHeaders :: DescribeLoa -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OvertureService.DescribeLoa" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DescribeLoa where
toJSON :: DescribeLoa -> Value
toJSON DescribeLoa' {Maybe Text
Maybe LoaContentType
Text
connectionId :: Text
providerName :: Maybe Text
loaContentType :: Maybe LoaContentType
$sel:connectionId:DescribeLoa' :: DescribeLoa -> Text
$sel:providerName:DescribeLoa' :: DescribeLoa -> Maybe Text
$sel:loaContentType:DescribeLoa' :: DescribeLoa -> Maybe LoaContentType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"loaContentType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoaContentType
loaContentType,
(Key
"providerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
providerName,
forall a. a -> Maybe a
Prelude.Just (Key
"connectionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectionId)
]
)
instance Data.ToPath DescribeLoa where
toPath :: DescribeLoa -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeLoa where
toQuery :: DescribeLoa -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeLoaResponse = DescribeLoaResponse'
{
DescribeLoaResponse -> Maybe Base64
loaContent :: Prelude.Maybe Data.Base64,
DescribeLoaResponse -> Maybe LoaContentType
loaContentType :: Prelude.Maybe LoaContentType,
DescribeLoaResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeLoaResponse -> DescribeLoaResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLoaResponse -> DescribeLoaResponse -> Bool
$c/= :: DescribeLoaResponse -> DescribeLoaResponse -> Bool
== :: DescribeLoaResponse -> DescribeLoaResponse -> Bool
$c== :: DescribeLoaResponse -> DescribeLoaResponse -> Bool
Prelude.Eq, ReadPrec [DescribeLoaResponse]
ReadPrec DescribeLoaResponse
Int -> ReadS DescribeLoaResponse
ReadS [DescribeLoaResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLoaResponse]
$creadListPrec :: ReadPrec [DescribeLoaResponse]
readPrec :: ReadPrec DescribeLoaResponse
$creadPrec :: ReadPrec DescribeLoaResponse
readList :: ReadS [DescribeLoaResponse]
$creadList :: ReadS [DescribeLoaResponse]
readsPrec :: Int -> ReadS DescribeLoaResponse
$creadsPrec :: Int -> ReadS DescribeLoaResponse
Prelude.Read, Int -> DescribeLoaResponse -> ShowS
[DescribeLoaResponse] -> ShowS
DescribeLoaResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLoaResponse] -> ShowS
$cshowList :: [DescribeLoaResponse] -> ShowS
show :: DescribeLoaResponse -> String
$cshow :: DescribeLoaResponse -> String
showsPrec :: Int -> DescribeLoaResponse -> ShowS
$cshowsPrec :: Int -> DescribeLoaResponse -> ShowS
Prelude.Show, forall x. Rep DescribeLoaResponse x -> DescribeLoaResponse
forall x. DescribeLoaResponse -> Rep DescribeLoaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeLoaResponse x -> DescribeLoaResponse
$cfrom :: forall x. DescribeLoaResponse -> Rep DescribeLoaResponse x
Prelude.Generic)
newDescribeLoaResponse ::
Prelude.Int ->
DescribeLoaResponse
newDescribeLoaResponse :: Int -> DescribeLoaResponse
newDescribeLoaResponse Int
pHttpStatus_ =
DescribeLoaResponse'
{ $sel:loaContent:DescribeLoaResponse' :: Maybe Base64
loaContent = forall a. Maybe a
Prelude.Nothing,
$sel:loaContentType:DescribeLoaResponse' :: Maybe LoaContentType
loaContentType = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeLoaResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeLoaResponse_loaContent :: Lens.Lens' DescribeLoaResponse (Prelude.Maybe Prelude.ByteString)
describeLoaResponse_loaContent :: Lens' DescribeLoaResponse (Maybe ByteString)
describeLoaResponse_loaContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoaResponse' {Maybe Base64
loaContent :: Maybe Base64
$sel:loaContent:DescribeLoaResponse' :: DescribeLoaResponse -> Maybe Base64
loaContent} -> Maybe Base64
loaContent) (\s :: DescribeLoaResponse
s@DescribeLoaResponse' {} Maybe Base64
a -> DescribeLoaResponse
s {$sel:loaContent:DescribeLoaResponse' :: Maybe Base64
loaContent = Maybe Base64
a} :: DescribeLoaResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping Iso' Base64 ByteString
Data._Base64
describeLoaResponse_loaContentType :: Lens.Lens' DescribeLoaResponse (Prelude.Maybe LoaContentType)
describeLoaResponse_loaContentType :: Lens' DescribeLoaResponse (Maybe LoaContentType)
describeLoaResponse_loaContentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoaResponse' {Maybe LoaContentType
loaContentType :: Maybe LoaContentType
$sel:loaContentType:DescribeLoaResponse' :: DescribeLoaResponse -> Maybe LoaContentType
loaContentType} -> Maybe LoaContentType
loaContentType) (\s :: DescribeLoaResponse
s@DescribeLoaResponse' {} Maybe LoaContentType
a -> DescribeLoaResponse
s {$sel:loaContentType:DescribeLoaResponse' :: Maybe LoaContentType
loaContentType = Maybe LoaContentType
a} :: DescribeLoaResponse)
describeLoaResponse_httpStatus :: Lens.Lens' DescribeLoaResponse Prelude.Int
describeLoaResponse_httpStatus :: Lens' DescribeLoaResponse Int
describeLoaResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoaResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeLoaResponse' :: DescribeLoaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeLoaResponse
s@DescribeLoaResponse' {} Int
a -> DescribeLoaResponse
s {$sel:httpStatus:DescribeLoaResponse' :: Int
httpStatus = Int
a} :: DescribeLoaResponse)
instance Prelude.NFData DescribeLoaResponse where
rnf :: DescribeLoaResponse -> ()
rnf DescribeLoaResponse' {Int
Maybe Base64
Maybe LoaContentType
httpStatus :: Int
loaContentType :: Maybe LoaContentType
loaContent :: Maybe Base64
$sel:httpStatus:DescribeLoaResponse' :: DescribeLoaResponse -> Int
$sel:loaContentType:DescribeLoaResponse' :: DescribeLoaResponse -> Maybe LoaContentType
$sel:loaContent:DescribeLoaResponse' :: DescribeLoaResponse -> Maybe Base64
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Base64
loaContent
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LoaContentType
loaContentType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus