{-# 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_agreements,
describeCustomerMetadataResponse_nniPartnerType,
describeCustomerMetadataResponse_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 DescribeCustomerMetadata = DescribeCustomerMetadata'
{
}
deriving (DescribeCustomerMetadata -> DescribeCustomerMetadata -> Bool
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]
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
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.
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 :: (Service -> Service)
-> DescribeCustomerMetadata -> Request DescribeCustomerMetadata
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 DescribeCustomerMetadata
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCustomerMetadata)))
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 [CustomerAgreement]
-> Maybe NniPartnerType -> Int -> DescribeCustomerMetadataResponse
DescribeCustomerMetadataResponse'
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
"agreements" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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
"nniPartnerType")
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 DescribeCustomerMetadata where
hashWithSalt :: Int -> DescribeCustomerMetadata -> Int
hashWithSalt Int
_salt DescribeCustomerMetadata
_ =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()
instance Prelude.NFData DescribeCustomerMetadata where
rnf :: DescribeCustomerMetadata -> ()
rnf DescribeCustomerMetadata
_ = ()
instance Data.ToHeaders DescribeCustomerMetadata where
toHeaders :: DescribeCustomerMetadata -> 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.DescribeCustomerMetadata" ::
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 DescribeCustomerMetadata where
toJSON :: DescribeCustomerMetadata -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath DescribeCustomerMetadata where
toPath :: DescribeCustomerMetadata -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeCustomerMetadata where
toQuery :: DescribeCustomerMetadata -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeCustomerMetadataResponse = DescribeCustomerMetadataResponse'
{
DescribeCustomerMetadataResponse -> Maybe [CustomerAgreement]
agreements :: Prelude.Maybe [CustomerAgreement],
DescribeCustomerMetadataResponse -> Maybe NniPartnerType
nniPartnerType :: Prelude.Maybe NniPartnerType,
DescribeCustomerMetadataResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeCustomerMetadataResponse
-> DescribeCustomerMetadataResponse -> Bool
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]
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
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.
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'
{ $sel:agreements:DescribeCustomerMetadataResponse' :: Maybe [CustomerAgreement]
agreements =
forall a. Maybe a
Prelude.Nothing,
$sel:nniPartnerType:DescribeCustomerMetadataResponse' :: Maybe NniPartnerType
nniPartnerType = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeCustomerMetadataResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeCustomerMetadataResponse_agreements :: Lens.Lens' DescribeCustomerMetadataResponse (Prelude.Maybe [CustomerAgreement])
describeCustomerMetadataResponse_agreements :: Lens' DescribeCustomerMetadataResponse (Maybe [CustomerAgreement])
describeCustomerMetadataResponse_agreements = 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) 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeCustomerMetadataResponse_nniPartnerType :: Lens.Lens' DescribeCustomerMetadataResponse (Prelude.Maybe NniPartnerType)
describeCustomerMetadataResponse_nniPartnerType :: Lens' DescribeCustomerMetadataResponse (Maybe NniPartnerType)
describeCustomerMetadataResponse_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_httpStatus :: Lens.Lens' DescribeCustomerMetadataResponse Prelude.Int
describeCustomerMetadataResponse_httpStatus :: Lens' DescribeCustomerMetadataResponse Int
describeCustomerMetadataResponse_httpStatus = 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
where
rnf :: DescribeCustomerMetadataResponse -> ()
rnf DescribeCustomerMetadataResponse' {Int
Maybe [CustomerAgreement]
Maybe NniPartnerType
httpStatus :: Int
nniPartnerType :: Maybe NniPartnerType
agreements :: Maybe [CustomerAgreement]
$sel:httpStatus:DescribeCustomerMetadataResponse' :: DescribeCustomerMetadataResponse -> Int
$sel:nniPartnerType:DescribeCustomerMetadataResponse' :: DescribeCustomerMetadataResponse -> Maybe NniPartnerType
$sel:agreements:DescribeCustomerMetadataResponse' :: DescribeCustomerMetadataResponse -> Maybe [CustomerAgreement]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [CustomerAgreement]
agreements
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NniPartnerType
nniPartnerType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus