{-# 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.ServiceCatalog.Types.TagOptionDetail
-- 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.ServiceCatalog.Types.TagOptionDetail 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

-- | Information about a TagOption.
--
-- /See:/ 'newTagOptionDetail' smart constructor.
data TagOptionDetail = TagOptionDetail'
  { -- | The TagOption active state.
    TagOptionDetail -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
    -- | The TagOption identifier.
    TagOptionDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The TagOption key.
    TagOptionDetail -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account Id of the owner account that created the
    -- TagOption.
    TagOptionDetail -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
    -- | The TagOption value.
    TagOptionDetail -> Maybe Text
value :: Prelude.Maybe Prelude.Text
  }
  deriving (TagOptionDetail -> TagOptionDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagOptionDetail -> TagOptionDetail -> Bool
$c/= :: TagOptionDetail -> TagOptionDetail -> Bool
== :: TagOptionDetail -> TagOptionDetail -> Bool
$c== :: TagOptionDetail -> TagOptionDetail -> Bool
Prelude.Eq, ReadPrec [TagOptionDetail]
ReadPrec TagOptionDetail
Int -> ReadS TagOptionDetail
ReadS [TagOptionDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagOptionDetail]
$creadListPrec :: ReadPrec [TagOptionDetail]
readPrec :: ReadPrec TagOptionDetail
$creadPrec :: ReadPrec TagOptionDetail
readList :: ReadS [TagOptionDetail]
$creadList :: ReadS [TagOptionDetail]
readsPrec :: Int -> ReadS TagOptionDetail
$creadsPrec :: Int -> ReadS TagOptionDetail
Prelude.Read, Int -> TagOptionDetail -> ShowS
[TagOptionDetail] -> ShowS
TagOptionDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagOptionDetail] -> ShowS
$cshowList :: [TagOptionDetail] -> ShowS
show :: TagOptionDetail -> String
$cshow :: TagOptionDetail -> String
showsPrec :: Int -> TagOptionDetail -> ShowS
$cshowsPrec :: Int -> TagOptionDetail -> ShowS
Prelude.Show, forall x. Rep TagOptionDetail x -> TagOptionDetail
forall x. TagOptionDetail -> Rep TagOptionDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagOptionDetail x -> TagOptionDetail
$cfrom :: forall x. TagOptionDetail -> Rep TagOptionDetail x
Prelude.Generic)

-- |
-- Create a value of 'TagOptionDetail' 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:
--
-- 'active', 'tagOptionDetail_active' - The TagOption active state.
--
-- 'id', 'tagOptionDetail_id' - The TagOption identifier.
--
-- 'key', 'tagOptionDetail_key' - The TagOption key.
--
-- 'owner', 'tagOptionDetail_owner' - The Amazon Web Services account Id of the owner account that created the
-- TagOption.
--
-- 'value', 'tagOptionDetail_value' - The TagOption value.
newTagOptionDetail ::
  TagOptionDetail
newTagOptionDetail :: TagOptionDetail
newTagOptionDetail =
  TagOptionDetail'
    { $sel:active:TagOptionDetail' :: Maybe Bool
active = forall a. Maybe a
Prelude.Nothing,
      $sel:id:TagOptionDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:key:TagOptionDetail' :: Maybe Text
key = forall a. Maybe a
Prelude.Nothing,
      $sel:owner:TagOptionDetail' :: Maybe Text
owner = forall a. Maybe a
Prelude.Nothing,
      $sel:value:TagOptionDetail' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
    }

-- | The TagOption active state.
tagOptionDetail_active :: Lens.Lens' TagOptionDetail (Prelude.Maybe Prelude.Bool)
tagOptionDetail_active :: Lens' TagOptionDetail (Maybe Bool)
tagOptionDetail_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagOptionDetail' {Maybe Bool
active :: Maybe Bool
$sel:active:TagOptionDetail' :: TagOptionDetail -> Maybe Bool
active} -> Maybe Bool
active) (\s :: TagOptionDetail
s@TagOptionDetail' {} Maybe Bool
a -> TagOptionDetail
s {$sel:active:TagOptionDetail' :: Maybe Bool
active = Maybe Bool
a} :: TagOptionDetail)

-- | The TagOption identifier.
tagOptionDetail_id :: Lens.Lens' TagOptionDetail (Prelude.Maybe Prelude.Text)
tagOptionDetail_id :: Lens' TagOptionDetail (Maybe Text)
tagOptionDetail_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagOptionDetail' {Maybe Text
id :: Maybe Text
$sel:id:TagOptionDetail' :: TagOptionDetail -> Maybe Text
id} -> Maybe Text
id) (\s :: TagOptionDetail
s@TagOptionDetail' {} Maybe Text
a -> TagOptionDetail
s {$sel:id:TagOptionDetail' :: Maybe Text
id = Maybe Text
a} :: TagOptionDetail)

-- | The TagOption key.
tagOptionDetail_key :: Lens.Lens' TagOptionDetail (Prelude.Maybe Prelude.Text)
tagOptionDetail_key :: Lens' TagOptionDetail (Maybe Text)
tagOptionDetail_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagOptionDetail' {Maybe Text
key :: Maybe Text
$sel:key:TagOptionDetail' :: TagOptionDetail -> Maybe Text
key} -> Maybe Text
key) (\s :: TagOptionDetail
s@TagOptionDetail' {} Maybe Text
a -> TagOptionDetail
s {$sel:key:TagOptionDetail' :: Maybe Text
key = Maybe Text
a} :: TagOptionDetail)

-- | The Amazon Web Services account Id of the owner account that created the
-- TagOption.
tagOptionDetail_owner :: Lens.Lens' TagOptionDetail (Prelude.Maybe Prelude.Text)
tagOptionDetail_owner :: Lens' TagOptionDetail (Maybe Text)
tagOptionDetail_owner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagOptionDetail' {Maybe Text
owner :: Maybe Text
$sel:owner:TagOptionDetail' :: TagOptionDetail -> Maybe Text
owner} -> Maybe Text
owner) (\s :: TagOptionDetail
s@TagOptionDetail' {} Maybe Text
a -> TagOptionDetail
s {$sel:owner:TagOptionDetail' :: Maybe Text
owner = Maybe Text
a} :: TagOptionDetail)

-- | The TagOption value.
tagOptionDetail_value :: Lens.Lens' TagOptionDetail (Prelude.Maybe Prelude.Text)
tagOptionDetail_value :: Lens' TagOptionDetail (Maybe Text)
tagOptionDetail_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagOptionDetail' {Maybe Text
value :: Maybe Text
$sel:value:TagOptionDetail' :: TagOptionDetail -> Maybe Text
value} -> Maybe Text
value) (\s :: TagOptionDetail
s@TagOptionDetail' {} Maybe Text
a -> TagOptionDetail
s {$sel:value:TagOptionDetail' :: Maybe Text
value = Maybe Text
a} :: TagOptionDetail)

instance Data.FromJSON TagOptionDetail where
  parseJSON :: Value -> Parser TagOptionDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TagOptionDetail"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TagOptionDetail
TagOptionDetail'
            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
"Active")
            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
"Id")
            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
"Key")
            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
"Owner")
            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
"Value")
      )

instance Prelude.Hashable TagOptionDetail where
  hashWithSalt :: Int -> TagOptionDetail -> Int
hashWithSalt Int
_salt TagOptionDetail' {Maybe Bool
Maybe Text
value :: Maybe Text
owner :: Maybe Text
key :: Maybe Text
id :: Maybe Text
active :: Maybe Bool
$sel:value:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:owner:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:key:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:id:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:active:TagOptionDetail' :: TagOptionDetail -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
key
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
owner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value

instance Prelude.NFData TagOptionDetail where
  rnf :: TagOptionDetail -> ()
rnf TagOptionDetail' {Maybe Bool
Maybe Text
value :: Maybe Text
owner :: Maybe Text
key :: Maybe Text
id :: Maybe Text
active :: Maybe Bool
$sel:value:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:owner:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:key:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:id:TagOptionDetail' :: TagOptionDetail -> Maybe Text
$sel:active:TagOptionDetail' :: TagOptionDetail -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
key
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
owner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value