{-# 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.OpsResultAttribute
-- 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.OpsResultAttribute 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 OpsItem data type to return.
--
-- /See:/ 'newOpsResultAttribute' smart constructor.
data OpsResultAttribute = OpsResultAttribute'
  { -- | Name of the data type. Valid value: @AWS:OpsItem@,
    -- @AWS:EC2InstanceInformation@, @AWS:OpsItemTrendline@, or
    -- @AWS:ComplianceSummary@.
    OpsResultAttribute -> Text
typeName :: Prelude.Text
  }
  deriving (OpsResultAttribute -> OpsResultAttribute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpsResultAttribute -> OpsResultAttribute -> Bool
$c/= :: OpsResultAttribute -> OpsResultAttribute -> Bool
== :: OpsResultAttribute -> OpsResultAttribute -> Bool
$c== :: OpsResultAttribute -> OpsResultAttribute -> Bool
Prelude.Eq, ReadPrec [OpsResultAttribute]
ReadPrec OpsResultAttribute
Int -> ReadS OpsResultAttribute
ReadS [OpsResultAttribute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpsResultAttribute]
$creadListPrec :: ReadPrec [OpsResultAttribute]
readPrec :: ReadPrec OpsResultAttribute
$creadPrec :: ReadPrec OpsResultAttribute
readList :: ReadS [OpsResultAttribute]
$creadList :: ReadS [OpsResultAttribute]
readsPrec :: Int -> ReadS OpsResultAttribute
$creadsPrec :: Int -> ReadS OpsResultAttribute
Prelude.Read, Int -> OpsResultAttribute -> ShowS
[OpsResultAttribute] -> ShowS
OpsResultAttribute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpsResultAttribute] -> ShowS
$cshowList :: [OpsResultAttribute] -> ShowS
show :: OpsResultAttribute -> String
$cshow :: OpsResultAttribute -> String
showsPrec :: Int -> OpsResultAttribute -> ShowS
$cshowsPrec :: Int -> OpsResultAttribute -> ShowS
Prelude.Show, forall x. Rep OpsResultAttribute x -> OpsResultAttribute
forall x. OpsResultAttribute -> Rep OpsResultAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpsResultAttribute x -> OpsResultAttribute
$cfrom :: forall x. OpsResultAttribute -> Rep OpsResultAttribute x
Prelude.Generic)

-- |
-- Create a value of 'OpsResultAttribute' 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', 'opsResultAttribute_typeName' - Name of the data type. Valid value: @AWS:OpsItem@,
-- @AWS:EC2InstanceInformation@, @AWS:OpsItemTrendline@, or
-- @AWS:ComplianceSummary@.
newOpsResultAttribute ::
  -- | 'typeName'
  Prelude.Text ->
  OpsResultAttribute
newOpsResultAttribute :: Text -> OpsResultAttribute
newOpsResultAttribute Text
pTypeName_ =
  OpsResultAttribute' {$sel:typeName:OpsResultAttribute' :: Text
typeName = Text
pTypeName_}

-- | Name of the data type. Valid value: @AWS:OpsItem@,
-- @AWS:EC2InstanceInformation@, @AWS:OpsItemTrendline@, or
-- @AWS:ComplianceSummary@.
opsResultAttribute_typeName :: Lens.Lens' OpsResultAttribute Prelude.Text
opsResultAttribute_typeName :: Lens' OpsResultAttribute Text
opsResultAttribute_typeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsResultAttribute' {Text
typeName :: Text
$sel:typeName:OpsResultAttribute' :: OpsResultAttribute -> Text
typeName} -> Text
typeName) (\s :: OpsResultAttribute
s@OpsResultAttribute' {} Text
a -> OpsResultAttribute
s {$sel:typeName:OpsResultAttribute' :: Text
typeName = Text
a} :: OpsResultAttribute)

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

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

instance Data.ToJSON OpsResultAttribute where
  toJSON :: OpsResultAttribute -> Value
toJSON OpsResultAttribute' {Text
typeName :: Text
$sel:typeName:OpsResultAttribute' :: OpsResultAttribute -> 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)]
      )