{-# 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.FMS.AssociateThirdPartyFirewall
(
AssociateThirdPartyFirewall (..),
newAssociateThirdPartyFirewall,
associateThirdPartyFirewall_thirdPartyFirewall,
AssociateThirdPartyFirewallResponse (..),
newAssociateThirdPartyFirewallResponse,
associateThirdPartyFirewallResponse_thirdPartyFirewallStatus,
associateThirdPartyFirewallResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FMS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateThirdPartyFirewall = AssociateThirdPartyFirewall'
{
AssociateThirdPartyFirewall -> ThirdPartyFirewall
thirdPartyFirewall :: ThirdPartyFirewall
}
deriving (AssociateThirdPartyFirewall -> AssociateThirdPartyFirewall -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateThirdPartyFirewall -> AssociateThirdPartyFirewall -> Bool
$c/= :: AssociateThirdPartyFirewall -> AssociateThirdPartyFirewall -> Bool
== :: AssociateThirdPartyFirewall -> AssociateThirdPartyFirewall -> Bool
$c== :: AssociateThirdPartyFirewall -> AssociateThirdPartyFirewall -> Bool
Prelude.Eq, ReadPrec [AssociateThirdPartyFirewall]
ReadPrec AssociateThirdPartyFirewall
Int -> ReadS AssociateThirdPartyFirewall
ReadS [AssociateThirdPartyFirewall]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateThirdPartyFirewall]
$creadListPrec :: ReadPrec [AssociateThirdPartyFirewall]
readPrec :: ReadPrec AssociateThirdPartyFirewall
$creadPrec :: ReadPrec AssociateThirdPartyFirewall
readList :: ReadS [AssociateThirdPartyFirewall]
$creadList :: ReadS [AssociateThirdPartyFirewall]
readsPrec :: Int -> ReadS AssociateThirdPartyFirewall
$creadsPrec :: Int -> ReadS AssociateThirdPartyFirewall
Prelude.Read, Int -> AssociateThirdPartyFirewall -> ShowS
[AssociateThirdPartyFirewall] -> ShowS
AssociateThirdPartyFirewall -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateThirdPartyFirewall] -> ShowS
$cshowList :: [AssociateThirdPartyFirewall] -> ShowS
show :: AssociateThirdPartyFirewall -> String
$cshow :: AssociateThirdPartyFirewall -> String
showsPrec :: Int -> AssociateThirdPartyFirewall -> ShowS
$cshowsPrec :: Int -> AssociateThirdPartyFirewall -> ShowS
Prelude.Show, forall x.
Rep AssociateThirdPartyFirewall x -> AssociateThirdPartyFirewall
forall x.
AssociateThirdPartyFirewall -> Rep AssociateThirdPartyFirewall x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateThirdPartyFirewall x -> AssociateThirdPartyFirewall
$cfrom :: forall x.
AssociateThirdPartyFirewall -> Rep AssociateThirdPartyFirewall x
Prelude.Generic)
newAssociateThirdPartyFirewall ::
ThirdPartyFirewall ->
AssociateThirdPartyFirewall
newAssociateThirdPartyFirewall :: ThirdPartyFirewall -> AssociateThirdPartyFirewall
newAssociateThirdPartyFirewall ThirdPartyFirewall
pThirdPartyFirewall_ =
AssociateThirdPartyFirewall'
{ $sel:thirdPartyFirewall:AssociateThirdPartyFirewall' :: ThirdPartyFirewall
thirdPartyFirewall =
ThirdPartyFirewall
pThirdPartyFirewall_
}
associateThirdPartyFirewall_thirdPartyFirewall :: Lens.Lens' AssociateThirdPartyFirewall ThirdPartyFirewall
associateThirdPartyFirewall_thirdPartyFirewall :: Lens' AssociateThirdPartyFirewall ThirdPartyFirewall
associateThirdPartyFirewall_thirdPartyFirewall = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateThirdPartyFirewall' {ThirdPartyFirewall
thirdPartyFirewall :: ThirdPartyFirewall
$sel:thirdPartyFirewall:AssociateThirdPartyFirewall' :: AssociateThirdPartyFirewall -> ThirdPartyFirewall
thirdPartyFirewall} -> ThirdPartyFirewall
thirdPartyFirewall) (\s :: AssociateThirdPartyFirewall
s@AssociateThirdPartyFirewall' {} ThirdPartyFirewall
a -> AssociateThirdPartyFirewall
s {$sel:thirdPartyFirewall:AssociateThirdPartyFirewall' :: ThirdPartyFirewall
thirdPartyFirewall = ThirdPartyFirewall
a} :: AssociateThirdPartyFirewall)
instance Core.AWSRequest AssociateThirdPartyFirewall where
type
AWSResponse AssociateThirdPartyFirewall =
AssociateThirdPartyFirewallResponse
request :: (Service -> Service)
-> AssociateThirdPartyFirewall
-> Request AssociateThirdPartyFirewall
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 AssociateThirdPartyFirewall
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateThirdPartyFirewall)))
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 ->
Maybe ThirdPartyFirewallAssociationStatus
-> Int -> AssociateThirdPartyFirewallResponse
AssociateThirdPartyFirewallResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ThirdPartyFirewallStatus")
forall (f :: * -> *) a b. Applicative f => 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 AssociateThirdPartyFirewall where
hashWithSalt :: Int -> AssociateThirdPartyFirewall -> Int
hashWithSalt Int
_salt AssociateThirdPartyFirewall' {ThirdPartyFirewall
thirdPartyFirewall :: ThirdPartyFirewall
$sel:thirdPartyFirewall:AssociateThirdPartyFirewall' :: AssociateThirdPartyFirewall -> ThirdPartyFirewall
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ThirdPartyFirewall
thirdPartyFirewall
instance Prelude.NFData AssociateThirdPartyFirewall where
rnf :: AssociateThirdPartyFirewall -> ()
rnf AssociateThirdPartyFirewall' {ThirdPartyFirewall
thirdPartyFirewall :: ThirdPartyFirewall
$sel:thirdPartyFirewall:AssociateThirdPartyFirewall' :: AssociateThirdPartyFirewall -> ThirdPartyFirewall
..} =
forall a. NFData a => a -> ()
Prelude.rnf ThirdPartyFirewall
thirdPartyFirewall
instance Data.ToHeaders AssociateThirdPartyFirewall where
toHeaders :: AssociateThirdPartyFirewall -> 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
"AWSFMS_20180101.AssociateThirdPartyFirewall" ::
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 AssociateThirdPartyFirewall where
toJSON :: AssociateThirdPartyFirewall -> Value
toJSON AssociateThirdPartyFirewall' {ThirdPartyFirewall
thirdPartyFirewall :: ThirdPartyFirewall
$sel:thirdPartyFirewall:AssociateThirdPartyFirewall' :: AssociateThirdPartyFirewall -> ThirdPartyFirewall
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ThirdPartyFirewall" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ThirdPartyFirewall
thirdPartyFirewall)
]
)
instance Data.ToPath AssociateThirdPartyFirewall where
toPath :: AssociateThirdPartyFirewall -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AssociateThirdPartyFirewall where
toQuery :: AssociateThirdPartyFirewall -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AssociateThirdPartyFirewallResponse = AssociateThirdPartyFirewallResponse'
{
AssociateThirdPartyFirewallResponse
-> Maybe ThirdPartyFirewallAssociationStatus
thirdPartyFirewallStatus :: Prelude.Maybe ThirdPartyFirewallAssociationStatus,
AssociateThirdPartyFirewallResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateThirdPartyFirewallResponse
-> AssociateThirdPartyFirewallResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateThirdPartyFirewallResponse
-> AssociateThirdPartyFirewallResponse -> Bool
$c/= :: AssociateThirdPartyFirewallResponse
-> AssociateThirdPartyFirewallResponse -> Bool
== :: AssociateThirdPartyFirewallResponse
-> AssociateThirdPartyFirewallResponse -> Bool
$c== :: AssociateThirdPartyFirewallResponse
-> AssociateThirdPartyFirewallResponse -> Bool
Prelude.Eq, ReadPrec [AssociateThirdPartyFirewallResponse]
ReadPrec AssociateThirdPartyFirewallResponse
Int -> ReadS AssociateThirdPartyFirewallResponse
ReadS [AssociateThirdPartyFirewallResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateThirdPartyFirewallResponse]
$creadListPrec :: ReadPrec [AssociateThirdPartyFirewallResponse]
readPrec :: ReadPrec AssociateThirdPartyFirewallResponse
$creadPrec :: ReadPrec AssociateThirdPartyFirewallResponse
readList :: ReadS [AssociateThirdPartyFirewallResponse]
$creadList :: ReadS [AssociateThirdPartyFirewallResponse]
readsPrec :: Int -> ReadS AssociateThirdPartyFirewallResponse
$creadsPrec :: Int -> ReadS AssociateThirdPartyFirewallResponse
Prelude.Read, Int -> AssociateThirdPartyFirewallResponse -> ShowS
[AssociateThirdPartyFirewallResponse] -> ShowS
AssociateThirdPartyFirewallResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateThirdPartyFirewallResponse] -> ShowS
$cshowList :: [AssociateThirdPartyFirewallResponse] -> ShowS
show :: AssociateThirdPartyFirewallResponse -> String
$cshow :: AssociateThirdPartyFirewallResponse -> String
showsPrec :: Int -> AssociateThirdPartyFirewallResponse -> ShowS
$cshowsPrec :: Int -> AssociateThirdPartyFirewallResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateThirdPartyFirewallResponse x
-> AssociateThirdPartyFirewallResponse
forall x.
AssociateThirdPartyFirewallResponse
-> Rep AssociateThirdPartyFirewallResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateThirdPartyFirewallResponse x
-> AssociateThirdPartyFirewallResponse
$cfrom :: forall x.
AssociateThirdPartyFirewallResponse
-> Rep AssociateThirdPartyFirewallResponse x
Prelude.Generic)
newAssociateThirdPartyFirewallResponse ::
Prelude.Int ->
AssociateThirdPartyFirewallResponse
newAssociateThirdPartyFirewallResponse :: Int -> AssociateThirdPartyFirewallResponse
newAssociateThirdPartyFirewallResponse Int
pHttpStatus_ =
AssociateThirdPartyFirewallResponse'
{ $sel:thirdPartyFirewallStatus:AssociateThirdPartyFirewallResponse' :: Maybe ThirdPartyFirewallAssociationStatus
thirdPartyFirewallStatus =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AssociateThirdPartyFirewallResponse' :: Int
httpStatus = Int
pHttpStatus_
}
associateThirdPartyFirewallResponse_thirdPartyFirewallStatus :: Lens.Lens' AssociateThirdPartyFirewallResponse (Prelude.Maybe ThirdPartyFirewallAssociationStatus)
associateThirdPartyFirewallResponse_thirdPartyFirewallStatus :: Lens'
AssociateThirdPartyFirewallResponse
(Maybe ThirdPartyFirewallAssociationStatus)
associateThirdPartyFirewallResponse_thirdPartyFirewallStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateThirdPartyFirewallResponse' {Maybe ThirdPartyFirewallAssociationStatus
thirdPartyFirewallStatus :: Maybe ThirdPartyFirewallAssociationStatus
$sel:thirdPartyFirewallStatus:AssociateThirdPartyFirewallResponse' :: AssociateThirdPartyFirewallResponse
-> Maybe ThirdPartyFirewallAssociationStatus
thirdPartyFirewallStatus} -> Maybe ThirdPartyFirewallAssociationStatus
thirdPartyFirewallStatus) (\s :: AssociateThirdPartyFirewallResponse
s@AssociateThirdPartyFirewallResponse' {} Maybe ThirdPartyFirewallAssociationStatus
a -> AssociateThirdPartyFirewallResponse
s {$sel:thirdPartyFirewallStatus:AssociateThirdPartyFirewallResponse' :: Maybe ThirdPartyFirewallAssociationStatus
thirdPartyFirewallStatus = Maybe ThirdPartyFirewallAssociationStatus
a} :: AssociateThirdPartyFirewallResponse)
associateThirdPartyFirewallResponse_httpStatus :: Lens.Lens' AssociateThirdPartyFirewallResponse Prelude.Int
associateThirdPartyFirewallResponse_httpStatus :: Lens' AssociateThirdPartyFirewallResponse Int
associateThirdPartyFirewallResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateThirdPartyFirewallResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateThirdPartyFirewallResponse' :: AssociateThirdPartyFirewallResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateThirdPartyFirewallResponse
s@AssociateThirdPartyFirewallResponse' {} Int
a -> AssociateThirdPartyFirewallResponse
s {$sel:httpStatus:AssociateThirdPartyFirewallResponse' :: Int
httpStatus = Int
a} :: AssociateThirdPartyFirewallResponse)
instance
Prelude.NFData
AssociateThirdPartyFirewallResponse
where
rnf :: AssociateThirdPartyFirewallResponse -> ()
rnf AssociateThirdPartyFirewallResponse' {Int
Maybe ThirdPartyFirewallAssociationStatus
httpStatus :: Int
thirdPartyFirewallStatus :: Maybe ThirdPartyFirewallAssociationStatus
$sel:httpStatus:AssociateThirdPartyFirewallResponse' :: AssociateThirdPartyFirewallResponse -> Int
$sel:thirdPartyFirewallStatus:AssociateThirdPartyFirewallResponse' :: AssociateThirdPartyFirewallResponse
-> Maybe ThirdPartyFirewallAssociationStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ThirdPartyFirewallAssociationStatus
thirdPartyFirewallStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus