{-# 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.DeleteTrust
(
DeleteTrust (..),
newDeleteTrust,
deleteTrust_deleteAssociatedConditionalForwarder,
deleteTrust_trustId,
DeleteTrustResponse (..),
newDeleteTrustResponse,
deleteTrustResponse_trustId,
deleteTrustResponse_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 DeleteTrust = DeleteTrust'
{
DeleteTrust -> Maybe Bool
deleteAssociatedConditionalForwarder :: Prelude.Maybe Prelude.Bool,
DeleteTrust -> Text
trustId :: Prelude.Text
}
deriving (DeleteTrust -> DeleteTrust -> Bool
(DeleteTrust -> DeleteTrust -> Bool)
-> (DeleteTrust -> DeleteTrust -> Bool) -> Eq DeleteTrust
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTrust -> DeleteTrust -> Bool
$c/= :: DeleteTrust -> DeleteTrust -> Bool
== :: DeleteTrust -> DeleteTrust -> Bool
$c== :: DeleteTrust -> DeleteTrust -> Bool
Prelude.Eq, ReadPrec [DeleteTrust]
ReadPrec DeleteTrust
Int -> ReadS DeleteTrust
ReadS [DeleteTrust]
(Int -> ReadS DeleteTrust)
-> ReadS [DeleteTrust]
-> ReadPrec DeleteTrust
-> ReadPrec [DeleteTrust]
-> Read DeleteTrust
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTrust]
$creadListPrec :: ReadPrec [DeleteTrust]
readPrec :: ReadPrec DeleteTrust
$creadPrec :: ReadPrec DeleteTrust
readList :: ReadS [DeleteTrust]
$creadList :: ReadS [DeleteTrust]
readsPrec :: Int -> ReadS DeleteTrust
$creadsPrec :: Int -> ReadS DeleteTrust
Prelude.Read, Int -> DeleteTrust -> ShowS
[DeleteTrust] -> ShowS
DeleteTrust -> String
(Int -> DeleteTrust -> ShowS)
-> (DeleteTrust -> String)
-> ([DeleteTrust] -> ShowS)
-> Show DeleteTrust
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTrust] -> ShowS
$cshowList :: [DeleteTrust] -> ShowS
show :: DeleteTrust -> String
$cshow :: DeleteTrust -> String
showsPrec :: Int -> DeleteTrust -> ShowS
$cshowsPrec :: Int -> DeleteTrust -> ShowS
Prelude.Show, (forall x. DeleteTrust -> Rep DeleteTrust x)
-> (forall x. Rep DeleteTrust x -> DeleteTrust)
-> Generic DeleteTrust
forall x. Rep DeleteTrust x -> DeleteTrust
forall x. DeleteTrust -> Rep DeleteTrust x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTrust x -> DeleteTrust
$cfrom :: forall x. DeleteTrust -> Rep DeleteTrust x
Prelude.Generic)
newDeleteTrust ::
Prelude.Text ->
DeleteTrust
newDeleteTrust :: Text -> DeleteTrust
newDeleteTrust Text
pTrustId_ =
DeleteTrust' :: Maybe Bool -> Text -> DeleteTrust
DeleteTrust'
{ $sel:deleteAssociatedConditionalForwarder:DeleteTrust' :: Maybe Bool
deleteAssociatedConditionalForwarder =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:trustId:DeleteTrust' :: Text
trustId = Text
pTrustId_
}
deleteTrust_deleteAssociatedConditionalForwarder :: Lens.Lens' DeleteTrust (Prelude.Maybe Prelude.Bool)
deleteTrust_deleteAssociatedConditionalForwarder :: (Maybe Bool -> f (Maybe Bool)) -> DeleteTrust -> f DeleteTrust
deleteTrust_deleteAssociatedConditionalForwarder = (DeleteTrust -> Maybe Bool)
-> (DeleteTrust -> Maybe Bool -> DeleteTrust)
-> Lens DeleteTrust DeleteTrust (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrust' {Maybe Bool
deleteAssociatedConditionalForwarder :: Maybe Bool
$sel:deleteAssociatedConditionalForwarder:DeleteTrust' :: DeleteTrust -> Maybe Bool
deleteAssociatedConditionalForwarder} -> Maybe Bool
deleteAssociatedConditionalForwarder) (\s :: DeleteTrust
s@DeleteTrust' {} Maybe Bool
a -> DeleteTrust
s {$sel:deleteAssociatedConditionalForwarder:DeleteTrust' :: Maybe Bool
deleteAssociatedConditionalForwarder = Maybe Bool
a} :: DeleteTrust)
deleteTrust_trustId :: Lens.Lens' DeleteTrust Prelude.Text
deleteTrust_trustId :: (Text -> f Text) -> DeleteTrust -> f DeleteTrust
deleteTrust_trustId = (DeleteTrust -> Text)
-> (DeleteTrust -> Text -> DeleteTrust)
-> Lens DeleteTrust DeleteTrust Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrust' {Text
trustId :: Text
$sel:trustId:DeleteTrust' :: DeleteTrust -> Text
trustId} -> Text
trustId) (\s :: DeleteTrust
s@DeleteTrust' {} Text
a -> DeleteTrust
s {$sel:trustId:DeleteTrust' :: Text
trustId = Text
a} :: DeleteTrust)
instance Core.AWSRequest DeleteTrust where
type AWSResponse DeleteTrust = DeleteTrustResponse
request :: DeleteTrust -> Request DeleteTrust
request = Service -> DeleteTrust -> Request DeleteTrust
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTrust
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTrust)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteTrust))
-> Logger
-> Service
-> Proxy DeleteTrust
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTrust)))
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 -> DeleteTrustResponse
DeleteTrustResponse'
(Maybe Text -> Int -> DeleteTrustResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteTrustResponse)
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 -> DeleteTrustResponse)
-> Either String Int -> Either String DeleteTrustResponse
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 DeleteTrust
instance Prelude.NFData DeleteTrust
instance Core.ToHeaders DeleteTrust where
toHeaders :: DeleteTrust -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTrust -> 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.DeleteTrust" ::
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 DeleteTrust where
toJSON :: DeleteTrust -> Value
toJSON DeleteTrust' {Maybe Bool
Text
trustId :: Text
deleteAssociatedConditionalForwarder :: Maybe Bool
$sel:trustId:DeleteTrust' :: DeleteTrust -> Text
$sel:deleteAssociatedConditionalForwarder:DeleteTrust' :: DeleteTrust -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DeleteAssociatedConditionalForwarder" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteAssociatedConditionalForwarder,
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 DeleteTrust where
toPath :: DeleteTrust -> ByteString
toPath = ByteString -> DeleteTrust -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTrust where
toQuery :: DeleteTrust -> QueryString
toQuery = QueryString -> DeleteTrust -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTrustResponse = DeleteTrustResponse'
{
DeleteTrustResponse -> Maybe Text
trustId :: Prelude.Maybe Prelude.Text,
DeleteTrustResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTrustResponse -> DeleteTrustResponse -> Bool
(DeleteTrustResponse -> DeleteTrustResponse -> Bool)
-> (DeleteTrustResponse -> DeleteTrustResponse -> Bool)
-> Eq DeleteTrustResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTrustResponse -> DeleteTrustResponse -> Bool
$c/= :: DeleteTrustResponse -> DeleteTrustResponse -> Bool
== :: DeleteTrustResponse -> DeleteTrustResponse -> Bool
$c== :: DeleteTrustResponse -> DeleteTrustResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTrustResponse]
ReadPrec DeleteTrustResponse
Int -> ReadS DeleteTrustResponse
ReadS [DeleteTrustResponse]
(Int -> ReadS DeleteTrustResponse)
-> ReadS [DeleteTrustResponse]
-> ReadPrec DeleteTrustResponse
-> ReadPrec [DeleteTrustResponse]
-> Read DeleteTrustResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTrustResponse]
$creadListPrec :: ReadPrec [DeleteTrustResponse]
readPrec :: ReadPrec DeleteTrustResponse
$creadPrec :: ReadPrec DeleteTrustResponse
readList :: ReadS [DeleteTrustResponse]
$creadList :: ReadS [DeleteTrustResponse]
readsPrec :: Int -> ReadS DeleteTrustResponse
$creadsPrec :: Int -> ReadS DeleteTrustResponse
Prelude.Read, Int -> DeleteTrustResponse -> ShowS
[DeleteTrustResponse] -> ShowS
DeleteTrustResponse -> String
(Int -> DeleteTrustResponse -> ShowS)
-> (DeleteTrustResponse -> String)
-> ([DeleteTrustResponse] -> ShowS)
-> Show DeleteTrustResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTrustResponse] -> ShowS
$cshowList :: [DeleteTrustResponse] -> ShowS
show :: DeleteTrustResponse -> String
$cshow :: DeleteTrustResponse -> String
showsPrec :: Int -> DeleteTrustResponse -> ShowS
$cshowsPrec :: Int -> DeleteTrustResponse -> ShowS
Prelude.Show, (forall x. DeleteTrustResponse -> Rep DeleteTrustResponse x)
-> (forall x. Rep DeleteTrustResponse x -> DeleteTrustResponse)
-> Generic DeleteTrustResponse
forall x. Rep DeleteTrustResponse x -> DeleteTrustResponse
forall x. DeleteTrustResponse -> Rep DeleteTrustResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTrustResponse x -> DeleteTrustResponse
$cfrom :: forall x. DeleteTrustResponse -> Rep DeleteTrustResponse x
Prelude.Generic)
newDeleteTrustResponse ::
Prelude.Int ->
DeleteTrustResponse
newDeleteTrustResponse :: Int -> DeleteTrustResponse
newDeleteTrustResponse Int
pHttpStatus_ =
DeleteTrustResponse' :: Maybe Text -> Int -> DeleteTrustResponse
DeleteTrustResponse'
{ $sel:trustId:DeleteTrustResponse' :: Maybe Text
trustId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteTrustResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteTrustResponse_trustId :: Lens.Lens' DeleteTrustResponse (Prelude.Maybe Prelude.Text)
deleteTrustResponse_trustId :: (Maybe Text -> f (Maybe Text))
-> DeleteTrustResponse -> f DeleteTrustResponse
deleteTrustResponse_trustId = (DeleteTrustResponse -> Maybe Text)
-> (DeleteTrustResponse -> Maybe Text -> DeleteTrustResponse)
-> Lens
DeleteTrustResponse DeleteTrustResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrustResponse' {Maybe Text
trustId :: Maybe Text
$sel:trustId:DeleteTrustResponse' :: DeleteTrustResponse -> Maybe Text
trustId} -> Maybe Text
trustId) (\s :: DeleteTrustResponse
s@DeleteTrustResponse' {} Maybe Text
a -> DeleteTrustResponse
s {$sel:trustId:DeleteTrustResponse' :: Maybe Text
trustId = Maybe Text
a} :: DeleteTrustResponse)
deleteTrustResponse_httpStatus :: Lens.Lens' DeleteTrustResponse Prelude.Int
deleteTrustResponse_httpStatus :: (Int -> f Int) -> DeleteTrustResponse -> f DeleteTrustResponse
deleteTrustResponse_httpStatus = (DeleteTrustResponse -> Int)
-> (DeleteTrustResponse -> Int -> DeleteTrustResponse)
-> Lens DeleteTrustResponse DeleteTrustResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrustResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTrustResponse' :: DeleteTrustResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTrustResponse
s@DeleteTrustResponse' {} Int
a -> DeleteTrustResponse
s {$sel:httpStatus:DeleteTrustResponse' :: Int
httpStatus = Int
a} :: DeleteTrustResponse)
instance Prelude.NFData DeleteTrustResponse