{-# 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.DisableTrustAnchor
(
DisableTrustAnchor (..),
newDisableTrustAnchor,
disableTrustAnchor_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 DisableTrustAnchor = DisableTrustAnchor'
{
DisableTrustAnchor -> Text
trustAnchorId :: Prelude.Text
}
deriving (DisableTrustAnchor -> DisableTrustAnchor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableTrustAnchor -> DisableTrustAnchor -> Bool
$c/= :: DisableTrustAnchor -> DisableTrustAnchor -> Bool
== :: DisableTrustAnchor -> DisableTrustAnchor -> Bool
$c== :: DisableTrustAnchor -> DisableTrustAnchor -> Bool
Prelude.Eq, ReadPrec [DisableTrustAnchor]
ReadPrec DisableTrustAnchor
Int -> ReadS DisableTrustAnchor
ReadS [DisableTrustAnchor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableTrustAnchor]
$creadListPrec :: ReadPrec [DisableTrustAnchor]
readPrec :: ReadPrec DisableTrustAnchor
$creadPrec :: ReadPrec DisableTrustAnchor
readList :: ReadS [DisableTrustAnchor]
$creadList :: ReadS [DisableTrustAnchor]
readsPrec :: Int -> ReadS DisableTrustAnchor
$creadsPrec :: Int -> ReadS DisableTrustAnchor
Prelude.Read, Int -> DisableTrustAnchor -> ShowS
[DisableTrustAnchor] -> ShowS
DisableTrustAnchor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableTrustAnchor] -> ShowS
$cshowList :: [DisableTrustAnchor] -> ShowS
show :: DisableTrustAnchor -> String
$cshow :: DisableTrustAnchor -> String
showsPrec :: Int -> DisableTrustAnchor -> ShowS
$cshowsPrec :: Int -> DisableTrustAnchor -> ShowS
Prelude.Show, forall x. Rep DisableTrustAnchor x -> DisableTrustAnchor
forall x. DisableTrustAnchor -> Rep DisableTrustAnchor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableTrustAnchor x -> DisableTrustAnchor
$cfrom :: forall x. DisableTrustAnchor -> Rep DisableTrustAnchor x
Prelude.Generic)
newDisableTrustAnchor ::
Prelude.Text ->
DisableTrustAnchor
newDisableTrustAnchor :: Text -> DisableTrustAnchor
newDisableTrustAnchor Text
pTrustAnchorId_ =
DisableTrustAnchor'
{ $sel:trustAnchorId:DisableTrustAnchor' :: Text
trustAnchorId =
Text
pTrustAnchorId_
}
disableTrustAnchor_trustAnchorId :: Lens.Lens' DisableTrustAnchor Prelude.Text
disableTrustAnchor_trustAnchorId :: Lens' DisableTrustAnchor Text
disableTrustAnchor_trustAnchorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DisableTrustAnchor' :: DisableTrustAnchor -> Text
trustAnchorId} -> Text
trustAnchorId) (\s :: DisableTrustAnchor
s@DisableTrustAnchor' {} Text
a -> DisableTrustAnchor
s {$sel:trustAnchorId:DisableTrustAnchor' :: Text
trustAnchorId = Text
a} :: DisableTrustAnchor)
instance Core.AWSRequest DisableTrustAnchor where
type
AWSResponse DisableTrustAnchor =
TrustAnchorDetailResponse
request :: (Service -> Service)
-> DisableTrustAnchor -> Request DisableTrustAnchor
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 DisableTrustAnchor
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisableTrustAnchor)))
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 DisableTrustAnchor where
hashWithSalt :: Int -> DisableTrustAnchor -> Int
hashWithSalt Int
_salt DisableTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DisableTrustAnchor' :: DisableTrustAnchor -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
trustAnchorId
instance Prelude.NFData DisableTrustAnchor where
rnf :: DisableTrustAnchor -> ()
rnf DisableTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DisableTrustAnchor' :: DisableTrustAnchor -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
trustAnchorId
instance Data.ToHeaders DisableTrustAnchor where
toHeaders :: DisableTrustAnchor -> 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.ToJSON DisableTrustAnchor where
toJSON :: DisableTrustAnchor -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath DisableTrustAnchor where
toPath :: DisableTrustAnchor -> ByteString
toPath DisableTrustAnchor' {Text
trustAnchorId :: Text
$sel:trustAnchorId:DisableTrustAnchor' :: DisableTrustAnchor -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/trustanchor/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
trustAnchorId,
ByteString
"/disable"
]
instance Data.ToQuery DisableTrustAnchor where
toQuery :: DisableTrustAnchor -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty