{-# 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.RolesAnywhere.DeleteTrustAnchor
(
DeleteTrustAnchor (..),
newDeleteTrustAnchor,
deleteTrustAnchor_trustAnchorId,
TrustAnchorDetailResponse (..),
newTrustAnchorDetailResponse,
trustAnchorDetailResponse_trustAnchor,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.RolesAnywhere.Types
data DeleteTrustAnchor = DeleteTrustAnchor'
{
DeleteTrustAnchor -> Text
trustAnchorId :: Prelude.Text
}
deriving (DeleteTrustAnchor -> DeleteTrustAnchor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTrustAnchor -> DeleteTrustAnchor -> Bool
$c/= :: DeleteTrustAnchor -> DeleteTrustAnchor -> Bool
== :: DeleteTrustAnchor -> DeleteTrustAnchor -> Bool
$c== :: DeleteTrustAnchor -> DeleteTrustAnchor -> Bool
Prelude.Eq, ReadPrec [DeleteTrustAnchor]
ReadPrec DeleteTrustAnchor
Int -> ReadS DeleteTrustAnchor
ReadS [DeleteTrustAnchor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTrustAnchor]
$creadListPrec :: ReadPrec [DeleteTrustAnchor]
readPrec :: ReadPrec DeleteTrustAnchor
$creadPrec :: ReadPrec DeleteTrustAnchor
readList :: ReadS [DeleteTrustAnchor]
$creadList :: ReadS [DeleteTrustAnchor]
readsPrec :: Int -> ReadS DeleteTrustAnchor
$creadsPrec :: Int -> ReadS DeleteTrustAnchor
Prelude.Read, Int -> DeleteTrustAnchor -> ShowS
[DeleteTrustAnchor] -> ShowS
DeleteTrustAnchor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTrustAnchor] -> ShowS
$cshowList :: [DeleteTrustAnchor] -> ShowS
show :: DeleteTrustAnchor -> String
$cshow :: DeleteTrustAnchor -> String
showsPrec :: Int -> DeleteTrustAnchor -> ShowS
$cshowsPrec :: Int -> DeleteTrustAnchor -> ShowS
Prelude.Show, forall x. Rep DeleteTrustAnchor x -> DeleteTrustAnchor
forall x. DeleteTrustAnchor -> Rep DeleteTrustAnchor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTrustAnchor x -> DeleteTrustAnchor
$cfrom :: forall x. DeleteTrustAnchor -> Rep DeleteTrustAnchor x
Prelude.Generic)
newDeleteTrustAnchor ::
Prelude.Text ->
DeleteTrustAnchor
newDeleteTrustAnchor :: Text -> DeleteTrustAnchor
newDeleteTrustAnchor Text
pTrustAnchorId_ =
DeleteTrustAnchor' {$sel:trustAnchorId:DeleteTrustAnchor' :: Text
trustAnchorId = Text
pTrustAnchorId_}
deleteTrustAnchor_trustAnchorId :: Lens.Lens' DeleteTrustAnchor Prelude.Text
deleteTrustAnchor_trustAnchorId :: Lens' DeleteTrustAnchor Text
deleteTrustAnchor_trustAnchorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DeleteTrustAnchor' :: DeleteTrustAnchor -> Text
trustAnchorId} -> Text
trustAnchorId) (\s :: DeleteTrustAnchor
s@DeleteTrustAnchor' {} Text
a -> DeleteTrustAnchor
s {$sel:trustAnchorId:DeleteTrustAnchor' :: Text
trustAnchorId = Text
a} :: DeleteTrustAnchor)
instance Core.AWSRequest DeleteTrustAnchor where
type
AWSResponse DeleteTrustAnchor =
TrustAnchorDetailResponse
request :: (Service -> Service)
-> DeleteTrustAnchor -> Request DeleteTrustAnchor
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteTrustAnchor
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTrustAnchor)))
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 -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance Prelude.Hashable DeleteTrustAnchor where
hashWithSalt :: Int -> DeleteTrustAnchor -> Int
hashWithSalt Int
_salt DeleteTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DeleteTrustAnchor' :: DeleteTrustAnchor -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
trustAnchorId
instance Prelude.NFData DeleteTrustAnchor where
rnf :: DeleteTrustAnchor -> ()
rnf DeleteTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DeleteTrustAnchor' :: DeleteTrustAnchor -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
trustAnchorId
instance Data.ToHeaders DeleteTrustAnchor where
toHeaders :: DeleteTrustAnchor -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteTrustAnchor where
toPath :: DeleteTrustAnchor -> ByteString
toPath DeleteTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DeleteTrustAnchor' :: DeleteTrustAnchor -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/trustanchor/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
trustAnchorId]
instance Data.ToQuery DeleteTrustAnchor where
toQuery :: DeleteTrustAnchor -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty