{-# 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.MediaLive.CreateTags
(
CreateTags (..),
newCreateTags,
createTags_tags,
createTags_resourceArn,
CreateTagsResponse (..),
newCreateTagsResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateTags = CreateTags'
{ CreateTags -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateTags -> Text
resourceArn :: Prelude.Text
}
deriving (CreateTags -> CreateTags -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTags -> CreateTags -> Bool
$c/= :: CreateTags -> CreateTags -> Bool
== :: CreateTags -> CreateTags -> Bool
$c== :: CreateTags -> CreateTags -> Bool
Prelude.Eq, ReadPrec [CreateTags]
ReadPrec CreateTags
Int -> ReadS CreateTags
ReadS [CreateTags]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTags]
$creadListPrec :: ReadPrec [CreateTags]
readPrec :: ReadPrec CreateTags
$creadPrec :: ReadPrec CreateTags
readList :: ReadS [CreateTags]
$creadList :: ReadS [CreateTags]
readsPrec :: Int -> ReadS CreateTags
$creadsPrec :: Int -> ReadS CreateTags
Prelude.Read, Int -> CreateTags -> ShowS
[CreateTags] -> ShowS
CreateTags -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTags] -> ShowS
$cshowList :: [CreateTags] -> ShowS
show :: CreateTags -> String
$cshow :: CreateTags -> String
showsPrec :: Int -> CreateTags -> ShowS
$cshowsPrec :: Int -> CreateTags -> ShowS
Prelude.Show, forall x. Rep CreateTags x -> CreateTags
forall x. CreateTags -> Rep CreateTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTags x -> CreateTags
$cfrom :: forall x. CreateTags -> Rep CreateTags x
Prelude.Generic)
newCreateTags ::
Prelude.Text ->
CreateTags
newCreateTags :: Text -> CreateTags
newCreateTags Text
pResourceArn_ =
CreateTags'
{ $sel:tags:CreateTags' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:CreateTags' :: Text
resourceArn = Text
pResourceArn_
}
createTags_tags :: Lens.Lens' CreateTags (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createTags_tags :: Lens' CreateTags (Maybe (HashMap Text Text))
createTags_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTags' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateTags' :: CreateTags -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateTags
s@CreateTags' {} Maybe (HashMap Text Text)
a -> CreateTags
s {$sel:tags:CreateTags' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateTags) 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
createTags_resourceArn :: Lens.Lens' CreateTags Prelude.Text
createTags_resourceArn :: Lens' CreateTags Text
createTags_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTags' {Text
resourceArn :: Text
$sel:resourceArn:CreateTags' :: CreateTags -> Text
resourceArn} -> Text
resourceArn) (\s :: CreateTags
s@CreateTags' {} Text
a -> CreateTags
s {$sel:resourceArn:CreateTags' :: Text
resourceArn = Text
a} :: CreateTags)
instance Core.AWSRequest CreateTags where
type AWSResponse CreateTags = CreateTagsResponse
request :: (Service -> Service) -> CreateTags -> Request CreateTags
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 CreateTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTags)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull CreateTagsResponse
CreateTagsResponse'
instance Prelude.Hashable CreateTags where
hashWithSalt :: Int -> CreateTags -> Int
hashWithSalt Int
_salt CreateTags' {Maybe (HashMap Text Text)
Text
resourceArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:resourceArn:CreateTags' :: CreateTags -> Text
$sel:tags:CreateTags' :: CreateTags -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
instance Prelude.NFData CreateTags where
rnf :: CreateTags -> ()
rnf CreateTags' {Maybe (HashMap Text Text)
Text
resourceArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:resourceArn:CreateTags' :: CreateTags -> Text
$sel:tags:CreateTags' :: CreateTags -> 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 Text
resourceArn
instance Data.ToHeaders CreateTags where
toHeaders :: CreateTags -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateTags where
toJSON :: CreateTags -> Value
toJSON CreateTags' {Maybe (HashMap Text Text)
Text
resourceArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:resourceArn:CreateTags' :: CreateTags -> Text
$sel:tags:CreateTags' :: CreateTags -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags]
)
instance Data.ToPath CreateTags where
toPath :: CreateTags -> ByteString
toPath CreateTags' {Maybe (HashMap Text Text)
Text
resourceArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:resourceArn:CreateTags' :: CreateTags -> Text
$sel:tags:CreateTags' :: CreateTags -> Maybe (HashMap Text Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/prod/tags/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceArn]
instance Data.ToQuery CreateTags where
toQuery :: CreateTags -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateTagsResponse = CreateTagsResponse'
{
}
deriving (CreateTagsResponse -> CreateTagsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTagsResponse -> CreateTagsResponse -> Bool
$c/= :: CreateTagsResponse -> CreateTagsResponse -> Bool
== :: CreateTagsResponse -> CreateTagsResponse -> Bool
$c== :: CreateTagsResponse -> CreateTagsResponse -> Bool
Prelude.Eq, ReadPrec [CreateTagsResponse]
ReadPrec CreateTagsResponse
Int -> ReadS CreateTagsResponse
ReadS [CreateTagsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTagsResponse]
$creadListPrec :: ReadPrec [CreateTagsResponse]
readPrec :: ReadPrec CreateTagsResponse
$creadPrec :: ReadPrec CreateTagsResponse
readList :: ReadS [CreateTagsResponse]
$creadList :: ReadS [CreateTagsResponse]
readsPrec :: Int -> ReadS CreateTagsResponse
$creadsPrec :: Int -> ReadS CreateTagsResponse
Prelude.Read, Int -> CreateTagsResponse -> ShowS
[CreateTagsResponse] -> ShowS
CreateTagsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTagsResponse] -> ShowS
$cshowList :: [CreateTagsResponse] -> ShowS
show :: CreateTagsResponse -> String
$cshow :: CreateTagsResponse -> String
showsPrec :: Int -> CreateTagsResponse -> ShowS
$cshowsPrec :: Int -> CreateTagsResponse -> ShowS
Prelude.Show, forall x. Rep CreateTagsResponse x -> CreateTagsResponse
forall x. CreateTagsResponse -> Rep CreateTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTagsResponse x -> CreateTagsResponse
$cfrom :: forall x. CreateTagsResponse -> Rep CreateTagsResponse x
Prelude.Generic)
newCreateTagsResponse ::
CreateTagsResponse
newCreateTagsResponse :: CreateTagsResponse
newCreateTagsResponse = CreateTagsResponse
CreateTagsResponse'
instance Prelude.NFData CreateTagsResponse where
rnf :: CreateTagsResponse -> ()
rnf CreateTagsResponse
_ = ()