{-# 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-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.OpsResultAttribute where

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

instance Prelude.NFData OpsResultAttribute

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