{-# 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.GetResourceSet
(
GetResourceSet (..),
newGetResourceSet,
getResourceSet_identifier,
GetResourceSetResponse (..),
newGetResourceSetResponse,
getResourceSetResponse_httpStatus,
getResourceSetResponse_resourceSet,
getResourceSetResponse_resourceSetArn,
)
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 GetResourceSet = GetResourceSet'
{
GetResourceSet -> Text
identifier :: Prelude.Text
}
deriving (GetResourceSet -> GetResourceSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourceSet -> GetResourceSet -> Bool
$c/= :: GetResourceSet -> GetResourceSet -> Bool
== :: GetResourceSet -> GetResourceSet -> Bool
$c== :: GetResourceSet -> GetResourceSet -> Bool
Prelude.Eq, ReadPrec [GetResourceSet]
ReadPrec GetResourceSet
Int -> ReadS GetResourceSet
ReadS [GetResourceSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourceSet]
$creadListPrec :: ReadPrec [GetResourceSet]
readPrec :: ReadPrec GetResourceSet
$creadPrec :: ReadPrec GetResourceSet
readList :: ReadS [GetResourceSet]
$creadList :: ReadS [GetResourceSet]
readsPrec :: Int -> ReadS GetResourceSet
$creadsPrec :: Int -> ReadS GetResourceSet
Prelude.Read, Int -> GetResourceSet -> ShowS
[GetResourceSet] -> ShowS
GetResourceSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourceSet] -> ShowS
$cshowList :: [GetResourceSet] -> ShowS
show :: GetResourceSet -> String
$cshow :: GetResourceSet -> String
showsPrec :: Int -> GetResourceSet -> ShowS
$cshowsPrec :: Int -> GetResourceSet -> ShowS
Prelude.Show, forall x. Rep GetResourceSet x -> GetResourceSet
forall x. GetResourceSet -> Rep GetResourceSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResourceSet x -> GetResourceSet
$cfrom :: forall x. GetResourceSet -> Rep GetResourceSet x
Prelude.Generic)
newGetResourceSet ::
Prelude.Text ->
GetResourceSet
newGetResourceSet :: Text -> GetResourceSet
newGetResourceSet Text
pIdentifier_ =
GetResourceSet' {$sel:identifier:GetResourceSet' :: Text
identifier = Text
pIdentifier_}
getResourceSet_identifier :: Lens.Lens' GetResourceSet Prelude.Text
getResourceSet_identifier :: Lens' GetResourceSet Text
getResourceSet_identifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceSet' {Text
identifier :: Text
$sel:identifier:GetResourceSet' :: GetResourceSet -> Text
identifier} -> Text
identifier) (\s :: GetResourceSet
s@GetResourceSet' {} Text
a -> GetResourceSet
s {$sel:identifier:GetResourceSet' :: Text
identifier = Text
a} :: GetResourceSet)
instance Core.AWSRequest GetResourceSet where
type
AWSResponse GetResourceSet =
GetResourceSetResponse
request :: (Service -> Service) -> GetResourceSet -> Request GetResourceSet
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 GetResourceSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetResourceSet)))
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 ->
Int -> ResourceSet -> Text -> GetResourceSetResponse
GetResourceSetResponse'
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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"ResourceSet")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"ResourceSetArn")
)
instance Prelude.Hashable GetResourceSet where
hashWithSalt :: Int -> GetResourceSet -> Int
hashWithSalt Int
_salt GetResourceSet' {Text
identifier :: Text
$sel:identifier:GetResourceSet' :: GetResourceSet -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identifier
instance Prelude.NFData GetResourceSet where
rnf :: GetResourceSet -> ()
rnf GetResourceSet' {Text
identifier :: Text
$sel:identifier:GetResourceSet' :: GetResourceSet -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
identifier
instance Data.ToHeaders GetResourceSet where
toHeaders :: GetResourceSet -> 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.GetResourceSet" ::
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 GetResourceSet where
toJSON :: GetResourceSet -> Value
toJSON GetResourceSet' {Text
identifier :: Text
$sel:identifier:GetResourceSet' :: GetResourceSet -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Identifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
identifier)]
)
instance Data.ToPath GetResourceSet where
toPath :: GetResourceSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetResourceSet where
toQuery :: GetResourceSet -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetResourceSetResponse = GetResourceSetResponse'
{
GetResourceSetResponse -> Int
httpStatus :: Prelude.Int,
GetResourceSetResponse -> ResourceSet
resourceSet :: ResourceSet,
GetResourceSetResponse -> Text
resourceSetArn :: Prelude.Text
}
deriving (GetResourceSetResponse -> GetResourceSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourceSetResponse -> GetResourceSetResponse -> Bool
$c/= :: GetResourceSetResponse -> GetResourceSetResponse -> Bool
== :: GetResourceSetResponse -> GetResourceSetResponse -> Bool
$c== :: GetResourceSetResponse -> GetResourceSetResponse -> Bool
Prelude.Eq, ReadPrec [GetResourceSetResponse]
ReadPrec GetResourceSetResponse
Int -> ReadS GetResourceSetResponse
ReadS [GetResourceSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourceSetResponse]
$creadListPrec :: ReadPrec [GetResourceSetResponse]
readPrec :: ReadPrec GetResourceSetResponse
$creadPrec :: ReadPrec GetResourceSetResponse
readList :: ReadS [GetResourceSetResponse]
$creadList :: ReadS [GetResourceSetResponse]
readsPrec :: Int -> ReadS GetResourceSetResponse
$creadsPrec :: Int -> ReadS GetResourceSetResponse
Prelude.Read, Int -> GetResourceSetResponse -> ShowS
[GetResourceSetResponse] -> ShowS
GetResourceSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourceSetResponse] -> ShowS
$cshowList :: [GetResourceSetResponse] -> ShowS
show :: GetResourceSetResponse -> String
$cshow :: GetResourceSetResponse -> String
showsPrec :: Int -> GetResourceSetResponse -> ShowS
$cshowsPrec :: Int -> GetResourceSetResponse -> ShowS
Prelude.Show, forall x. Rep GetResourceSetResponse x -> GetResourceSetResponse
forall x. GetResourceSetResponse -> Rep GetResourceSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResourceSetResponse x -> GetResourceSetResponse
$cfrom :: forall x. GetResourceSetResponse -> Rep GetResourceSetResponse x
Prelude.Generic)
newGetResourceSetResponse ::
Prelude.Int ->
ResourceSet ->
Prelude.Text ->
GetResourceSetResponse
newGetResourceSetResponse :: Int -> ResourceSet -> Text -> GetResourceSetResponse
newGetResourceSetResponse
Int
pHttpStatus_
ResourceSet
pResourceSet_
Text
pResourceSetArn_ =
GetResourceSetResponse'
{ $sel:httpStatus:GetResourceSetResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:resourceSet:GetResourceSetResponse' :: ResourceSet
resourceSet = ResourceSet
pResourceSet_,
$sel:resourceSetArn:GetResourceSetResponse' :: Text
resourceSetArn = Text
pResourceSetArn_
}
getResourceSetResponse_httpStatus :: Lens.Lens' GetResourceSetResponse Prelude.Int
getResourceSetResponse_httpStatus :: Lens' GetResourceSetResponse Int
getResourceSetResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetResourceSetResponse' :: GetResourceSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetResourceSetResponse
s@GetResourceSetResponse' {} Int
a -> GetResourceSetResponse
s {$sel:httpStatus:GetResourceSetResponse' :: Int
httpStatus = Int
a} :: GetResourceSetResponse)
getResourceSetResponse_resourceSet :: Lens.Lens' GetResourceSetResponse ResourceSet
getResourceSetResponse_resourceSet :: Lens' GetResourceSetResponse ResourceSet
getResourceSetResponse_resourceSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceSetResponse' {ResourceSet
resourceSet :: ResourceSet
$sel:resourceSet:GetResourceSetResponse' :: GetResourceSetResponse -> ResourceSet
resourceSet} -> ResourceSet
resourceSet) (\s :: GetResourceSetResponse
s@GetResourceSetResponse' {} ResourceSet
a -> GetResourceSetResponse
s {$sel:resourceSet:GetResourceSetResponse' :: ResourceSet
resourceSet = ResourceSet
a} :: GetResourceSetResponse)
getResourceSetResponse_resourceSetArn :: Lens.Lens' GetResourceSetResponse Prelude.Text
getResourceSetResponse_resourceSetArn :: Lens' GetResourceSetResponse Text
getResourceSetResponse_resourceSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceSetResponse' {Text
resourceSetArn :: Text
$sel:resourceSetArn:GetResourceSetResponse' :: GetResourceSetResponse -> Text
resourceSetArn} -> Text
resourceSetArn) (\s :: GetResourceSetResponse
s@GetResourceSetResponse' {} Text
a -> GetResourceSetResponse
s {$sel:resourceSetArn:GetResourceSetResponse' :: Text
resourceSetArn = Text
a} :: GetResourceSetResponse)
instance Prelude.NFData GetResourceSetResponse where
rnf :: GetResourceSetResponse -> ()
rnf GetResourceSetResponse' {Int
Text
ResourceSet
resourceSetArn :: Text
resourceSet :: ResourceSet
httpStatus :: Int
$sel:resourceSetArn:GetResourceSetResponse' :: GetResourceSetResponse -> Text
$sel:resourceSet:GetResourceSetResponse' :: GetResourceSetResponse -> ResourceSet
$sel:httpStatus:GetResourceSetResponse' :: GetResourceSetResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceSet
resourceSet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceSetArn