{-# 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.IoTSiteWise.Types.GatewayCapabilitySummary
-- 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.IoTSiteWise.Types.GatewayCapabilitySummary where

import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.CapabilitySyncStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains a summary of a gateway capability configuration.
--
-- /See:/ 'newGatewayCapabilitySummary' smart constructor.
data GatewayCapabilitySummary = GatewayCapabilitySummary'
  { -- | The namespace of the capability configuration. For example, if you
    -- configure OPC-UA sources from the IoT SiteWise console, your OPC-UA
    -- capability configuration has the namespace
    -- @iotsitewise:opcuacollector:version@, where @version@ is a number such
    -- as @1@.
    GatewayCapabilitySummary -> Text
capabilityNamespace :: Prelude.Text,
    -- | The synchronization status of the capability configuration. The sync
    -- status can be one of the following:
    --
    -- -   @IN_SYNC@ – The gateway is running the capability configuration.
    --
    -- -   @OUT_OF_SYNC@ – The gateway hasn\'t received the capability
    --     configuration.
    --
    -- -   @SYNC_FAILED@ – The gateway rejected the capability configuration.
    GatewayCapabilitySummary -> CapabilitySyncStatus
capabilitySyncStatus :: CapabilitySyncStatus
  }
  deriving (GatewayCapabilitySummary -> GatewayCapabilitySummary -> Bool
(GatewayCapabilitySummary -> GatewayCapabilitySummary -> Bool)
-> (GatewayCapabilitySummary -> GatewayCapabilitySummary -> Bool)
-> Eq GatewayCapabilitySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewayCapabilitySummary -> GatewayCapabilitySummary -> Bool
$c/= :: GatewayCapabilitySummary -> GatewayCapabilitySummary -> Bool
== :: GatewayCapabilitySummary -> GatewayCapabilitySummary -> Bool
$c== :: GatewayCapabilitySummary -> GatewayCapabilitySummary -> Bool
Prelude.Eq, ReadPrec [GatewayCapabilitySummary]
ReadPrec GatewayCapabilitySummary
Int -> ReadS GatewayCapabilitySummary
ReadS [GatewayCapabilitySummary]
(Int -> ReadS GatewayCapabilitySummary)
-> ReadS [GatewayCapabilitySummary]
-> ReadPrec GatewayCapabilitySummary
-> ReadPrec [GatewayCapabilitySummary]
-> Read GatewayCapabilitySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewayCapabilitySummary]
$creadListPrec :: ReadPrec [GatewayCapabilitySummary]
readPrec :: ReadPrec GatewayCapabilitySummary
$creadPrec :: ReadPrec GatewayCapabilitySummary
readList :: ReadS [GatewayCapabilitySummary]
$creadList :: ReadS [GatewayCapabilitySummary]
readsPrec :: Int -> ReadS GatewayCapabilitySummary
$creadsPrec :: Int -> ReadS GatewayCapabilitySummary
Prelude.Read, Int -> GatewayCapabilitySummary -> ShowS
[GatewayCapabilitySummary] -> ShowS
GatewayCapabilitySummary -> String
(Int -> GatewayCapabilitySummary -> ShowS)
-> (GatewayCapabilitySummary -> String)
-> ([GatewayCapabilitySummary] -> ShowS)
-> Show GatewayCapabilitySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewayCapabilitySummary] -> ShowS
$cshowList :: [GatewayCapabilitySummary] -> ShowS
show :: GatewayCapabilitySummary -> String
$cshow :: GatewayCapabilitySummary -> String
showsPrec :: Int -> GatewayCapabilitySummary -> ShowS
$cshowsPrec :: Int -> GatewayCapabilitySummary -> ShowS
Prelude.Show, (forall x.
 GatewayCapabilitySummary -> Rep GatewayCapabilitySummary x)
-> (forall x.
    Rep GatewayCapabilitySummary x -> GatewayCapabilitySummary)
-> Generic GatewayCapabilitySummary
forall x.
Rep GatewayCapabilitySummary x -> GatewayCapabilitySummary
forall x.
GatewayCapabilitySummary -> Rep GatewayCapabilitySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GatewayCapabilitySummary x -> GatewayCapabilitySummary
$cfrom :: forall x.
GatewayCapabilitySummary -> Rep GatewayCapabilitySummary x
Prelude.Generic)

-- |
-- Create a value of 'GatewayCapabilitySummary' 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:
--
-- 'capabilityNamespace', 'gatewayCapabilitySummary_capabilityNamespace' - The namespace of the capability configuration. For example, if you
-- configure OPC-UA sources from the IoT SiteWise console, your OPC-UA
-- capability configuration has the namespace
-- @iotsitewise:opcuacollector:version@, where @version@ is a number such
-- as @1@.
--
-- 'capabilitySyncStatus', 'gatewayCapabilitySummary_capabilitySyncStatus' - The synchronization status of the capability configuration. The sync
-- status can be one of the following:
--
-- -   @IN_SYNC@ – The gateway is running the capability configuration.
--
-- -   @OUT_OF_SYNC@ – The gateway hasn\'t received the capability
--     configuration.
--
-- -   @SYNC_FAILED@ – The gateway rejected the capability configuration.
newGatewayCapabilitySummary ::
  -- | 'capabilityNamespace'
  Prelude.Text ->
  -- | 'capabilitySyncStatus'
  CapabilitySyncStatus ->
  GatewayCapabilitySummary
newGatewayCapabilitySummary :: Text -> CapabilitySyncStatus -> GatewayCapabilitySummary
newGatewayCapabilitySummary
  Text
pCapabilityNamespace_
  CapabilitySyncStatus
pCapabilitySyncStatus_ =
    GatewayCapabilitySummary' :: Text -> CapabilitySyncStatus -> GatewayCapabilitySummary
GatewayCapabilitySummary'
      { $sel:capabilityNamespace:GatewayCapabilitySummary' :: Text
capabilityNamespace =
          Text
pCapabilityNamespace_,
        $sel:capabilitySyncStatus:GatewayCapabilitySummary' :: CapabilitySyncStatus
capabilitySyncStatus = CapabilitySyncStatus
pCapabilitySyncStatus_
      }

-- | The namespace of the capability configuration. For example, if you
-- configure OPC-UA sources from the IoT SiteWise console, your OPC-UA
-- capability configuration has the namespace
-- @iotsitewise:opcuacollector:version@, where @version@ is a number such
-- as @1@.
gatewayCapabilitySummary_capabilityNamespace :: Lens.Lens' GatewayCapabilitySummary Prelude.Text
gatewayCapabilitySummary_capabilityNamespace :: (Text -> f Text)
-> GatewayCapabilitySummary -> f GatewayCapabilitySummary
gatewayCapabilitySummary_capabilityNamespace = (GatewayCapabilitySummary -> Text)
-> (GatewayCapabilitySummary -> Text -> GatewayCapabilitySummary)
-> Lens GatewayCapabilitySummary GatewayCapabilitySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayCapabilitySummary' {Text
capabilityNamespace :: Text
$sel:capabilityNamespace:GatewayCapabilitySummary' :: GatewayCapabilitySummary -> Text
capabilityNamespace} -> Text
capabilityNamespace) (\s :: GatewayCapabilitySummary
s@GatewayCapabilitySummary' {} Text
a -> GatewayCapabilitySummary
s {$sel:capabilityNamespace:GatewayCapabilitySummary' :: Text
capabilityNamespace = Text
a} :: GatewayCapabilitySummary)

-- | The synchronization status of the capability configuration. The sync
-- status can be one of the following:
--
-- -   @IN_SYNC@ – The gateway is running the capability configuration.
--
-- -   @OUT_OF_SYNC@ – The gateway hasn\'t received the capability
--     configuration.
--
-- -   @SYNC_FAILED@ – The gateway rejected the capability configuration.
gatewayCapabilitySummary_capabilitySyncStatus :: Lens.Lens' GatewayCapabilitySummary CapabilitySyncStatus
gatewayCapabilitySummary_capabilitySyncStatus :: (CapabilitySyncStatus -> f CapabilitySyncStatus)
-> GatewayCapabilitySummary -> f GatewayCapabilitySummary
gatewayCapabilitySummary_capabilitySyncStatus = (GatewayCapabilitySummary -> CapabilitySyncStatus)
-> (GatewayCapabilitySummary
    -> CapabilitySyncStatus -> GatewayCapabilitySummary)
-> Lens
     GatewayCapabilitySummary
     GatewayCapabilitySummary
     CapabilitySyncStatus
     CapabilitySyncStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayCapabilitySummary' {CapabilitySyncStatus
capabilitySyncStatus :: CapabilitySyncStatus
$sel:capabilitySyncStatus:GatewayCapabilitySummary' :: GatewayCapabilitySummary -> CapabilitySyncStatus
capabilitySyncStatus} -> CapabilitySyncStatus
capabilitySyncStatus) (\s :: GatewayCapabilitySummary
s@GatewayCapabilitySummary' {} CapabilitySyncStatus
a -> GatewayCapabilitySummary
s {$sel:capabilitySyncStatus:GatewayCapabilitySummary' :: CapabilitySyncStatus
capabilitySyncStatus = CapabilitySyncStatus
a} :: GatewayCapabilitySummary)

instance Core.FromJSON GatewayCapabilitySummary where
  parseJSON :: Value -> Parser GatewayCapabilitySummary
parseJSON =
    String
-> (Object -> Parser GatewayCapabilitySummary)
-> Value
-> Parser GatewayCapabilitySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GatewayCapabilitySummary"
      ( \Object
x ->
          Text -> CapabilitySyncStatus -> GatewayCapabilitySummary
GatewayCapabilitySummary'
            (Text -> CapabilitySyncStatus -> GatewayCapabilitySummary)
-> Parser Text
-> Parser (CapabilitySyncStatus -> GatewayCapabilitySummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"capabilityNamespace")
            Parser (CapabilitySyncStatus -> GatewayCapabilitySummary)
-> Parser CapabilitySyncStatus -> Parser GatewayCapabilitySummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser CapabilitySyncStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"capabilitySyncStatus")
      )

instance Prelude.Hashable GatewayCapabilitySummary

instance Prelude.NFData GatewayCapabilitySummary