{-# 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.DirectoryService.VerifyTrust
(
VerifyTrust (..),
newVerifyTrust,
verifyTrust_trustId,
VerifyTrustResponse (..),
newVerifyTrustResponse,
verifyTrustResponse_trustId,
verifyTrustResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.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 VerifyTrust = VerifyTrust'
{
VerifyTrust -> Text
trustId :: Prelude.Text
}
deriving (VerifyTrust -> VerifyTrust -> Bool
(VerifyTrust -> VerifyTrust -> Bool)
-> (VerifyTrust -> VerifyTrust -> Bool) -> Eq VerifyTrust
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyTrust -> VerifyTrust -> Bool
$c/= :: VerifyTrust -> VerifyTrust -> Bool
== :: VerifyTrust -> VerifyTrust -> Bool
$c== :: VerifyTrust -> VerifyTrust -> Bool
Prelude.Eq, ReadPrec [VerifyTrust]
ReadPrec VerifyTrust
Int -> ReadS VerifyTrust
ReadS [VerifyTrust]
(Int -> ReadS VerifyTrust)
-> ReadS [VerifyTrust]
-> ReadPrec VerifyTrust
-> ReadPrec [VerifyTrust]
-> Read VerifyTrust
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyTrust]
$creadListPrec :: ReadPrec [VerifyTrust]
readPrec :: ReadPrec VerifyTrust
$creadPrec :: ReadPrec VerifyTrust
readList :: ReadS [VerifyTrust]
$creadList :: ReadS [VerifyTrust]
readsPrec :: Int -> ReadS VerifyTrust
$creadsPrec :: Int -> ReadS VerifyTrust
Prelude.Read, Int -> VerifyTrust -> ShowS
[VerifyTrust] -> ShowS
VerifyTrust -> String
(Int -> VerifyTrust -> ShowS)
-> (VerifyTrust -> String)
-> ([VerifyTrust] -> ShowS)
-> Show VerifyTrust
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifyTrust] -> ShowS
$cshowList :: [VerifyTrust] -> ShowS
show :: VerifyTrust -> String
$cshow :: VerifyTrust -> String
showsPrec :: Int -> VerifyTrust -> ShowS
$cshowsPrec :: Int -> VerifyTrust -> ShowS
Prelude.Show, (forall x. VerifyTrust -> Rep VerifyTrust x)
-> (forall x. Rep VerifyTrust x -> VerifyTrust)
-> Generic VerifyTrust
forall x. Rep VerifyTrust x -> VerifyTrust
forall x. VerifyTrust -> Rep VerifyTrust x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VerifyTrust x -> VerifyTrust
$cfrom :: forall x. VerifyTrust -> Rep VerifyTrust x
Prelude.Generic)
newVerifyTrust ::
Prelude.Text ->
VerifyTrust
newVerifyTrust :: Text -> VerifyTrust
newVerifyTrust Text
pTrustId_ =
VerifyTrust' :: Text -> VerifyTrust
VerifyTrust' {$sel:trustId:VerifyTrust' :: Text
trustId = Text
pTrustId_}
verifyTrust_trustId :: Lens.Lens' VerifyTrust Prelude.Text
verifyTrust_trustId :: (Text -> f Text) -> VerifyTrust -> f VerifyTrust
verifyTrust_trustId = (VerifyTrust -> Text)
-> (VerifyTrust -> Text -> VerifyTrust)
-> Lens VerifyTrust VerifyTrust Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyTrust' {Text
trustId :: Text
$sel:trustId:VerifyTrust' :: VerifyTrust -> Text
trustId} -> Text
trustId) (\s :: VerifyTrust
s@VerifyTrust' {} Text
a -> VerifyTrust
s {$sel:trustId:VerifyTrust' :: Text
trustId = Text
a} :: VerifyTrust)
instance Core.AWSRequest VerifyTrust where
type AWSResponse VerifyTrust = VerifyTrustResponse
request :: VerifyTrust -> Request VerifyTrust
request = Service -> VerifyTrust -> Request VerifyTrust
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy VerifyTrust
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse VerifyTrust)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse VerifyTrust))
-> Logger
-> Service
-> Proxy VerifyTrust
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse VerifyTrust)))
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 -> VerifyTrustResponse
VerifyTrustResponse'
(Maybe Text -> Int -> VerifyTrustResponse)
-> Either String (Maybe Text)
-> Either String (Int -> VerifyTrustResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TrustId")
Either String (Int -> VerifyTrustResponse)
-> Either String Int -> Either String VerifyTrustResponse
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 VerifyTrust
instance Prelude.NFData VerifyTrust
instance Core.ToHeaders VerifyTrust where
toHeaders :: VerifyTrust -> ResponseHeaders
toHeaders =
ResponseHeaders -> VerifyTrust -> 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
"DirectoryService_20150416.VerifyTrust" ::
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 VerifyTrust where
toJSON :: VerifyTrust -> Value
toJSON VerifyTrust' {Text
trustId :: Text
$sel:trustId:VerifyTrust' :: VerifyTrust -> 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
"TrustId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
trustId)]
)
instance Core.ToPath VerifyTrust where
toPath :: VerifyTrust -> ByteString
toPath = ByteString -> VerifyTrust -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery VerifyTrust where
toQuery :: VerifyTrust -> QueryString
toQuery = QueryString -> VerifyTrust -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data VerifyTrustResponse = VerifyTrustResponse'
{
VerifyTrustResponse -> Maybe Text
trustId :: Prelude.Maybe Prelude.Text,
VerifyTrustResponse -> Int
httpStatus :: Prelude.Int
}
deriving (VerifyTrustResponse -> VerifyTrustResponse -> Bool
(VerifyTrustResponse -> VerifyTrustResponse -> Bool)
-> (VerifyTrustResponse -> VerifyTrustResponse -> Bool)
-> Eq VerifyTrustResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyTrustResponse -> VerifyTrustResponse -> Bool
$c/= :: VerifyTrustResponse -> VerifyTrustResponse -> Bool
== :: VerifyTrustResponse -> VerifyTrustResponse -> Bool
$c== :: VerifyTrustResponse -> VerifyTrustResponse -> Bool
Prelude.Eq, ReadPrec [VerifyTrustResponse]
ReadPrec VerifyTrustResponse
Int -> ReadS VerifyTrustResponse
ReadS [VerifyTrustResponse]
(Int -> ReadS VerifyTrustResponse)
-> ReadS [VerifyTrustResponse]
-> ReadPrec VerifyTrustResponse
-> ReadPrec [VerifyTrustResponse]
-> Read VerifyTrustResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyTrustResponse]
$creadListPrec :: ReadPrec [VerifyTrustResponse]
readPrec :: ReadPrec VerifyTrustResponse
$creadPrec :: ReadPrec VerifyTrustResponse
readList :: ReadS [VerifyTrustResponse]
$creadList :: ReadS [VerifyTrustResponse]
readsPrec :: Int -> ReadS VerifyTrustResponse
$creadsPrec :: Int -> ReadS VerifyTrustResponse
Prelude.Read, Int -> VerifyTrustResponse -> ShowS
[VerifyTrustResponse] -> ShowS
VerifyTrustResponse -> String
(Int -> VerifyTrustResponse -> ShowS)
-> (VerifyTrustResponse -> String)
-> ([VerifyTrustResponse] -> ShowS)
-> Show VerifyTrustResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifyTrustResponse] -> ShowS
$cshowList :: [VerifyTrustResponse] -> ShowS
show :: VerifyTrustResponse -> String
$cshow :: VerifyTrustResponse -> String
showsPrec :: Int -> VerifyTrustResponse -> ShowS
$cshowsPrec :: Int -> VerifyTrustResponse -> ShowS
Prelude.Show, (forall x. VerifyTrustResponse -> Rep VerifyTrustResponse x)
-> (forall x. Rep VerifyTrustResponse x -> VerifyTrustResponse)
-> Generic VerifyTrustResponse
forall x. Rep VerifyTrustResponse x -> VerifyTrustResponse
forall x. VerifyTrustResponse -> Rep VerifyTrustResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VerifyTrustResponse x -> VerifyTrustResponse
$cfrom :: forall x. VerifyTrustResponse -> Rep VerifyTrustResponse x
Prelude.Generic)
newVerifyTrustResponse ::
Prelude.Int ->
VerifyTrustResponse
newVerifyTrustResponse :: Int -> VerifyTrustResponse
newVerifyTrustResponse Int
pHttpStatus_ =
VerifyTrustResponse' :: Maybe Text -> Int -> VerifyTrustResponse
VerifyTrustResponse'
{ $sel:trustId:VerifyTrustResponse' :: Maybe Text
trustId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:VerifyTrustResponse' :: Int
httpStatus = Int
pHttpStatus_
}
verifyTrustResponse_trustId :: Lens.Lens' VerifyTrustResponse (Prelude.Maybe Prelude.Text)
verifyTrustResponse_trustId :: (Maybe Text -> f (Maybe Text))
-> VerifyTrustResponse -> f VerifyTrustResponse
verifyTrustResponse_trustId = (VerifyTrustResponse -> Maybe Text)
-> (VerifyTrustResponse -> Maybe Text -> VerifyTrustResponse)
-> Lens
VerifyTrustResponse VerifyTrustResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyTrustResponse' {Maybe Text
trustId :: Maybe Text
$sel:trustId:VerifyTrustResponse' :: VerifyTrustResponse -> Maybe Text
trustId} -> Maybe Text
trustId) (\s :: VerifyTrustResponse
s@VerifyTrustResponse' {} Maybe Text
a -> VerifyTrustResponse
s {$sel:trustId:VerifyTrustResponse' :: Maybe Text
trustId = Maybe Text
a} :: VerifyTrustResponse)
verifyTrustResponse_httpStatus :: Lens.Lens' VerifyTrustResponse Prelude.Int
verifyTrustResponse_httpStatus :: (Int -> f Int) -> VerifyTrustResponse -> f VerifyTrustResponse
verifyTrustResponse_httpStatus = (VerifyTrustResponse -> Int)
-> (VerifyTrustResponse -> Int -> VerifyTrustResponse)
-> Lens VerifyTrustResponse VerifyTrustResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyTrustResponse' {Int
httpStatus :: Int
$sel:httpStatus:VerifyTrustResponse' :: VerifyTrustResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: VerifyTrustResponse
s@VerifyTrustResponse' {} Int
a -> VerifyTrustResponse
s {$sel:httpStatus:VerifyTrustResponse' :: Int
httpStatus = Int
a} :: VerifyTrustResponse)
instance Prelude.NFData VerifyTrustResponse