{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTSiteWise.Types.GatewayCapabilitySummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types.CapabilitySyncStatus
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
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]
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
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.
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'
      { $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 :: Lens' GatewayCapabilitySummary Text
gatewayCapabilitySummary_capabilityNamespace = 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 :: Lens' GatewayCapabilitySummary CapabilitySyncStatus
gatewayCapabilitySummary_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 Data.FromJSON GatewayCapabilitySummary where
  parseJSON :: Value -> Parser GatewayCapabilitySummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GatewayCapabilitySummary"
      ( \Object
x ->
          Text -> CapabilitySyncStatus -> GatewayCapabilitySummary
GatewayCapabilitySummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"capabilityNamespace")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"capabilitySyncStatus")
      )

instance Prelude.Hashable GatewayCapabilitySummary where
  hashWithSalt :: Int -> GatewayCapabilitySummary -> Int
hashWithSalt Int
_salt GatewayCapabilitySummary' {Text
CapabilitySyncStatus
capabilitySyncStatus :: CapabilitySyncStatus
capabilityNamespace :: Text
$sel:capabilitySyncStatus:GatewayCapabilitySummary' :: GatewayCapabilitySummary -> CapabilitySyncStatus
$sel:capabilityNamespace:GatewayCapabilitySummary' :: GatewayCapabilitySummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
capabilityNamespace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CapabilitySyncStatus
capabilitySyncStatus

instance Prelude.NFData GatewayCapabilitySummary where
  rnf :: GatewayCapabilitySummary -> ()
rnf GatewayCapabilitySummary' {Text
CapabilitySyncStatus
capabilitySyncStatus :: CapabilitySyncStatus
capabilityNamespace :: Text
$sel:capabilitySyncStatus:GatewayCapabilitySummary' :: GatewayCapabilitySummary -> CapabilitySyncStatus
$sel:capabilityNamespace:GatewayCapabilitySummary' :: GatewayCapabilitySummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
capabilityNamespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CapabilitySyncStatus
capabilitySyncStatus