{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSM.Types.ResultAttribute where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ResultAttribute -> ResultAttribute -> Bool)
-> (ResultAttribute -> ResultAttribute -> Bool)
-> Eq ResultAttribute
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]
(Int -> ReadS ResultAttribute)
-> ReadS [ResultAttribute]
-> ReadPrec ResultAttribute
-> ReadPrec [ResultAttribute]
-> Read 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
(Int -> ResultAttribute -> ShowS)
-> (ResultAttribute -> String)
-> ([ResultAttribute] -> ShowS)
-> Show ResultAttribute
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. ResultAttribute -> Rep ResultAttribute x)
-> (forall x. Rep ResultAttribute x -> ResultAttribute)
-> Generic ResultAttribute
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' :: Text -> ResultAttribute
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 :: (Text -> f Text) -> ResultAttribute -> f ResultAttribute
resultAttribute_typeName = (ResultAttribute -> Text)
-> (ResultAttribute -> Text -> ResultAttribute)
-> Lens ResultAttribute ResultAttribute Text Text
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

instance Prelude.NFData ResultAttribute

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