{-# 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.Discovery.Types.AgentConfigurationStatus
-- 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.Discovery.Types.AgentConfigurationStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about agents or connectors that were instructed to start
-- collecting data. Information includes the agent\/connector ID, a
-- description of the operation, and whether the agent\/connector
-- configuration was updated.
--
-- /See:/ 'newAgentConfigurationStatus' smart constructor.
data AgentConfigurationStatus = AgentConfigurationStatus'
  { -- | The agent\/connector ID.
    AgentConfigurationStatus -> Maybe Text
agentId :: Prelude.Maybe Prelude.Text,
    -- | Information about the status of the @StartDataCollection@ and
    -- @StopDataCollection@ operations. The system has recorded the data
    -- collection operation. The agent\/connector receives this command the
    -- next time it polls for a new command.
    AgentConfigurationStatus -> Maybe Bool
operationSucceeded :: Prelude.Maybe Prelude.Bool,
    -- | A description of the operation performed.
    AgentConfigurationStatus -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (AgentConfigurationStatus -> AgentConfigurationStatus -> Bool
(AgentConfigurationStatus -> AgentConfigurationStatus -> Bool)
-> (AgentConfigurationStatus -> AgentConfigurationStatus -> Bool)
-> Eq AgentConfigurationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AgentConfigurationStatus -> AgentConfigurationStatus -> Bool
$c/= :: AgentConfigurationStatus -> AgentConfigurationStatus -> Bool
== :: AgentConfigurationStatus -> AgentConfigurationStatus -> Bool
$c== :: AgentConfigurationStatus -> AgentConfigurationStatus -> Bool
Prelude.Eq, ReadPrec [AgentConfigurationStatus]
ReadPrec AgentConfigurationStatus
Int -> ReadS AgentConfigurationStatus
ReadS [AgentConfigurationStatus]
(Int -> ReadS AgentConfigurationStatus)
-> ReadS [AgentConfigurationStatus]
-> ReadPrec AgentConfigurationStatus
-> ReadPrec [AgentConfigurationStatus]
-> Read AgentConfigurationStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AgentConfigurationStatus]
$creadListPrec :: ReadPrec [AgentConfigurationStatus]
readPrec :: ReadPrec AgentConfigurationStatus
$creadPrec :: ReadPrec AgentConfigurationStatus
readList :: ReadS [AgentConfigurationStatus]
$creadList :: ReadS [AgentConfigurationStatus]
readsPrec :: Int -> ReadS AgentConfigurationStatus
$creadsPrec :: Int -> ReadS AgentConfigurationStatus
Prelude.Read, Int -> AgentConfigurationStatus -> ShowS
[AgentConfigurationStatus] -> ShowS
AgentConfigurationStatus -> String
(Int -> AgentConfigurationStatus -> ShowS)
-> (AgentConfigurationStatus -> String)
-> ([AgentConfigurationStatus] -> ShowS)
-> Show AgentConfigurationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AgentConfigurationStatus] -> ShowS
$cshowList :: [AgentConfigurationStatus] -> ShowS
show :: AgentConfigurationStatus -> String
$cshow :: AgentConfigurationStatus -> String
showsPrec :: Int -> AgentConfigurationStatus -> ShowS
$cshowsPrec :: Int -> AgentConfigurationStatus -> ShowS
Prelude.Show, (forall x.
 AgentConfigurationStatus -> Rep AgentConfigurationStatus x)
-> (forall x.
    Rep AgentConfigurationStatus x -> AgentConfigurationStatus)
-> Generic AgentConfigurationStatus
forall x.
Rep AgentConfigurationStatus x -> AgentConfigurationStatus
forall x.
AgentConfigurationStatus -> Rep AgentConfigurationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AgentConfigurationStatus x -> AgentConfigurationStatus
$cfrom :: forall x.
AgentConfigurationStatus -> Rep AgentConfigurationStatus x
Prelude.Generic)

-- |
-- Create a value of 'AgentConfigurationStatus' 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:
--
-- 'agentId', 'agentConfigurationStatus_agentId' - The agent\/connector ID.
--
-- 'operationSucceeded', 'agentConfigurationStatus_operationSucceeded' - Information about the status of the @StartDataCollection@ and
-- @StopDataCollection@ operations. The system has recorded the data
-- collection operation. The agent\/connector receives this command the
-- next time it polls for a new command.
--
-- 'description', 'agentConfigurationStatus_description' - A description of the operation performed.
newAgentConfigurationStatus ::
  AgentConfigurationStatus
newAgentConfigurationStatus :: AgentConfigurationStatus
newAgentConfigurationStatus =
  AgentConfigurationStatus' :: Maybe Text -> Maybe Bool -> Maybe Text -> AgentConfigurationStatus
AgentConfigurationStatus'
    { $sel:agentId:AgentConfigurationStatus' :: Maybe Text
agentId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operationSucceeded:AgentConfigurationStatus' :: Maybe Bool
operationSucceeded = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AgentConfigurationStatus' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The agent\/connector ID.
agentConfigurationStatus_agentId :: Lens.Lens' AgentConfigurationStatus (Prelude.Maybe Prelude.Text)
agentConfigurationStatus_agentId :: (Maybe Text -> f (Maybe Text))
-> AgentConfigurationStatus -> f AgentConfigurationStatus
agentConfigurationStatus_agentId = (AgentConfigurationStatus -> Maybe Text)
-> (AgentConfigurationStatus
    -> Maybe Text -> AgentConfigurationStatus)
-> Lens
     AgentConfigurationStatus
     AgentConfigurationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentConfigurationStatus' {Maybe Text
agentId :: Maybe Text
$sel:agentId:AgentConfigurationStatus' :: AgentConfigurationStatus -> Maybe Text
agentId} -> Maybe Text
agentId) (\s :: AgentConfigurationStatus
s@AgentConfigurationStatus' {} Maybe Text
a -> AgentConfigurationStatus
s {$sel:agentId:AgentConfigurationStatus' :: Maybe Text
agentId = Maybe Text
a} :: AgentConfigurationStatus)

-- | Information about the status of the @StartDataCollection@ and
-- @StopDataCollection@ operations. The system has recorded the data
-- collection operation. The agent\/connector receives this command the
-- next time it polls for a new command.
agentConfigurationStatus_operationSucceeded :: Lens.Lens' AgentConfigurationStatus (Prelude.Maybe Prelude.Bool)
agentConfigurationStatus_operationSucceeded :: (Maybe Bool -> f (Maybe Bool))
-> AgentConfigurationStatus -> f AgentConfigurationStatus
agentConfigurationStatus_operationSucceeded = (AgentConfigurationStatus -> Maybe Bool)
-> (AgentConfigurationStatus
    -> Maybe Bool -> AgentConfigurationStatus)
-> Lens
     AgentConfigurationStatus
     AgentConfigurationStatus
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentConfigurationStatus' {Maybe Bool
operationSucceeded :: Maybe Bool
$sel:operationSucceeded:AgentConfigurationStatus' :: AgentConfigurationStatus -> Maybe Bool
operationSucceeded} -> Maybe Bool
operationSucceeded) (\s :: AgentConfigurationStatus
s@AgentConfigurationStatus' {} Maybe Bool
a -> AgentConfigurationStatus
s {$sel:operationSucceeded:AgentConfigurationStatus' :: Maybe Bool
operationSucceeded = Maybe Bool
a} :: AgentConfigurationStatus)

-- | A description of the operation performed.
agentConfigurationStatus_description :: Lens.Lens' AgentConfigurationStatus (Prelude.Maybe Prelude.Text)
agentConfigurationStatus_description :: (Maybe Text -> f (Maybe Text))
-> AgentConfigurationStatus -> f AgentConfigurationStatus
agentConfigurationStatus_description = (AgentConfigurationStatus -> Maybe Text)
-> (AgentConfigurationStatus
    -> Maybe Text -> AgentConfigurationStatus)
-> Lens
     AgentConfigurationStatus
     AgentConfigurationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentConfigurationStatus' {Maybe Text
description :: Maybe Text
$sel:description:AgentConfigurationStatus' :: AgentConfigurationStatus -> Maybe Text
description} -> Maybe Text
description) (\s :: AgentConfigurationStatus
s@AgentConfigurationStatus' {} Maybe Text
a -> AgentConfigurationStatus
s {$sel:description:AgentConfigurationStatus' :: Maybe Text
description = Maybe Text
a} :: AgentConfigurationStatus)

instance Core.FromJSON AgentConfigurationStatus where
  parseJSON :: Value -> Parser AgentConfigurationStatus
parseJSON =
    String
-> (Object -> Parser AgentConfigurationStatus)
-> Value
-> Parser AgentConfigurationStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AgentConfigurationStatus"
      ( \Object
x ->
          Maybe Text -> Maybe Bool -> Maybe Text -> AgentConfigurationStatus
AgentConfigurationStatus'
            (Maybe Text
 -> Maybe Bool -> Maybe Text -> AgentConfigurationStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Text -> AgentConfigurationStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"agentId")
            Parser (Maybe Bool -> Maybe Text -> AgentConfigurationStatus)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> AgentConfigurationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"operationSucceeded")
            Parser (Maybe Text -> AgentConfigurationStatus)
-> Parser (Maybe Text) -> Parser AgentConfigurationStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
      )

instance Prelude.Hashable AgentConfigurationStatus

instance Prelude.NFData AgentConfigurationStatus