{-# 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.CloudDirectory.GetTypedLinkFacetInformation
(
GetTypedLinkFacetInformation (..),
newGetTypedLinkFacetInformation,
getTypedLinkFacetInformation_schemaArn,
getTypedLinkFacetInformation_name,
GetTypedLinkFacetInformationResponse (..),
newGetTypedLinkFacetInformationResponse,
getTypedLinkFacetInformationResponse_identityAttributeOrder,
getTypedLinkFacetInformationResponse_httpStatus,
)
where
import Amazonka.CloudDirectory.Types
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
data GetTypedLinkFacetInformation = GetTypedLinkFacetInformation'
{
GetTypedLinkFacetInformation -> Text
schemaArn :: Prelude.Text,
GetTypedLinkFacetInformation -> Text
name :: Prelude.Text
}
deriving (GetTypedLinkFacetInformation
-> GetTypedLinkFacetInformation -> Bool
(GetTypedLinkFacetInformation
-> GetTypedLinkFacetInformation -> Bool)
-> (GetTypedLinkFacetInformation
-> GetTypedLinkFacetInformation -> Bool)
-> Eq GetTypedLinkFacetInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTypedLinkFacetInformation
-> GetTypedLinkFacetInformation -> Bool
$c/= :: GetTypedLinkFacetInformation
-> GetTypedLinkFacetInformation -> Bool
== :: GetTypedLinkFacetInformation
-> GetTypedLinkFacetInformation -> Bool
$c== :: GetTypedLinkFacetInformation
-> GetTypedLinkFacetInformation -> Bool
Prelude.Eq, ReadPrec [GetTypedLinkFacetInformation]
ReadPrec GetTypedLinkFacetInformation
Int -> ReadS GetTypedLinkFacetInformation
ReadS [GetTypedLinkFacetInformation]
(Int -> ReadS GetTypedLinkFacetInformation)
-> ReadS [GetTypedLinkFacetInformation]
-> ReadPrec GetTypedLinkFacetInformation
-> ReadPrec [GetTypedLinkFacetInformation]
-> Read GetTypedLinkFacetInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTypedLinkFacetInformation]
$creadListPrec :: ReadPrec [GetTypedLinkFacetInformation]
readPrec :: ReadPrec GetTypedLinkFacetInformation
$creadPrec :: ReadPrec GetTypedLinkFacetInformation
readList :: ReadS [GetTypedLinkFacetInformation]
$creadList :: ReadS [GetTypedLinkFacetInformation]
readsPrec :: Int -> ReadS GetTypedLinkFacetInformation
$creadsPrec :: Int -> ReadS GetTypedLinkFacetInformation
Prelude.Read, Int -> GetTypedLinkFacetInformation -> ShowS
[GetTypedLinkFacetInformation] -> ShowS
GetTypedLinkFacetInformation -> String
(Int -> GetTypedLinkFacetInformation -> ShowS)
-> (GetTypedLinkFacetInformation -> String)
-> ([GetTypedLinkFacetInformation] -> ShowS)
-> Show GetTypedLinkFacetInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTypedLinkFacetInformation] -> ShowS
$cshowList :: [GetTypedLinkFacetInformation] -> ShowS
show :: GetTypedLinkFacetInformation -> String
$cshow :: GetTypedLinkFacetInformation -> String
showsPrec :: Int -> GetTypedLinkFacetInformation -> ShowS
$cshowsPrec :: Int -> GetTypedLinkFacetInformation -> ShowS
Prelude.Show, (forall x.
GetTypedLinkFacetInformation -> Rep GetTypedLinkFacetInformation x)
-> (forall x.
Rep GetTypedLinkFacetInformation x -> GetTypedLinkFacetInformation)
-> Generic GetTypedLinkFacetInformation
forall x.
Rep GetTypedLinkFacetInformation x -> GetTypedLinkFacetInformation
forall x.
GetTypedLinkFacetInformation -> Rep GetTypedLinkFacetInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTypedLinkFacetInformation x -> GetTypedLinkFacetInformation
$cfrom :: forall x.
GetTypedLinkFacetInformation -> Rep GetTypedLinkFacetInformation x
Prelude.Generic)
newGetTypedLinkFacetInformation ::
Prelude.Text ->
Prelude.Text ->
GetTypedLinkFacetInformation
newGetTypedLinkFacetInformation :: Text -> Text -> GetTypedLinkFacetInformation
newGetTypedLinkFacetInformation Text
pSchemaArn_ Text
pName_ =
GetTypedLinkFacetInformation' :: Text -> Text -> GetTypedLinkFacetInformation
GetTypedLinkFacetInformation'
{ $sel:schemaArn:GetTypedLinkFacetInformation' :: Text
schemaArn =
Text
pSchemaArn_,
$sel:name:GetTypedLinkFacetInformation' :: Text
name = Text
pName_
}
getTypedLinkFacetInformation_schemaArn :: Lens.Lens' GetTypedLinkFacetInformation Prelude.Text
getTypedLinkFacetInformation_schemaArn :: (Text -> f Text)
-> GetTypedLinkFacetInformation -> f GetTypedLinkFacetInformation
getTypedLinkFacetInformation_schemaArn = (GetTypedLinkFacetInformation -> Text)
-> (GetTypedLinkFacetInformation
-> Text -> GetTypedLinkFacetInformation)
-> Lens
GetTypedLinkFacetInformation GetTypedLinkFacetInformation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTypedLinkFacetInformation' {Text
schemaArn :: Text
$sel:schemaArn:GetTypedLinkFacetInformation' :: GetTypedLinkFacetInformation -> Text
schemaArn} -> Text
schemaArn) (\s :: GetTypedLinkFacetInformation
s@GetTypedLinkFacetInformation' {} Text
a -> GetTypedLinkFacetInformation
s {$sel:schemaArn:GetTypedLinkFacetInformation' :: Text
schemaArn = Text
a} :: GetTypedLinkFacetInformation)
getTypedLinkFacetInformation_name :: Lens.Lens' GetTypedLinkFacetInformation Prelude.Text
getTypedLinkFacetInformation_name :: (Text -> f Text)
-> GetTypedLinkFacetInformation -> f GetTypedLinkFacetInformation
getTypedLinkFacetInformation_name = (GetTypedLinkFacetInformation -> Text)
-> (GetTypedLinkFacetInformation
-> Text -> GetTypedLinkFacetInformation)
-> Lens
GetTypedLinkFacetInformation GetTypedLinkFacetInformation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTypedLinkFacetInformation' {Text
name :: Text
$sel:name:GetTypedLinkFacetInformation' :: GetTypedLinkFacetInformation -> Text
name} -> Text
name) (\s :: GetTypedLinkFacetInformation
s@GetTypedLinkFacetInformation' {} Text
a -> GetTypedLinkFacetInformation
s {$sel:name:GetTypedLinkFacetInformation' :: Text
name = Text
a} :: GetTypedLinkFacetInformation)
instance Core.AWSRequest GetTypedLinkFacetInformation where
type
AWSResponse GetTypedLinkFacetInformation =
GetTypedLinkFacetInformationResponse
request :: GetTypedLinkFacetInformation
-> Request GetTypedLinkFacetInformation
request = Service
-> GetTypedLinkFacetInformation
-> Request GetTypedLinkFacetInformation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetTypedLinkFacetInformation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetTypedLinkFacetInformation)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetTypedLinkFacetInformation))
-> Logger
-> Service
-> Proxy GetTypedLinkFacetInformation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetTypedLinkFacetInformation)))
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 [Text] -> Int -> GetTypedLinkFacetInformationResponse
GetTypedLinkFacetInformationResponse'
(Maybe [Text] -> Int -> GetTypedLinkFacetInformationResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> GetTypedLinkFacetInformationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IdentityAttributeOrder"
Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> GetTypedLinkFacetInformationResponse)
-> Either String Int
-> Either String GetTypedLinkFacetInformationResponse
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
GetTypedLinkFacetInformation
instance Prelude.NFData GetTypedLinkFacetInformation
instance Core.ToHeaders GetTypedLinkFacetInformation where
toHeaders :: GetTypedLinkFacetInformation -> ResponseHeaders
toHeaders GetTypedLinkFacetInformation' {Text
name :: Text
schemaArn :: Text
$sel:name:GetTypedLinkFacetInformation' :: GetTypedLinkFacetInformation -> Text
$sel:schemaArn:GetTypedLinkFacetInformation' :: GetTypedLinkFacetInformation -> Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-data-partition" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
schemaArn]
instance Core.ToJSON GetTypedLinkFacetInformation where
toJSON :: GetTypedLinkFacetInformation -> Value
toJSON GetTypedLinkFacetInformation' {Text
name :: Text
schemaArn :: Text
$sel:name:GetTypedLinkFacetInformation' :: GetTypedLinkFacetInformation -> Text
$sel:schemaArn:GetTypedLinkFacetInformation' :: GetTypedLinkFacetInformation -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath GetTypedLinkFacetInformation where
toPath :: GetTypedLinkFacetInformation -> ByteString
toPath =
ByteString -> GetTypedLinkFacetInformation -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/amazonclouddirectory/2017-01-11/typedlink/facet/get"
instance Core.ToQuery GetTypedLinkFacetInformation where
toQuery :: GetTypedLinkFacetInformation -> QueryString
toQuery = QueryString -> GetTypedLinkFacetInformation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetTypedLinkFacetInformationResponse = GetTypedLinkFacetInformationResponse'
{
GetTypedLinkFacetInformationResponse -> Maybe [Text]
identityAttributeOrder :: Prelude.Maybe [Prelude.Text],
GetTypedLinkFacetInformationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetTypedLinkFacetInformationResponse
-> GetTypedLinkFacetInformationResponse -> Bool
(GetTypedLinkFacetInformationResponse
-> GetTypedLinkFacetInformationResponse -> Bool)
-> (GetTypedLinkFacetInformationResponse
-> GetTypedLinkFacetInformationResponse -> Bool)
-> Eq GetTypedLinkFacetInformationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTypedLinkFacetInformationResponse
-> GetTypedLinkFacetInformationResponse -> Bool
$c/= :: GetTypedLinkFacetInformationResponse
-> GetTypedLinkFacetInformationResponse -> Bool
== :: GetTypedLinkFacetInformationResponse
-> GetTypedLinkFacetInformationResponse -> Bool
$c== :: GetTypedLinkFacetInformationResponse
-> GetTypedLinkFacetInformationResponse -> Bool
Prelude.Eq, ReadPrec [GetTypedLinkFacetInformationResponse]
ReadPrec GetTypedLinkFacetInformationResponse
Int -> ReadS GetTypedLinkFacetInformationResponse
ReadS [GetTypedLinkFacetInformationResponse]
(Int -> ReadS GetTypedLinkFacetInformationResponse)
-> ReadS [GetTypedLinkFacetInformationResponse]
-> ReadPrec GetTypedLinkFacetInformationResponse
-> ReadPrec [GetTypedLinkFacetInformationResponse]
-> Read GetTypedLinkFacetInformationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTypedLinkFacetInformationResponse]
$creadListPrec :: ReadPrec [GetTypedLinkFacetInformationResponse]
readPrec :: ReadPrec GetTypedLinkFacetInformationResponse
$creadPrec :: ReadPrec GetTypedLinkFacetInformationResponse
readList :: ReadS [GetTypedLinkFacetInformationResponse]
$creadList :: ReadS [GetTypedLinkFacetInformationResponse]
readsPrec :: Int -> ReadS GetTypedLinkFacetInformationResponse
$creadsPrec :: Int -> ReadS GetTypedLinkFacetInformationResponse
Prelude.Read, Int -> GetTypedLinkFacetInformationResponse -> ShowS
[GetTypedLinkFacetInformationResponse] -> ShowS
GetTypedLinkFacetInformationResponse -> String
(Int -> GetTypedLinkFacetInformationResponse -> ShowS)
-> (GetTypedLinkFacetInformationResponse -> String)
-> ([GetTypedLinkFacetInformationResponse] -> ShowS)
-> Show GetTypedLinkFacetInformationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTypedLinkFacetInformationResponse] -> ShowS
$cshowList :: [GetTypedLinkFacetInformationResponse] -> ShowS
show :: GetTypedLinkFacetInformationResponse -> String
$cshow :: GetTypedLinkFacetInformationResponse -> String
showsPrec :: Int -> GetTypedLinkFacetInformationResponse -> ShowS
$cshowsPrec :: Int -> GetTypedLinkFacetInformationResponse -> ShowS
Prelude.Show, (forall x.
GetTypedLinkFacetInformationResponse
-> Rep GetTypedLinkFacetInformationResponse x)
-> (forall x.
Rep GetTypedLinkFacetInformationResponse x
-> GetTypedLinkFacetInformationResponse)
-> Generic GetTypedLinkFacetInformationResponse
forall x.
Rep GetTypedLinkFacetInformationResponse x
-> GetTypedLinkFacetInformationResponse
forall x.
GetTypedLinkFacetInformationResponse
-> Rep GetTypedLinkFacetInformationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTypedLinkFacetInformationResponse x
-> GetTypedLinkFacetInformationResponse
$cfrom :: forall x.
GetTypedLinkFacetInformationResponse
-> Rep GetTypedLinkFacetInformationResponse x
Prelude.Generic)
newGetTypedLinkFacetInformationResponse ::
Prelude.Int ->
GetTypedLinkFacetInformationResponse
newGetTypedLinkFacetInformationResponse :: Int -> GetTypedLinkFacetInformationResponse
newGetTypedLinkFacetInformationResponse Int
pHttpStatus_ =
GetTypedLinkFacetInformationResponse' :: Maybe [Text] -> Int -> GetTypedLinkFacetInformationResponse
GetTypedLinkFacetInformationResponse'
{ $sel:identityAttributeOrder:GetTypedLinkFacetInformationResponse' :: Maybe [Text]
identityAttributeOrder =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetTypedLinkFacetInformationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getTypedLinkFacetInformationResponse_identityAttributeOrder :: Lens.Lens' GetTypedLinkFacetInformationResponse (Prelude.Maybe [Prelude.Text])
getTypedLinkFacetInformationResponse_identityAttributeOrder :: (Maybe [Text] -> f (Maybe [Text]))
-> GetTypedLinkFacetInformationResponse
-> f GetTypedLinkFacetInformationResponse
getTypedLinkFacetInformationResponse_identityAttributeOrder = (GetTypedLinkFacetInformationResponse -> Maybe [Text])
-> (GetTypedLinkFacetInformationResponse
-> Maybe [Text] -> GetTypedLinkFacetInformationResponse)
-> Lens
GetTypedLinkFacetInformationResponse
GetTypedLinkFacetInformationResponse
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTypedLinkFacetInformationResponse' {Maybe [Text]
identityAttributeOrder :: Maybe [Text]
$sel:identityAttributeOrder:GetTypedLinkFacetInformationResponse' :: GetTypedLinkFacetInformationResponse -> Maybe [Text]
identityAttributeOrder} -> Maybe [Text]
identityAttributeOrder) (\s :: GetTypedLinkFacetInformationResponse
s@GetTypedLinkFacetInformationResponse' {} Maybe [Text]
a -> GetTypedLinkFacetInformationResponse
s {$sel:identityAttributeOrder:GetTypedLinkFacetInformationResponse' :: Maybe [Text]
identityAttributeOrder = Maybe [Text]
a} :: GetTypedLinkFacetInformationResponse) ((Maybe [Text] -> f (Maybe [Text]))
-> GetTypedLinkFacetInformationResponse
-> f GetTypedLinkFacetInformationResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetTypedLinkFacetInformationResponse
-> f GetTypedLinkFacetInformationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getTypedLinkFacetInformationResponse_httpStatus :: Lens.Lens' GetTypedLinkFacetInformationResponse Prelude.Int
getTypedLinkFacetInformationResponse_httpStatus :: (Int -> f Int)
-> GetTypedLinkFacetInformationResponse
-> f GetTypedLinkFacetInformationResponse
getTypedLinkFacetInformationResponse_httpStatus = (GetTypedLinkFacetInformationResponse -> Int)
-> (GetTypedLinkFacetInformationResponse
-> Int -> GetTypedLinkFacetInformationResponse)
-> Lens
GetTypedLinkFacetInformationResponse
GetTypedLinkFacetInformationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTypedLinkFacetInformationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTypedLinkFacetInformationResponse' :: GetTypedLinkFacetInformationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTypedLinkFacetInformationResponse
s@GetTypedLinkFacetInformationResponse' {} Int
a -> GetTypedLinkFacetInformationResponse
s {$sel:httpStatus:GetTypedLinkFacetInformationResponse' :: Int
httpStatus = Int
a} :: GetTypedLinkFacetInformationResponse)
instance
Prelude.NFData
GetTypedLinkFacetInformationResponse