{-# 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.DescribeCustomerMetadata
(
DescribeCustomerMetadata (..),
newDescribeCustomerMetadata,
DescribeCustomerMetadataResponse (..),
newDescribeCustomerMetadataResponse,
describeCustomerMetadataResponse_nniPartnerType,
describeCustomerMetadataResponse_agreements,
describeCustomerMetadataResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.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 DescribeCustomerMetadata = DescribeCustomerMetadata'
{
}
deriving (DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool
(DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool)
-> (DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool)
-> Eq DescribeCustomerMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool
$c/= :: DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool
== :: DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool
$c== :: DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool
Prelude.Eq, ReadPrec [DescribeCustomerMetadata]
ReadPrec DescribeCustomerMetadata
Int -> ReadS DescribeCustomerMetadata
ReadS [DescribeCustomerMetadata]
(Int -> ReadS DescribeCustomerMetadata)
-> ReadS [DescribeCustomerMetadata]
-> ReadPrec DescribeCustomerMetadata
-> ReadPrec [DescribeCustomerMetadata]
-> Read DescribeCustomerMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomerMetadata]
$creadListPrec :: ReadPrec [DescribeCustomerMetadata]
readPrec :: ReadPrec DescribeCustomerMetadata
$creadPrec :: ReadPrec DescribeCustomerMetadata
readList :: ReadS [DescribeCustomerMetadata]
$creadList :: ReadS [DescribeCustomerMetadata]
readsPrec :: Int -> ReadS DescribeCustomerMetadata
$creadsPrec :: Int -> ReadS DescribeCustomerMetadata
Prelude.Read, Int -> DescribeCustomerMetadata -> ShowS
[DescribeCustomerMetadata] -> ShowS
DescribeCustomerMetadata -> String
(Int -> DescribeCustomerMetadata -> ShowS)
-> (DescribeCustomerMetadata -> String)
-> ([DescribeCustomerMetadata] -> ShowS)
-> Show DescribeCustomerMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomerMetadata] -> ShowS
$cshowList :: [DescribeCustomerMetadata] -> ShowS
show :: DescribeCustomerMetadata -> String
$cshow :: DescribeCustomerMetadata -> String
showsPrec :: Int -> DescribeCustomerMetadata -> ShowS
$cshowsPrec :: Int -> DescribeCustomerMetadata -> ShowS
Prelude.Show, (forall x.
DescribeCustomerMetadata -> Rep DescribeCustomerMetadata x)
-> (forall x.
Rep DescribeCustomerMetadata x -> DescribeCustomerMetadata)
-> Generic DescribeCustomerMetadata
forall x.
Rep DescribeCustomerMetadata x -> DescribeCustomerMetadata
forall x.
DescribeCustomerMetadata -> Rep DescribeCustomerMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCustomerMetadata x -> DescribeCustomerMetadata
$cfrom :: forall x.
DescribeCustomerMetadata -> Rep DescribeCustomerMetadata x
Prelude.Generic)
newDescribeCustomerMetadata ::
DescribeCustomerMetadata
newDescribeCustomerMetadata :: DescribeCustomerMetadata
newDescribeCustomerMetadata =
DescribeCustomerMetadata
DescribeCustomerMetadata'
instance Core.AWSRequest DescribeCustomerMetadata where
type
AWSResponse DescribeCustomerMetadata =
DescribeCustomerMetadataResponse
request :: DescribeCustomerMetadata -> Request DescribeCustomerMetadata
request = Service
-> DescribeCustomerMetadata -> Request DescribeCustomerMetadata
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeCustomerMetadata
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCustomerMetadata)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeCustomerMetadata))
-> Logger
-> Service
-> Proxy DescribeCustomerMetadata
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCustomerMetadata)))
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 NniPartnerType
-> Maybe [CustomerAgreement]
-> Int
-> DescribeCustomerMetadataResponse
DescribeCustomerMetadataResponse'
(Maybe NniPartnerType
-> Maybe [CustomerAgreement]
-> Int
-> DescribeCustomerMetadataResponse)
-> Either String (Maybe NniPartnerType)
-> Either
String
(Maybe [CustomerAgreement]
-> Int -> DescribeCustomerMetadataResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Key -> Either String (Maybe NniPartnerType)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"nniPartnerType")
Either
String
(Maybe [CustomerAgreement]
-> Int -> DescribeCustomerMetadataResponse)
-> Either String (Maybe [CustomerAgreement])
-> Either String (Int -> DescribeCustomerMetadataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Key -> Either String (Maybe (Maybe [CustomerAgreement]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"agreements" Either String (Maybe (Maybe [CustomerAgreement]))
-> Maybe [CustomerAgreement]
-> Either String (Maybe [CustomerAgreement])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CustomerAgreement]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeCustomerMetadataResponse)
-> Either String Int
-> Either String DescribeCustomerMetadataResponse
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 DescribeCustomerMetadata
instance Prelude.NFData DescribeCustomerMetadata
instance Core.ToHeaders DescribeCustomerMetadata where
toHeaders :: DescribeCustomerMetadata -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeCustomerMetadata -> 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
"OvertureService.DescribeCustomerMetadata" ::
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 DescribeCustomerMetadata where
toJSON :: DescribeCustomerMetadata -> Value
toJSON = Value -> DescribeCustomerMetadata -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DescribeCustomerMetadata where
toPath :: DescribeCustomerMetadata -> ByteString
toPath = ByteString -> DescribeCustomerMetadata -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeCustomerMetadata where
toQuery :: DescribeCustomerMetadata -> QueryString
toQuery = QueryString -> DescribeCustomerMetadata -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeCustomerMetadataResponse = DescribeCustomerMetadataResponse'
{
DescribeCustomerMetadataResponse -> Maybe NniPartnerType
nniPartnerType :: Prelude.Maybe NniPartnerType,
DescribeCustomerMetadataResponse -> Maybe [CustomerAgreement]
agreements :: Prelude.Maybe [CustomerAgreement],
DescribeCustomerMetadataResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool
(DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool)
-> (DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool)
-> Eq DescribeCustomerMetadataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool
$c/= :: DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool
== :: DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool
$c== :: DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCustomerMetadataResponse]
ReadPrec DescribeCustomerMetadataResponse
Int -> ReadS DescribeCustomerMetadataResponse
ReadS [DescribeCustomerMetadataResponse]
(Int -> ReadS DescribeCustomerMetadataResponse)
-> ReadS [DescribeCustomerMetadataResponse]
-> ReadPrec DescribeCustomerMetadataResponse
-> ReadPrec [DescribeCustomerMetadataResponse]
-> Read DescribeCustomerMetadataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomerMetadataResponse]
$creadListPrec :: ReadPrec [DescribeCustomerMetadataResponse]
readPrec :: ReadPrec DescribeCustomerMetadataResponse
$creadPrec :: ReadPrec DescribeCustomerMetadataResponse
readList :: ReadS [DescribeCustomerMetadataResponse]
$creadList :: ReadS [DescribeCustomerMetadataResponse]
readsPrec :: Int -> ReadS DescribeCustomerMetadataResponse
$creadsPrec :: Int -> ReadS DescribeCustomerMetadataResponse
Prelude.Read, Int -> DescribeCustomerMetadataResponse -> ShowS
[DescribeCustomerMetadataResponse] -> ShowS
DescribeCustomerMetadataResponse -> String
(Int -> DescribeCustomerMetadataResponse -> ShowS)
-> (DescribeCustomerMetadataResponse -> String)
-> ([DescribeCustomerMetadataResponse] -> ShowS)
-> Show DescribeCustomerMetadataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomerMetadataResponse] -> ShowS
$cshowList :: [DescribeCustomerMetadataResponse] -> ShowS
show :: DescribeCustomerMetadataResponse -> String
$cshow :: DescribeCustomerMetadataResponse -> String
showsPrec :: Int -> DescribeCustomerMetadataResponse -> ShowS
$cshowsPrec :: Int -> DescribeCustomerMetadataResponse -> ShowS
Prelude.Show, (forall x.
DescribeCustomerMetadataResponse
-> Rep DescribeCustomerMetadataResponse x)
-> (forall x.
Rep DescribeCustomerMetadataResponse x
-> DescribeCustomerMetadataResponse)
-> Generic DescribeCustomerMetadataResponse
forall x.
Rep DescribeCustomerMetadataResponse x
-> DescribeCustomerMetadataResponse
forall x.
DescribeCustomerMetadataResponse
-> Rep DescribeCustomerMetadataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCustomerMetadataResponse x
-> DescribeCustomerMetadataResponse
$cfrom :: forall x.
DescribeCustomerMetadataResponse
-> Rep DescribeCustomerMetadataResponse x
Prelude.Generic)
newDescribeCustomerMetadataResponse ::
Prelude.Int ->
DescribeCustomerMetadataResponse
newDescribeCustomerMetadataResponse :: Int -> DescribeCustomerMetadataResponse
newDescribeCustomerMetadataResponse Int
pHttpStatus_ =
DescribeCustomerMetadataResponse' :: Maybe NniPartnerType
-> Maybe [CustomerAgreement]
-> Int
-> DescribeCustomerMetadataResponse
DescribeCustomerMetadataResponse'
{ $sel:nniPartnerType:DescribeCustomerMetadataResponse' :: Maybe NniPartnerType
nniPartnerType =
Maybe NniPartnerType
forall a. Maybe a
Prelude.Nothing,
$sel:agreements:DescribeCustomerMetadataResponse' :: Maybe [CustomerAgreement]
agreements = Maybe [CustomerAgreement]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeCustomerMetadataResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeCustomerMetadataResponse_nniPartnerType :: Lens.Lens' DescribeCustomerMetadataResponse (Prelude.Maybe NniPartnerType)
describeCustomerMetadataResponse_nniPartnerType :: (Maybe NniPartnerType -> f (Maybe NniPartnerType))
-> DescribeCustomerMetadataResponse
-> f DescribeCustomerMetadataResponse
describeCustomerMetadataResponse_nniPartnerType = (DescribeCustomerMetadataResponse -> Maybe NniPartnerType)
-> (DescribeCustomerMetadataResponse
-> Maybe NniPartnerType -> DescribeCustomerMetadataResponse)
-> Lens
DescribeCustomerMetadataResponse
DescribeCustomerMetadataResponse
(Maybe NniPartnerType)
(Maybe NniPartnerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomerMetadataResponse' {Maybe NniPartnerType
nniPartnerType :: Maybe NniPartnerType
$sel:nniPartnerType:DescribeCustomerMetadataResponse' :: DescribeCustomerMetadataResponse -> Maybe NniPartnerType
nniPartnerType} -> Maybe NniPartnerType
nniPartnerType) (\s :: DescribeCustomerMetadataResponse
s@DescribeCustomerMetadataResponse' {} Maybe NniPartnerType
a -> DescribeCustomerMetadataResponse
s {$sel:nniPartnerType:DescribeCustomerMetadataResponse' :: Maybe NniPartnerType
nniPartnerType = Maybe NniPartnerType
a} :: DescribeCustomerMetadataResponse)
describeCustomerMetadataResponse_agreements :: Lens.Lens' DescribeCustomerMetadataResponse (Prelude.Maybe [CustomerAgreement])
describeCustomerMetadataResponse_agreements :: (Maybe [CustomerAgreement] -> f (Maybe [CustomerAgreement]))
-> DescribeCustomerMetadataResponse
-> f DescribeCustomerMetadataResponse
describeCustomerMetadataResponse_agreements = (DescribeCustomerMetadataResponse -> Maybe [CustomerAgreement])
-> (DescribeCustomerMetadataResponse
-> Maybe [CustomerAgreement] -> DescribeCustomerMetadataResponse)
-> Lens
DescribeCustomerMetadataResponse
DescribeCustomerMetadataResponse
(Maybe [CustomerAgreement])
(Maybe [CustomerAgreement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomerMetadataResponse' {Maybe [CustomerAgreement]
agreements :: Maybe [CustomerAgreement]
$sel:agreements:DescribeCustomerMetadataResponse' :: DescribeCustomerMetadataResponse -> Maybe [CustomerAgreement]
agreements} -> Maybe [CustomerAgreement]
agreements) (\s :: DescribeCustomerMetadataResponse
s@DescribeCustomerMetadataResponse' {} Maybe [CustomerAgreement]
a -> DescribeCustomerMetadataResponse
s {$sel:agreements:DescribeCustomerMetadataResponse' :: Maybe [CustomerAgreement]
agreements = Maybe [CustomerAgreement]
a} :: DescribeCustomerMetadataResponse) ((Maybe [CustomerAgreement] -> f (Maybe [CustomerAgreement]))
-> DescribeCustomerMetadataResponse
-> f DescribeCustomerMetadataResponse)
-> ((Maybe [CustomerAgreement] -> f (Maybe [CustomerAgreement]))
-> Maybe [CustomerAgreement] -> f (Maybe [CustomerAgreement]))
-> (Maybe [CustomerAgreement] -> f (Maybe [CustomerAgreement]))
-> DescribeCustomerMetadataResponse
-> f DescribeCustomerMetadataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CustomerAgreement]
[CustomerAgreement]
[CustomerAgreement]
[CustomerAgreement]
-> Iso
(Maybe [CustomerAgreement])
(Maybe [CustomerAgreement])
(Maybe [CustomerAgreement])
(Maybe [CustomerAgreement])
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 AnIso
[CustomerAgreement]
[CustomerAgreement]
[CustomerAgreement]
[CustomerAgreement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeCustomerMetadataResponse_httpStatus :: Lens.Lens' DescribeCustomerMetadataResponse Prelude.Int
describeCustomerMetadataResponse_httpStatus :: (Int -> f Int)
-> DescribeCustomerMetadataResponse
-> f DescribeCustomerMetadataResponse
describeCustomerMetadataResponse_httpStatus = (DescribeCustomerMetadataResponse -> Int)
-> (DescribeCustomerMetadataResponse
-> Int -> DescribeCustomerMetadataResponse)
-> Lens
DescribeCustomerMetadataResponse
DescribeCustomerMetadataResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomerMetadataResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeCustomerMetadataResponse' :: DescribeCustomerMetadataResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeCustomerMetadataResponse
s@DescribeCustomerMetadataResponse' {} Int
a -> DescribeCustomerMetadataResponse
s {$sel:httpStatus:DescribeCustomerMetadataResponse' :: Int
httpStatus = Int
a} :: DescribeCustomerMetadataResponse)
instance
Prelude.NFData
DescribeCustomerMetadataResponse