{-# 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.Shield.AssociateDRTRole
(
AssociateDRTRole (..),
newAssociateDRTRole,
associateDRTRole_roleArn,
AssociateDRTRoleResponse (..),
newAssociateDRTRoleResponse,
associateDRTRoleResponse_httpStatus,
)
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.Shield.Types
data AssociateDRTRole = AssociateDRTRole'
{
AssociateDRTRole -> Text
roleArn :: Prelude.Text
}
deriving (AssociateDRTRole -> AssociateDRTRole -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateDRTRole -> AssociateDRTRole -> Bool
$c/= :: AssociateDRTRole -> AssociateDRTRole -> Bool
== :: AssociateDRTRole -> AssociateDRTRole -> Bool
$c== :: AssociateDRTRole -> AssociateDRTRole -> Bool
Prelude.Eq, ReadPrec [AssociateDRTRole]
ReadPrec AssociateDRTRole
Int -> ReadS AssociateDRTRole
ReadS [AssociateDRTRole]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateDRTRole]
$creadListPrec :: ReadPrec [AssociateDRTRole]
readPrec :: ReadPrec AssociateDRTRole
$creadPrec :: ReadPrec AssociateDRTRole
readList :: ReadS [AssociateDRTRole]
$creadList :: ReadS [AssociateDRTRole]
readsPrec :: Int -> ReadS AssociateDRTRole
$creadsPrec :: Int -> ReadS AssociateDRTRole
Prelude.Read, Int -> AssociateDRTRole -> ShowS
[AssociateDRTRole] -> ShowS
AssociateDRTRole -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateDRTRole] -> ShowS
$cshowList :: [AssociateDRTRole] -> ShowS
show :: AssociateDRTRole -> String
$cshow :: AssociateDRTRole -> String
showsPrec :: Int -> AssociateDRTRole -> ShowS
$cshowsPrec :: Int -> AssociateDRTRole -> ShowS
Prelude.Show, forall x. Rep AssociateDRTRole x -> AssociateDRTRole
forall x. AssociateDRTRole -> Rep AssociateDRTRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateDRTRole x -> AssociateDRTRole
$cfrom :: forall x. AssociateDRTRole -> Rep AssociateDRTRole x
Prelude.Generic)
newAssociateDRTRole ::
Prelude.Text ->
AssociateDRTRole
newAssociateDRTRole :: Text -> AssociateDRTRole
newAssociateDRTRole Text
pRoleArn_ =
AssociateDRTRole' {$sel:roleArn:AssociateDRTRole' :: Text
roleArn = Text
pRoleArn_}
associateDRTRole_roleArn :: Lens.Lens' AssociateDRTRole Prelude.Text
associateDRTRole_roleArn :: Lens' AssociateDRTRole Text
associateDRTRole_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDRTRole' {Text
roleArn :: Text
$sel:roleArn:AssociateDRTRole' :: AssociateDRTRole -> Text
roleArn} -> Text
roleArn) (\s :: AssociateDRTRole
s@AssociateDRTRole' {} Text
a -> AssociateDRTRole
s {$sel:roleArn:AssociateDRTRole' :: Text
roleArn = Text
a} :: AssociateDRTRole)
instance Core.AWSRequest AssociateDRTRole where
type
AWSResponse AssociateDRTRole =
AssociateDRTRoleResponse
request :: (Service -> Service)
-> AssociateDRTRole -> Request AssociateDRTRole
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 AssociateDRTRole
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AssociateDRTRole)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> AssociateDRTRoleResponse
AssociateDRTRoleResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable AssociateDRTRole where
hashWithSalt :: Int -> AssociateDRTRole -> Int
hashWithSalt Int
_salt AssociateDRTRole' {Text
roleArn :: Text
$sel:roleArn:AssociateDRTRole' :: AssociateDRTRole -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
instance Prelude.NFData AssociateDRTRole where
rnf :: AssociateDRTRole -> ()
rnf AssociateDRTRole' {Text
roleArn :: Text
$sel:roleArn:AssociateDRTRole' :: AssociateDRTRole -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
instance Data.ToHeaders AssociateDRTRole where
toHeaders :: AssociateDRTRole -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSShield_20160616.AssociateDRTRole" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON AssociateDRTRole where
toJSON :: AssociateDRTRole -> Value
toJSON AssociateDRTRole' {Text
roleArn :: Text
$sel:roleArn:AssociateDRTRole' :: AssociateDRTRole -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"RoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)]
)
instance Data.ToPath AssociateDRTRole where
toPath :: AssociateDRTRole -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AssociateDRTRole where
toQuery :: AssociateDRTRole -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AssociateDRTRoleResponse = AssociateDRTRoleResponse'
{
AssociateDRTRoleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateDRTRoleResponse -> AssociateDRTRoleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateDRTRoleResponse -> AssociateDRTRoleResponse -> Bool
$c/= :: AssociateDRTRoleResponse -> AssociateDRTRoleResponse -> Bool
== :: AssociateDRTRoleResponse -> AssociateDRTRoleResponse -> Bool
$c== :: AssociateDRTRoleResponse -> AssociateDRTRoleResponse -> Bool
Prelude.Eq, ReadPrec [AssociateDRTRoleResponse]
ReadPrec AssociateDRTRoleResponse
Int -> ReadS AssociateDRTRoleResponse
ReadS [AssociateDRTRoleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateDRTRoleResponse]
$creadListPrec :: ReadPrec [AssociateDRTRoleResponse]
readPrec :: ReadPrec AssociateDRTRoleResponse
$creadPrec :: ReadPrec AssociateDRTRoleResponse
readList :: ReadS [AssociateDRTRoleResponse]
$creadList :: ReadS [AssociateDRTRoleResponse]
readsPrec :: Int -> ReadS AssociateDRTRoleResponse
$creadsPrec :: Int -> ReadS AssociateDRTRoleResponse
Prelude.Read, Int -> AssociateDRTRoleResponse -> ShowS
[AssociateDRTRoleResponse] -> ShowS
AssociateDRTRoleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateDRTRoleResponse] -> ShowS
$cshowList :: [AssociateDRTRoleResponse] -> ShowS
show :: AssociateDRTRoleResponse -> String
$cshow :: AssociateDRTRoleResponse -> String
showsPrec :: Int -> AssociateDRTRoleResponse -> ShowS
$cshowsPrec :: Int -> AssociateDRTRoleResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateDRTRoleResponse x -> AssociateDRTRoleResponse
forall x.
AssociateDRTRoleResponse -> Rep AssociateDRTRoleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateDRTRoleResponse x -> AssociateDRTRoleResponse
$cfrom :: forall x.
AssociateDRTRoleResponse -> Rep AssociateDRTRoleResponse x
Prelude.Generic)
newAssociateDRTRoleResponse ::
Prelude.Int ->
AssociateDRTRoleResponse
newAssociateDRTRoleResponse :: Int -> AssociateDRTRoleResponse
newAssociateDRTRoleResponse Int
pHttpStatus_ =
AssociateDRTRoleResponse'
{ $sel:httpStatus:AssociateDRTRoleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateDRTRoleResponse_httpStatus :: Lens.Lens' AssociateDRTRoleResponse Prelude.Int
associateDRTRoleResponse_httpStatus :: Lens' AssociateDRTRoleResponse Int
associateDRTRoleResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDRTRoleResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateDRTRoleResponse' :: AssociateDRTRoleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateDRTRoleResponse
s@AssociateDRTRoleResponse' {} Int
a -> AssociateDRTRoleResponse
s {$sel:httpStatus:AssociateDRTRoleResponse' :: Int
httpStatus = Int
a} :: AssociateDRTRoleResponse)
instance Prelude.NFData AssociateDRTRoleResponse where
rnf :: AssociateDRTRoleResponse -> ()
rnf AssociateDRTRoleResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateDRTRoleResponse' :: AssociateDRTRoleResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus