{-# 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.Lambda.ListTags
(
ListTags (..),
newListTags,
listTags_resource,
ListTagsResponse (..),
newListTagsResponse,
listTagsResponse_tags,
listTagsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListTags = ListTags'
{
ListTags -> Text
resource :: Prelude.Text
}
deriving (ListTags -> ListTags -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTags -> ListTags -> Bool
$c/= :: ListTags -> ListTags -> Bool
== :: ListTags -> ListTags -> Bool
$c== :: ListTags -> ListTags -> Bool
Prelude.Eq, ReadPrec [ListTags]
ReadPrec ListTags
Int -> ReadS ListTags
ReadS [ListTags]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTags]
$creadListPrec :: ReadPrec [ListTags]
readPrec :: ReadPrec ListTags
$creadPrec :: ReadPrec ListTags
readList :: ReadS [ListTags]
$creadList :: ReadS [ListTags]
readsPrec :: Int -> ReadS ListTags
$creadsPrec :: Int -> ReadS ListTags
Prelude.Read, Int -> ListTags -> ShowS
[ListTags] -> ShowS
ListTags -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTags] -> ShowS
$cshowList :: [ListTags] -> ShowS
show :: ListTags -> String
$cshow :: ListTags -> String
showsPrec :: Int -> ListTags -> ShowS
$cshowsPrec :: Int -> ListTags -> ShowS
Prelude.Show, forall x. Rep ListTags x -> ListTags
forall x. ListTags -> Rep ListTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTags x -> ListTags
$cfrom :: forall x. ListTags -> Rep ListTags x
Prelude.Generic)
newListTags ::
Prelude.Text ->
ListTags
newListTags :: Text -> ListTags
newListTags Text
pResource_ =
ListTags' {$sel:resource:ListTags' :: Text
resource = Text
pResource_}
listTags_resource :: Lens.Lens' ListTags Prelude.Text
listTags_resource :: Lens' ListTags Text
listTags_resource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTags' {Text
resource :: Text
$sel:resource:ListTags' :: ListTags -> Text
resource} -> Text
resource) (\s :: ListTags
s@ListTags' {} Text
a -> ListTags
s {$sel:resource:ListTags' :: Text
resource = Text
a} :: ListTags)
instance Core.AWSRequest ListTags where
type AWSResponse ListTags = ListTagsResponse
request :: (Service -> Service) -> ListTags -> Request ListTags
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTags)))
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 (HashMap Text Text) -> Int -> ListTagsResponse
ListTagsResponse'
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
"Tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 ListTags where
hashWithSalt :: Int -> ListTags -> Int
hashWithSalt Int
_salt ListTags' {Text
resource :: Text
$sel:resource:ListTags' :: ListTags -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resource
instance Prelude.NFData ListTags where
rnf :: ListTags -> ()
rnf ListTags' {Text
resource :: Text
$sel:resource:ListTags' :: ListTags -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
resource
instance Data.ToHeaders ListTags where
toHeaders :: ListTags -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListTags where
toPath :: ListTags -> ByteString
toPath ListTags' {Text
resource :: Text
$sel:resource:ListTags' :: ListTags -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2017-03-31/tags/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
resource]
instance Data.ToQuery ListTags where
toQuery :: ListTags -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListTagsResponse = ListTagsResponse'
{
ListTagsResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ListTagsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListTagsResponse -> ListTagsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagsResponse -> ListTagsResponse -> Bool
$c/= :: ListTagsResponse -> ListTagsResponse -> Bool
== :: ListTagsResponse -> ListTagsResponse -> Bool
$c== :: ListTagsResponse -> ListTagsResponse -> Bool
Prelude.Eq, ReadPrec [ListTagsResponse]
ReadPrec ListTagsResponse
Int -> ReadS ListTagsResponse
ReadS [ListTagsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagsResponse]
$creadListPrec :: ReadPrec [ListTagsResponse]
readPrec :: ReadPrec ListTagsResponse
$creadPrec :: ReadPrec ListTagsResponse
readList :: ReadS [ListTagsResponse]
$creadList :: ReadS [ListTagsResponse]
readsPrec :: Int -> ReadS ListTagsResponse
$creadsPrec :: Int -> ReadS ListTagsResponse
Prelude.Read, Int -> ListTagsResponse -> ShowS
[ListTagsResponse] -> ShowS
ListTagsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagsResponse] -> ShowS
$cshowList :: [ListTagsResponse] -> ShowS
show :: ListTagsResponse -> String
$cshow :: ListTagsResponse -> String
showsPrec :: Int -> ListTagsResponse -> ShowS
$cshowsPrec :: Int -> ListTagsResponse -> ShowS
Prelude.Show, forall x. Rep ListTagsResponse x -> ListTagsResponse
forall x. ListTagsResponse -> Rep ListTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagsResponse x -> ListTagsResponse
$cfrom :: forall x. ListTagsResponse -> Rep ListTagsResponse x
Prelude.Generic)
newListTagsResponse ::
Prelude.Int ->
ListTagsResponse
newListTagsResponse :: Int -> ListTagsResponse
newListTagsResponse Int
pHttpStatus_ =
ListTagsResponse'
{ $sel:tags:ListTagsResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listTagsResponse_tags :: Lens.Lens' ListTagsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
listTagsResponse_tags :: Lens' ListTagsResponse (Maybe (HashMap Text Text))
listTagsResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ListTagsResponse' :: ListTagsResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ListTagsResponse
s@ListTagsResponse' {} Maybe (HashMap Text Text)
a -> ListTagsResponse
s {$sel:tags:ListTagsResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ListTagsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listTagsResponse_httpStatus :: Lens.Lens' ListTagsResponse Prelude.Int
listTagsResponse_httpStatus :: Lens' ListTagsResponse Int
listTagsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTagsResponse' :: ListTagsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTagsResponse
s@ListTagsResponse' {} Int
a -> ListTagsResponse
s {$sel:httpStatus:ListTagsResponse' :: Int
httpStatus = Int
a} :: ListTagsResponse)
instance Prelude.NFData ListTagsResponse where
rnf :: ListTagsResponse -> ()
rnf ListTagsResponse' {Int
Maybe (HashMap Text Text)
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
$sel:httpStatus:ListTagsResponse' :: ListTagsResponse -> Int
$sel:tags:ListTagsResponse' :: ListTagsResponse -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus