{-# 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.OpenSearch.AddTags
(
AddTags (..),
newAddTags,
addTags_arn,
addTags_tagList,
AddTagsResponse (..),
newAddTagsResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AddTags = AddTags'
{
AddTags -> Text
arn :: Prelude.Text,
AddTags -> [Tag]
tagList :: [Tag]
}
deriving (AddTags -> AddTags -> Bool
(AddTags -> AddTags -> Bool)
-> (AddTags -> AddTags -> Bool) -> Eq AddTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTags -> AddTags -> Bool
$c/= :: AddTags -> AddTags -> Bool
== :: AddTags -> AddTags -> Bool
$c== :: AddTags -> AddTags -> Bool
Prelude.Eq, ReadPrec [AddTags]
ReadPrec AddTags
Int -> ReadS AddTags
ReadS [AddTags]
(Int -> ReadS AddTags)
-> ReadS [AddTags]
-> ReadPrec AddTags
-> ReadPrec [AddTags]
-> Read AddTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTags]
$creadListPrec :: ReadPrec [AddTags]
readPrec :: ReadPrec AddTags
$creadPrec :: ReadPrec AddTags
readList :: ReadS [AddTags]
$creadList :: ReadS [AddTags]
readsPrec :: Int -> ReadS AddTags
$creadsPrec :: Int -> ReadS AddTags
Prelude.Read, Int -> AddTags -> ShowS
[AddTags] -> ShowS
AddTags -> String
(Int -> AddTags -> ShowS)
-> (AddTags -> String) -> ([AddTags] -> ShowS) -> Show AddTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTags] -> ShowS
$cshowList :: [AddTags] -> ShowS
show :: AddTags -> String
$cshow :: AddTags -> String
showsPrec :: Int -> AddTags -> ShowS
$cshowsPrec :: Int -> AddTags -> ShowS
Prelude.Show, (forall x. AddTags -> Rep AddTags x)
-> (forall x. Rep AddTags x -> AddTags) -> Generic AddTags
forall x. Rep AddTags x -> AddTags
forall x. AddTags -> Rep AddTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTags x -> AddTags
$cfrom :: forall x. AddTags -> Rep AddTags x
Prelude.Generic)
newAddTags ::
Prelude.Text ->
AddTags
newAddTags :: Text -> AddTags
newAddTags Text
pARN_ =
AddTags' :: Text -> [Tag] -> AddTags
AddTags' {$sel:arn:AddTags' :: Text
arn = Text
pARN_, $sel:tagList:AddTags' :: [Tag]
tagList = [Tag]
forall a. Monoid a => a
Prelude.mempty}
addTags_arn :: Lens.Lens' AddTags Prelude.Text
addTags_arn :: (Text -> f Text) -> AddTags -> f AddTags
addTags_arn = (AddTags -> Text)
-> (AddTags -> Text -> AddTags) -> Lens AddTags AddTags Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTags' {Text
arn :: Text
$sel:arn:AddTags' :: AddTags -> Text
arn} -> Text
arn) (\s :: AddTags
s@AddTags' {} Text
a -> AddTags
s {$sel:arn:AddTags' :: Text
arn = Text
a} :: AddTags)
addTags_tagList :: Lens.Lens' AddTags [Tag]
addTags_tagList :: ([Tag] -> f [Tag]) -> AddTags -> f AddTags
addTags_tagList = (AddTags -> [Tag])
-> (AddTags -> [Tag] -> AddTags)
-> Lens AddTags AddTags [Tag] [Tag]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddTags' {[Tag]
tagList :: [Tag]
$sel:tagList:AddTags' :: AddTags -> [Tag]
tagList} -> [Tag]
tagList) (\s :: AddTags
s@AddTags' {} [Tag]
a -> AddTags
s {$sel:tagList:AddTags' :: [Tag]
tagList = [Tag]
a} :: AddTags) (([Tag] -> f [Tag]) -> AddTags -> f AddTags)
-> (([Tag] -> f [Tag]) -> [Tag] -> f [Tag])
-> ([Tag] -> f [Tag])
-> AddTags
-> f AddTags
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Tag] -> f [Tag]) -> [Tag] -> f [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest AddTags where
type AWSResponse AddTags = AddTagsResponse
request :: AddTags -> Request AddTags
request = Service -> AddTags -> Request AddTags
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AddTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddTags)))
response = AWSResponse AddTags
-> Logger
-> Service
-> Proxy AddTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddTags)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse AddTags
AddTagsResponse
AddTagsResponse'
instance Prelude.Hashable AddTags
instance Prelude.NFData AddTags
instance Core.ToHeaders AddTags where
toHeaders :: AddTags -> [Header]
toHeaders = [Header] -> AddTags -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON AddTags where
toJSON :: AddTags -> Value
toJSON AddTags' {[Tag]
Text
tagList :: [Tag]
arn :: Text
$sel:tagList:AddTags' :: AddTags -> [Tag]
$sel:arn:AddTags' :: AddTags -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TagList" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Tag]
tagList)
]
)
instance Core.ToPath AddTags where
toPath :: AddTags -> ByteString
toPath = ByteString -> AddTags -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2021-01-01/tags"
instance Core.ToQuery AddTags where
toQuery :: AddTags -> QueryString
toQuery = QueryString -> AddTags -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AddTagsResponse = AddTagsResponse'
{
}
deriving (AddTagsResponse -> AddTagsResponse -> Bool
(AddTagsResponse -> AddTagsResponse -> Bool)
-> (AddTagsResponse -> AddTagsResponse -> Bool)
-> Eq AddTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddTagsResponse -> AddTagsResponse -> Bool
$c/= :: AddTagsResponse -> AddTagsResponse -> Bool
== :: AddTagsResponse -> AddTagsResponse -> Bool
$c== :: AddTagsResponse -> AddTagsResponse -> Bool
Prelude.Eq, ReadPrec [AddTagsResponse]
ReadPrec AddTagsResponse
Int -> ReadS AddTagsResponse
ReadS [AddTagsResponse]
(Int -> ReadS AddTagsResponse)
-> ReadS [AddTagsResponse]
-> ReadPrec AddTagsResponse
-> ReadPrec [AddTagsResponse]
-> Read AddTagsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddTagsResponse]
$creadListPrec :: ReadPrec [AddTagsResponse]
readPrec :: ReadPrec AddTagsResponse
$creadPrec :: ReadPrec AddTagsResponse
readList :: ReadS [AddTagsResponse]
$creadList :: ReadS [AddTagsResponse]
readsPrec :: Int -> ReadS AddTagsResponse
$creadsPrec :: Int -> ReadS AddTagsResponse
Prelude.Read, Int -> AddTagsResponse -> ShowS
[AddTagsResponse] -> ShowS
AddTagsResponse -> String
(Int -> AddTagsResponse -> ShowS)
-> (AddTagsResponse -> String)
-> ([AddTagsResponse] -> ShowS)
-> Show AddTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddTagsResponse] -> ShowS
$cshowList :: [AddTagsResponse] -> ShowS
show :: AddTagsResponse -> String
$cshow :: AddTagsResponse -> String
showsPrec :: Int -> AddTagsResponse -> ShowS
$cshowsPrec :: Int -> AddTagsResponse -> ShowS
Prelude.Show, (forall x. AddTagsResponse -> Rep AddTagsResponse x)
-> (forall x. Rep AddTagsResponse x -> AddTagsResponse)
-> Generic AddTagsResponse
forall x. Rep AddTagsResponse x -> AddTagsResponse
forall x. AddTagsResponse -> Rep AddTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddTagsResponse x -> AddTagsResponse
$cfrom :: forall x. AddTagsResponse -> Rep AddTagsResponse x
Prelude.Generic)
newAddTagsResponse ::
AddTagsResponse
newAddTagsResponse :: AddTagsResponse
newAddTagsResponse = AddTagsResponse
AddTagsResponse'
instance Prelude.NFData AddTagsResponse