{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.MediaConvert.Types.ResourceTags where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ResourceTags = ResourceTags'
{
ResourceTags -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ResourceTags -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (ResourceTags -> ResourceTags -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceTags -> ResourceTags -> Bool
$c/= :: ResourceTags -> ResourceTags -> Bool
== :: ResourceTags -> ResourceTags -> Bool
$c== :: ResourceTags -> ResourceTags -> Bool
Prelude.Eq, ReadPrec [ResourceTags]
ReadPrec ResourceTags
Int -> ReadS ResourceTags
ReadS [ResourceTags]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceTags]
$creadListPrec :: ReadPrec [ResourceTags]
readPrec :: ReadPrec ResourceTags
$creadPrec :: ReadPrec ResourceTags
readList :: ReadS [ResourceTags]
$creadList :: ReadS [ResourceTags]
readsPrec :: Int -> ReadS ResourceTags
$creadsPrec :: Int -> ReadS ResourceTags
Prelude.Read, Int -> ResourceTags -> ShowS
[ResourceTags] -> ShowS
ResourceTags -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceTags] -> ShowS
$cshowList :: [ResourceTags] -> ShowS
show :: ResourceTags -> String
$cshow :: ResourceTags -> String
showsPrec :: Int -> ResourceTags -> ShowS
$cshowsPrec :: Int -> ResourceTags -> ShowS
Prelude.Show, forall x. Rep ResourceTags x -> ResourceTags
forall x. ResourceTags -> Rep ResourceTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceTags x -> ResourceTags
$cfrom :: forall x. ResourceTags -> Rep ResourceTags x
Prelude.Generic)
newResourceTags ::
ResourceTags
newResourceTags :: ResourceTags
newResourceTags =
ResourceTags'
{ $sel:arn:ResourceTags' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:tags:ResourceTags' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
}
resourceTags_arn :: Lens.Lens' ResourceTags (Prelude.Maybe Prelude.Text)
resourceTags_arn :: Lens' ResourceTags (Maybe Text)
resourceTags_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceTags' {Maybe Text
arn :: Maybe Text
$sel:arn:ResourceTags' :: ResourceTags -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ResourceTags
s@ResourceTags' {} Maybe Text
a -> ResourceTags
s {$sel:arn:ResourceTags' :: Maybe Text
arn = Maybe Text
a} :: ResourceTags)
resourceTags_tags :: Lens.Lens' ResourceTags (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
resourceTags_tags :: Lens' ResourceTags (Maybe (HashMap Text Text))
resourceTags_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceTags' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ResourceTags' :: ResourceTags -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ResourceTags
s@ResourceTags' {} Maybe (HashMap Text Text)
a -> ResourceTags
s {$sel:tags:ResourceTags' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ResourceTags) 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
instance Data.FromJSON ResourceTags where
parseJSON :: Value -> Parser ResourceTags
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResourceTags"
( \Object
x ->
Maybe Text -> Maybe (HashMap Text Text) -> ResourceTags
ResourceTags'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ResourceTags where
hashWithSalt :: Int -> ResourceTags -> Int
hashWithSalt Int
_salt ResourceTags' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
arn :: Maybe Text
$sel:tags:ResourceTags' :: ResourceTags -> Maybe (HashMap Text Text)
$sel:arn:ResourceTags' :: ResourceTags -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
instance Prelude.NFData ResourceTags where
rnf :: ResourceTags -> ()
rnf ResourceTags' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
arn :: Maybe Text
$sel:tags:ResourceTags' :: ResourceTags -> Maybe (HashMap Text Text)
$sel:arn:ResourceTags' :: ResourceTags -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags