{-# 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.SSM.Types.ResultAttribute
-- 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.SSM.Types.ResultAttribute 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

-- | The inventory item result attribute.
--
-- /See:/ 'newResultAttribute' smart constructor.
data ResultAttribute = ResultAttribute'
  { -- | Name of the inventory item type. Valid value: @AWS:InstanceInformation@.
    -- Default Value: @AWS:InstanceInformation@.
    ResultAttribute -> Text
typeName :: Prelude.Text
  }
  deriving (ResultAttribute -> ResultAttribute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResultAttribute -> ResultAttribute -> Bool
$c/= :: ResultAttribute -> ResultAttribute -> Bool
== :: ResultAttribute -> ResultAttribute -> Bool
$c== :: ResultAttribute -> ResultAttribute -> Bool
Prelude.Eq, ReadPrec [ResultAttribute]
ReadPrec ResultAttribute
Int -> ReadS ResultAttribute
ReadS [ResultAttribute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResultAttribute]
$creadListPrec :: ReadPrec [ResultAttribute]
readPrec :: ReadPrec ResultAttribute
$creadPrec :: ReadPrec ResultAttribute
readList :: ReadS [ResultAttribute]
$creadList :: ReadS [ResultAttribute]
readsPrec :: Int -> ReadS ResultAttribute
$creadsPrec :: Int -> ReadS ResultAttribute
Prelude.Read, Int -> ResultAttribute -> ShowS
[ResultAttribute] -> ShowS
ResultAttribute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResultAttribute] -> ShowS
$cshowList :: [ResultAttribute] -> ShowS
show :: ResultAttribute -> String
$cshow :: ResultAttribute -> String
showsPrec :: Int -> ResultAttribute -> ShowS
$cshowsPrec :: Int -> ResultAttribute -> ShowS
Prelude.Show, forall x. Rep ResultAttribute x -> ResultAttribute
forall x. ResultAttribute -> Rep ResultAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResultAttribute x -> ResultAttribute
$cfrom :: forall x. ResultAttribute -> Rep ResultAttribute x
Prelude.Generic)

-- |
-- Create a value of 'ResultAttribute' 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:
--
-- 'typeName', 'resultAttribute_typeName' - Name of the inventory item type. Valid value: @AWS:InstanceInformation@.
-- Default Value: @AWS:InstanceInformation@.
newResultAttribute ::
  -- | 'typeName'
  Prelude.Text ->
  ResultAttribute
newResultAttribute :: Text -> ResultAttribute
newResultAttribute Text
pTypeName_ =
  ResultAttribute' {$sel:typeName:ResultAttribute' :: Text
typeName = Text
pTypeName_}

-- | Name of the inventory item type. Valid value: @AWS:InstanceInformation@.
-- Default Value: @AWS:InstanceInformation@.
resultAttribute_typeName :: Lens.Lens' ResultAttribute Prelude.Text
resultAttribute_typeName :: Lens' ResultAttribute Text
resultAttribute_typeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultAttribute' {Text
typeName :: Text
$sel:typeName:ResultAttribute' :: ResultAttribute -> Text
typeName} -> Text
typeName) (\s :: ResultAttribute
s@ResultAttribute' {} Text
a -> ResultAttribute
s {$sel:typeName:ResultAttribute' :: Text
typeName = Text
a} :: ResultAttribute)

instance Prelude.Hashable ResultAttribute where
  hashWithSalt :: Int -> ResultAttribute -> Int
hashWithSalt Int
_salt ResultAttribute' {Text
typeName :: Text
$sel:typeName:ResultAttribute' :: ResultAttribute -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
typeName

instance Prelude.NFData ResultAttribute where
  rnf :: ResultAttribute -> ()
rnf ResultAttribute' {Text
typeName :: Text
$sel:typeName:ResultAttribute' :: ResultAttribute -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
typeName

instance Data.ToJSON ResultAttribute where
  toJSON :: ResultAttribute -> Value
toJSON ResultAttribute' {Text
typeName :: Text
$sel:typeName:ResultAttribute' :: ResultAttribute -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"TypeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
typeName)]
      )