{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.BackupGateway.Types.VmwareTag
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.BackupGateway.Types.VmwareTag 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

-- | A VMware tag is a tag attached to a specific virtual machine. A
-- <https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BGW_Tag.html tag>
-- is a key-value pair you can use to manage, filter, and search for your
-- resources.
--
-- The content of VMware tags can be matched to Amazon Web Services tags.
--
-- /See:/ 'newVmwareTag' smart constructor.
data VmwareTag = VmwareTag'
  { -- | The is the category of VMware.
    VmwareTag -> Maybe Text
vmwareCategory :: Prelude.Maybe Prelude.Text,
    -- | This is a user-defined description of a VMware tag.
    VmwareTag -> Maybe Text
vmwareTagDescription :: Prelude.Maybe Prelude.Text,
    -- | This is the user-defined name of a VMware tag.
    VmwareTag -> Maybe Text
vmwareTagName :: Prelude.Maybe Prelude.Text
  }
  deriving (VmwareTag -> VmwareTag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VmwareTag -> VmwareTag -> Bool
$c/= :: VmwareTag -> VmwareTag -> Bool
== :: VmwareTag -> VmwareTag -> Bool
$c== :: VmwareTag -> VmwareTag -> Bool
Prelude.Eq, ReadPrec [VmwareTag]
ReadPrec VmwareTag
Int -> ReadS VmwareTag
ReadS [VmwareTag]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VmwareTag]
$creadListPrec :: ReadPrec [VmwareTag]
readPrec :: ReadPrec VmwareTag
$creadPrec :: ReadPrec VmwareTag
readList :: ReadS [VmwareTag]
$creadList :: ReadS [VmwareTag]
readsPrec :: Int -> ReadS VmwareTag
$creadsPrec :: Int -> ReadS VmwareTag
Prelude.Read, Int -> VmwareTag -> ShowS
[VmwareTag] -> ShowS
VmwareTag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VmwareTag] -> ShowS
$cshowList :: [VmwareTag] -> ShowS
show :: VmwareTag -> String
$cshow :: VmwareTag -> String
showsPrec :: Int -> VmwareTag -> ShowS
$cshowsPrec :: Int -> VmwareTag -> ShowS
Prelude.Show, forall x. Rep VmwareTag x -> VmwareTag
forall x. VmwareTag -> Rep VmwareTag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VmwareTag x -> VmwareTag
$cfrom :: forall x. VmwareTag -> Rep VmwareTag x
Prelude.Generic)

-- |
-- Create a value of 'VmwareTag' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'vmwareCategory', 'vmwareTag_vmwareCategory' - The is the category of VMware.
--
-- 'vmwareTagDescription', 'vmwareTag_vmwareTagDescription' - This is a user-defined description of a VMware tag.
--
-- 'vmwareTagName', 'vmwareTag_vmwareTagName' - This is the user-defined name of a VMware tag.
newVmwareTag ::
  VmwareTag
newVmwareTag :: VmwareTag
newVmwareTag =
  VmwareTag'
    { $sel:vmwareCategory:VmwareTag' :: Maybe Text
vmwareCategory = forall a. Maybe a
Prelude.Nothing,
      $sel:vmwareTagDescription:VmwareTag' :: Maybe Text
vmwareTagDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:vmwareTagName:VmwareTag' :: Maybe Text
vmwareTagName = forall a. Maybe a
Prelude.Nothing
    }

-- | The is the category of VMware.
vmwareTag_vmwareCategory :: Lens.Lens' VmwareTag (Prelude.Maybe Prelude.Text)
vmwareTag_vmwareCategory :: Lens' VmwareTag (Maybe Text)
vmwareTag_vmwareCategory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VmwareTag' {Maybe Text
vmwareCategory :: Maybe Text
$sel:vmwareCategory:VmwareTag' :: VmwareTag -> Maybe Text
vmwareCategory} -> Maybe Text
vmwareCategory) (\s :: VmwareTag
s@VmwareTag' {} Maybe Text
a -> VmwareTag
s {$sel:vmwareCategory:VmwareTag' :: Maybe Text
vmwareCategory = Maybe Text
a} :: VmwareTag)

-- | This is a user-defined description of a VMware tag.
vmwareTag_vmwareTagDescription :: Lens.Lens' VmwareTag (Prelude.Maybe Prelude.Text)
vmwareTag_vmwareTagDescription :: Lens' VmwareTag (Maybe Text)
vmwareTag_vmwareTagDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VmwareTag' {Maybe Text
vmwareTagDescription :: Maybe Text
$sel:vmwareTagDescription:VmwareTag' :: VmwareTag -> Maybe Text
vmwareTagDescription} -> Maybe Text
vmwareTagDescription) (\s :: VmwareTag
s@VmwareTag' {} Maybe Text
a -> VmwareTag
s {$sel:vmwareTagDescription:VmwareTag' :: Maybe Text
vmwareTagDescription = Maybe Text
a} :: VmwareTag)

-- | This is the user-defined name of a VMware tag.
vmwareTag_vmwareTagName :: Lens.Lens' VmwareTag (Prelude.Maybe Prelude.Text)
vmwareTag_vmwareTagName :: Lens' VmwareTag (Maybe Text)
vmwareTag_vmwareTagName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VmwareTag' {Maybe Text
vmwareTagName :: Maybe Text
$sel:vmwareTagName:VmwareTag' :: VmwareTag -> Maybe Text
vmwareTagName} -> Maybe Text
vmwareTagName) (\s :: VmwareTag
s@VmwareTag' {} Maybe Text
a -> VmwareTag
s {$sel:vmwareTagName:VmwareTag' :: Maybe Text
vmwareTagName = Maybe Text
a} :: VmwareTag)

instance Data.FromJSON VmwareTag where
  parseJSON :: Value -> Parser VmwareTag
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VmwareTag"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> VmwareTag
VmwareTag'
            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
"VmwareCategory")
            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
"VmwareTagDescription")
            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
"VmwareTagName")
      )

instance Prelude.Hashable VmwareTag where
  hashWithSalt :: Int -> VmwareTag -> Int
hashWithSalt Int
_salt VmwareTag' {Maybe Text
vmwareTagName :: Maybe Text
vmwareTagDescription :: Maybe Text
vmwareCategory :: Maybe Text
$sel:vmwareTagName:VmwareTag' :: VmwareTag -> Maybe Text
$sel:vmwareTagDescription:VmwareTag' :: VmwareTag -> Maybe Text
$sel:vmwareCategory:VmwareTag' :: VmwareTag -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vmwareCategory
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vmwareTagDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vmwareTagName

instance Prelude.NFData VmwareTag where
  rnf :: VmwareTag -> ()
rnf VmwareTag' {Maybe Text
vmwareTagName :: Maybe Text
vmwareTagDescription :: Maybe Text
vmwareCategory :: Maybe Text
$sel:vmwareTagName:VmwareTag' :: VmwareTag -> Maybe Text
$sel:vmwareTagDescription:VmwareTag' :: VmwareTag -> Maybe Text
$sel:vmwareCategory:VmwareTag' :: VmwareTag -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vmwareCategory
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vmwareTagDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vmwareTagName