{-# 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.EC2.Types.TagDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.ResourceType
import qualified Amazonka.Prelude as Prelude
data TagDescription = TagDescription'
{
TagDescription -> Text
resourceId :: Prelude.Text,
TagDescription -> ResourceType
resourceType :: ResourceType,
TagDescription -> Text
key :: Prelude.Text,
TagDescription -> Text
value :: Prelude.Text
}
deriving (TagDescription -> TagDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagDescription -> TagDescription -> Bool
$c/= :: TagDescription -> TagDescription -> Bool
== :: TagDescription -> TagDescription -> Bool
$c== :: TagDescription -> TagDescription -> Bool
Prelude.Eq, ReadPrec [TagDescription]
ReadPrec TagDescription
Int -> ReadS TagDescription
ReadS [TagDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagDescription]
$creadListPrec :: ReadPrec [TagDescription]
readPrec :: ReadPrec TagDescription
$creadPrec :: ReadPrec TagDescription
readList :: ReadS [TagDescription]
$creadList :: ReadS [TagDescription]
readsPrec :: Int -> ReadS TagDescription
$creadsPrec :: Int -> ReadS TagDescription
Prelude.Read, Int -> TagDescription -> ShowS
[TagDescription] -> ShowS
TagDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagDescription] -> ShowS
$cshowList :: [TagDescription] -> ShowS
show :: TagDescription -> String
$cshow :: TagDescription -> String
showsPrec :: Int -> TagDescription -> ShowS
$cshowsPrec :: Int -> TagDescription -> ShowS
Prelude.Show, forall x. Rep TagDescription x -> TagDescription
forall x. TagDescription -> Rep TagDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagDescription x -> TagDescription
$cfrom :: forall x. TagDescription -> Rep TagDescription x
Prelude.Generic)
newTagDescription ::
Prelude.Text ->
ResourceType ->
Prelude.Text ->
Prelude.Text ->
TagDescription
newTagDescription :: Text -> ResourceType -> Text -> Text -> TagDescription
newTagDescription
Text
pResourceId_
ResourceType
pResourceType_
Text
pKey_
Text
pValue_ =
TagDescription'
{ $sel:resourceId:TagDescription' :: Text
resourceId = Text
pResourceId_,
$sel:resourceType:TagDescription' :: ResourceType
resourceType = ResourceType
pResourceType_,
$sel:key:TagDescription' :: Text
key = Text
pKey_,
$sel:value:TagDescription' :: Text
value = Text
pValue_
}
tagDescription_resourceId :: Lens.Lens' TagDescription Prelude.Text
tagDescription_resourceId :: Lens' TagDescription Text
tagDescription_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagDescription' {Text
resourceId :: Text
$sel:resourceId:TagDescription' :: TagDescription -> Text
resourceId} -> Text
resourceId) (\s :: TagDescription
s@TagDescription' {} Text
a -> TagDescription
s {$sel:resourceId:TagDescription' :: Text
resourceId = Text
a} :: TagDescription)
tagDescription_resourceType :: Lens.Lens' TagDescription ResourceType
tagDescription_resourceType :: Lens' TagDescription ResourceType
tagDescription_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagDescription' {ResourceType
resourceType :: ResourceType
$sel:resourceType:TagDescription' :: TagDescription -> ResourceType
resourceType} -> ResourceType
resourceType) (\s :: TagDescription
s@TagDescription' {} ResourceType
a -> TagDescription
s {$sel:resourceType:TagDescription' :: ResourceType
resourceType = ResourceType
a} :: TagDescription)
tagDescription_key :: Lens.Lens' TagDescription Prelude.Text
tagDescription_key :: Lens' TagDescription Text
tagDescription_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagDescription' {Text
key :: Text
$sel:key:TagDescription' :: TagDescription -> Text
key} -> Text
key) (\s :: TagDescription
s@TagDescription' {} Text
a -> TagDescription
s {$sel:key:TagDescription' :: Text
key = Text
a} :: TagDescription)
tagDescription_value :: Lens.Lens' TagDescription Prelude.Text
tagDescription_value :: Lens' TagDescription Text
tagDescription_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagDescription' {Text
value :: Text
$sel:value:TagDescription' :: TagDescription -> Text
value} -> Text
value) (\s :: TagDescription
s@TagDescription' {} Text
a -> TagDescription
s {$sel:value:TagDescription' :: Text
value = Text
a} :: TagDescription)
instance Data.FromXML TagDescription where
parseXML :: [Node] -> Either String TagDescription
parseXML [Node]
x =
Text -> ResourceType -> Text -> Text -> TagDescription
TagDescription'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"resourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"resourceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"key")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"value")
instance Prelude.Hashable TagDescription where
hashWithSalt :: Int -> TagDescription -> Int
hashWithSalt Int
_salt TagDescription' {Text
ResourceType
value :: Text
key :: Text
resourceType :: ResourceType
resourceId :: Text
$sel:value:TagDescription' :: TagDescription -> Text
$sel:key:TagDescription' :: TagDescription -> Text
$sel:resourceType:TagDescription' :: TagDescription -> ResourceType
$sel:resourceId:TagDescription' :: TagDescription -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceType
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
instance Prelude.NFData TagDescription where
rnf :: TagDescription -> ()
rnf TagDescription' {Text
ResourceType
value :: Text
key :: Text
resourceType :: ResourceType
resourceId :: Text
$sel:value:TagDescription' :: TagDescription -> Text
$sel:key:TagDescription' :: TagDescription -> Text
$sel:resourceType:TagDescription' :: TagDescription -> ResourceType
$sel:resourceId:TagDescription' :: TagDescription -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceType
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
value