{-# 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.ElasticBeanstalk.UpdateTagsForResource
(
UpdateTagsForResource (..),
newUpdateTagsForResource,
updateTagsForResource_tagsToRemove,
updateTagsForResource_tagsToAdd,
updateTagsForResource_resourceArn,
UpdateTagsForResourceResponse (..),
newUpdateTagsForResourceResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateTagsForResource = UpdateTagsForResource'
{
UpdateTagsForResource -> Maybe [Text]
tagsToRemove :: Prelude.Maybe [Prelude.Text],
UpdateTagsForResource -> Maybe [Tag]
tagsToAdd :: Prelude.Maybe [Tag],
UpdateTagsForResource -> Text
resourceArn :: Prelude.Text
}
deriving (UpdateTagsForResource -> UpdateTagsForResource -> Bool
(UpdateTagsForResource -> UpdateTagsForResource -> Bool)
-> (UpdateTagsForResource -> UpdateTagsForResource -> Bool)
-> Eq UpdateTagsForResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTagsForResource -> UpdateTagsForResource -> Bool
$c/= :: UpdateTagsForResource -> UpdateTagsForResource -> Bool
== :: UpdateTagsForResource -> UpdateTagsForResource -> Bool
$c== :: UpdateTagsForResource -> UpdateTagsForResource -> Bool
Prelude.Eq, ReadPrec [UpdateTagsForResource]
ReadPrec UpdateTagsForResource
Int -> ReadS UpdateTagsForResource
ReadS [UpdateTagsForResource]
(Int -> ReadS UpdateTagsForResource)
-> ReadS [UpdateTagsForResource]
-> ReadPrec UpdateTagsForResource
-> ReadPrec [UpdateTagsForResource]
-> Read UpdateTagsForResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTagsForResource]
$creadListPrec :: ReadPrec [UpdateTagsForResource]
readPrec :: ReadPrec UpdateTagsForResource
$creadPrec :: ReadPrec UpdateTagsForResource
readList :: ReadS [UpdateTagsForResource]
$creadList :: ReadS [UpdateTagsForResource]
readsPrec :: Int -> ReadS UpdateTagsForResource
$creadsPrec :: Int -> ReadS UpdateTagsForResource
Prelude.Read, Int -> UpdateTagsForResource -> ShowS
[UpdateTagsForResource] -> ShowS
UpdateTagsForResource -> String
(Int -> UpdateTagsForResource -> ShowS)
-> (UpdateTagsForResource -> String)
-> ([UpdateTagsForResource] -> ShowS)
-> Show UpdateTagsForResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTagsForResource] -> ShowS
$cshowList :: [UpdateTagsForResource] -> ShowS
show :: UpdateTagsForResource -> String
$cshow :: UpdateTagsForResource -> String
showsPrec :: Int -> UpdateTagsForResource -> ShowS
$cshowsPrec :: Int -> UpdateTagsForResource -> ShowS
Prelude.Show, (forall x. UpdateTagsForResource -> Rep UpdateTagsForResource x)
-> (forall x. Rep UpdateTagsForResource x -> UpdateTagsForResource)
-> Generic UpdateTagsForResource
forall x. Rep UpdateTagsForResource x -> UpdateTagsForResource
forall x. UpdateTagsForResource -> Rep UpdateTagsForResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTagsForResource x -> UpdateTagsForResource
$cfrom :: forall x. UpdateTagsForResource -> Rep UpdateTagsForResource x
Prelude.Generic)
newUpdateTagsForResource ::
Prelude.Text ->
UpdateTagsForResource
newUpdateTagsForResource :: Text -> UpdateTagsForResource
newUpdateTagsForResource Text
pResourceArn_ =
UpdateTagsForResource' :: Maybe [Text] -> Maybe [Tag] -> Text -> UpdateTagsForResource
UpdateTagsForResource'
{ $sel:tagsToRemove:UpdateTagsForResource' :: Maybe [Text]
tagsToRemove =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:tagsToAdd:UpdateTagsForResource' :: Maybe [Tag]
tagsToAdd = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:UpdateTagsForResource' :: Text
resourceArn = Text
pResourceArn_
}
updateTagsForResource_tagsToRemove :: Lens.Lens' UpdateTagsForResource (Prelude.Maybe [Prelude.Text])
updateTagsForResource_tagsToRemove :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateTagsForResource -> f UpdateTagsForResource
updateTagsForResource_tagsToRemove = (UpdateTagsForResource -> Maybe [Text])
-> (UpdateTagsForResource -> Maybe [Text] -> UpdateTagsForResource)
-> Lens
UpdateTagsForResource
UpdateTagsForResource
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagsForResource' {Maybe [Text]
tagsToRemove :: Maybe [Text]
$sel:tagsToRemove:UpdateTagsForResource' :: UpdateTagsForResource -> Maybe [Text]
tagsToRemove} -> Maybe [Text]
tagsToRemove) (\s :: UpdateTagsForResource
s@UpdateTagsForResource' {} Maybe [Text]
a -> UpdateTagsForResource
s {$sel:tagsToRemove:UpdateTagsForResource' :: Maybe [Text]
tagsToRemove = Maybe [Text]
a} :: UpdateTagsForResource) ((Maybe [Text] -> f (Maybe [Text]))
-> UpdateTagsForResource -> f UpdateTagsForResource)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateTagsForResource
-> f UpdateTagsForResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateTagsForResource_tagsToAdd :: Lens.Lens' UpdateTagsForResource (Prelude.Maybe [Tag])
updateTagsForResource_tagsToAdd :: (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateTagsForResource -> f UpdateTagsForResource
updateTagsForResource_tagsToAdd = (UpdateTagsForResource -> Maybe [Tag])
-> (UpdateTagsForResource -> Maybe [Tag] -> UpdateTagsForResource)
-> Lens
UpdateTagsForResource
UpdateTagsForResource
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagsForResource' {Maybe [Tag]
tagsToAdd :: Maybe [Tag]
$sel:tagsToAdd:UpdateTagsForResource' :: UpdateTagsForResource -> Maybe [Tag]
tagsToAdd} -> Maybe [Tag]
tagsToAdd) (\s :: UpdateTagsForResource
s@UpdateTagsForResource' {} Maybe [Tag]
a -> UpdateTagsForResource
s {$sel:tagsToAdd:UpdateTagsForResource' :: Maybe [Tag]
tagsToAdd = Maybe [Tag]
a} :: UpdateTagsForResource) ((Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateTagsForResource -> f UpdateTagsForResource)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateTagsForResource
-> f UpdateTagsForResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateTagsForResource_resourceArn :: Lens.Lens' UpdateTagsForResource Prelude.Text
updateTagsForResource_resourceArn :: (Text -> f Text)
-> UpdateTagsForResource -> f UpdateTagsForResource
updateTagsForResource_resourceArn = (UpdateTagsForResource -> Text)
-> (UpdateTagsForResource -> Text -> UpdateTagsForResource)
-> Lens UpdateTagsForResource UpdateTagsForResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagsForResource' {Text
resourceArn :: Text
$sel:resourceArn:UpdateTagsForResource' :: UpdateTagsForResource -> Text
resourceArn} -> Text
resourceArn) (\s :: UpdateTagsForResource
s@UpdateTagsForResource' {} Text
a -> UpdateTagsForResource
s {$sel:resourceArn:UpdateTagsForResource' :: Text
resourceArn = Text
a} :: UpdateTagsForResource)
instance Core.AWSRequest UpdateTagsForResource where
type
AWSResponse UpdateTagsForResource =
UpdateTagsForResourceResponse
request :: UpdateTagsForResource -> Request UpdateTagsForResource
request = Service -> UpdateTagsForResource -> Request UpdateTagsForResource
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateTagsForResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateTagsForResource)))
response =
AWSResponse UpdateTagsForResource
-> Logger
-> Service
-> Proxy UpdateTagsForResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateTagsForResource)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateTagsForResource
UpdateTagsForResourceResponse
UpdateTagsForResourceResponse'
instance Prelude.Hashable UpdateTagsForResource
instance Prelude.NFData UpdateTagsForResource
instance Core.ToHeaders UpdateTagsForResource where
toHeaders :: UpdateTagsForResource -> [Header]
toHeaders = [Header] -> UpdateTagsForResource -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath UpdateTagsForResource where
toPath :: UpdateTagsForResource -> ByteString
toPath = ByteString -> UpdateTagsForResource -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateTagsForResource where
toQuery :: UpdateTagsForResource -> QueryString
toQuery UpdateTagsForResource' {Maybe [Text]
Maybe [Tag]
Text
resourceArn :: Text
tagsToAdd :: Maybe [Tag]
tagsToRemove :: Maybe [Text]
$sel:resourceArn:UpdateTagsForResource' :: UpdateTagsForResource -> Text
$sel:tagsToAdd:UpdateTagsForResource' :: UpdateTagsForResource -> Maybe [Tag]
$sel:tagsToRemove:UpdateTagsForResource' :: UpdateTagsForResource -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"UpdateTagsForResource" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"TagsToRemove"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagsToRemove),
ByteString
"TagsToAdd"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tagsToAdd),
ByteString
"ResourceArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
resourceArn
]
data UpdateTagsForResourceResponse = UpdateTagsForResourceResponse'
{
}
deriving (UpdateTagsForResourceResponse
-> UpdateTagsForResourceResponse -> Bool
(UpdateTagsForResourceResponse
-> UpdateTagsForResourceResponse -> Bool)
-> (UpdateTagsForResourceResponse
-> UpdateTagsForResourceResponse -> Bool)
-> Eq UpdateTagsForResourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTagsForResourceResponse
-> UpdateTagsForResourceResponse -> Bool
$c/= :: UpdateTagsForResourceResponse
-> UpdateTagsForResourceResponse -> Bool
== :: UpdateTagsForResourceResponse
-> UpdateTagsForResourceResponse -> Bool
$c== :: UpdateTagsForResourceResponse
-> UpdateTagsForResourceResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTagsForResourceResponse]
ReadPrec UpdateTagsForResourceResponse
Int -> ReadS UpdateTagsForResourceResponse
ReadS [UpdateTagsForResourceResponse]
(Int -> ReadS UpdateTagsForResourceResponse)
-> ReadS [UpdateTagsForResourceResponse]
-> ReadPrec UpdateTagsForResourceResponse
-> ReadPrec [UpdateTagsForResourceResponse]
-> Read UpdateTagsForResourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTagsForResourceResponse]
$creadListPrec :: ReadPrec [UpdateTagsForResourceResponse]
readPrec :: ReadPrec UpdateTagsForResourceResponse
$creadPrec :: ReadPrec UpdateTagsForResourceResponse
readList :: ReadS [UpdateTagsForResourceResponse]
$creadList :: ReadS [UpdateTagsForResourceResponse]
readsPrec :: Int -> ReadS UpdateTagsForResourceResponse
$creadsPrec :: Int -> ReadS UpdateTagsForResourceResponse
Prelude.Read, Int -> UpdateTagsForResourceResponse -> ShowS
[UpdateTagsForResourceResponse] -> ShowS
UpdateTagsForResourceResponse -> String
(Int -> UpdateTagsForResourceResponse -> ShowS)
-> (UpdateTagsForResourceResponse -> String)
-> ([UpdateTagsForResourceResponse] -> ShowS)
-> Show UpdateTagsForResourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTagsForResourceResponse] -> ShowS
$cshowList :: [UpdateTagsForResourceResponse] -> ShowS
show :: UpdateTagsForResourceResponse -> String
$cshow :: UpdateTagsForResourceResponse -> String
showsPrec :: Int -> UpdateTagsForResourceResponse -> ShowS
$cshowsPrec :: Int -> UpdateTagsForResourceResponse -> ShowS
Prelude.Show, (forall x.
UpdateTagsForResourceResponse
-> Rep UpdateTagsForResourceResponse x)
-> (forall x.
Rep UpdateTagsForResourceResponse x
-> UpdateTagsForResourceResponse)
-> Generic UpdateTagsForResourceResponse
forall x.
Rep UpdateTagsForResourceResponse x
-> UpdateTagsForResourceResponse
forall x.
UpdateTagsForResourceResponse
-> Rep UpdateTagsForResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTagsForResourceResponse x
-> UpdateTagsForResourceResponse
$cfrom :: forall x.
UpdateTagsForResourceResponse
-> Rep UpdateTagsForResourceResponse x
Prelude.Generic)
newUpdateTagsForResourceResponse ::
UpdateTagsForResourceResponse
newUpdateTagsForResourceResponse :: UpdateTagsForResourceResponse
newUpdateTagsForResourceResponse =
UpdateTagsForResourceResponse
UpdateTagsForResourceResponse'
instance Prelude.NFData UpdateTagsForResourceResponse