{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateGatewayCapabilityConfiguration
-- 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)
--
-- Updates a gateway capability configuration or defines a new capability
-- configuration. Each gateway capability defines data sources for a
-- gateway. A capability configuration can contain multiple data source
-- configurations. If you define OPC-UA sources for a gateway in the IoT
-- SiteWise console, all of your OPC-UA sources are stored in one
-- capability configuration. To list all capability configurations for a
-- gateway, use
-- <https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGateway.html DescribeGateway>.
module Amazonka.IoTSiteWise.UpdateGatewayCapabilityConfiguration
  ( -- * Creating a Request
    UpdateGatewayCapabilityConfiguration (..),
    newUpdateGatewayCapabilityConfiguration,

    -- * Request Lenses
    updateGatewayCapabilityConfiguration_gatewayId,
    updateGatewayCapabilityConfiguration_capabilityNamespace,
    updateGatewayCapabilityConfiguration_capabilityConfiguration,

    -- * Destructuring the Response
    UpdateGatewayCapabilityConfigurationResponse (..),
    newUpdateGatewayCapabilityConfigurationResponse,

    -- * Response Lenses
    updateGatewayCapabilityConfigurationResponse_httpStatus,
    updateGatewayCapabilityConfigurationResponse_capabilityNamespace,
    updateGatewayCapabilityConfigurationResponse_capabilitySyncStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateGatewayCapabilityConfiguration' smart constructor.
data UpdateGatewayCapabilityConfiguration = UpdateGatewayCapabilityConfiguration'
  { -- | The ID of the gateway to be updated.
    UpdateGatewayCapabilityConfiguration -> Text
gatewayId :: Prelude.Text,
    -- | The namespace of the gateway capability configuration to be updated. 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@.
    UpdateGatewayCapabilityConfiguration -> Text
capabilityNamespace :: Prelude.Text,
    -- | The JSON document that defines the configuration for the gateway
    -- capability. For more information, see
    -- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli Configuring data sources (CLI)>
    -- in the /IoT SiteWise User Guide/.
    UpdateGatewayCapabilityConfiguration -> Text
capabilityConfiguration :: Prelude.Text
  }
  deriving (UpdateGatewayCapabilityConfiguration
-> UpdateGatewayCapabilityConfiguration -> Bool
(UpdateGatewayCapabilityConfiguration
 -> UpdateGatewayCapabilityConfiguration -> Bool)
-> (UpdateGatewayCapabilityConfiguration
    -> UpdateGatewayCapabilityConfiguration -> Bool)
-> Eq UpdateGatewayCapabilityConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGatewayCapabilityConfiguration
-> UpdateGatewayCapabilityConfiguration -> Bool
$c/= :: UpdateGatewayCapabilityConfiguration
-> UpdateGatewayCapabilityConfiguration -> Bool
== :: UpdateGatewayCapabilityConfiguration
-> UpdateGatewayCapabilityConfiguration -> Bool
$c== :: UpdateGatewayCapabilityConfiguration
-> UpdateGatewayCapabilityConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateGatewayCapabilityConfiguration]
ReadPrec UpdateGatewayCapabilityConfiguration
Int -> ReadS UpdateGatewayCapabilityConfiguration
ReadS [UpdateGatewayCapabilityConfiguration]
(Int -> ReadS UpdateGatewayCapabilityConfiguration)
-> ReadS [UpdateGatewayCapabilityConfiguration]
-> ReadPrec UpdateGatewayCapabilityConfiguration
-> ReadPrec [UpdateGatewayCapabilityConfiguration]
-> Read UpdateGatewayCapabilityConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGatewayCapabilityConfiguration]
$creadListPrec :: ReadPrec [UpdateGatewayCapabilityConfiguration]
readPrec :: ReadPrec UpdateGatewayCapabilityConfiguration
$creadPrec :: ReadPrec UpdateGatewayCapabilityConfiguration
readList :: ReadS [UpdateGatewayCapabilityConfiguration]
$creadList :: ReadS [UpdateGatewayCapabilityConfiguration]
readsPrec :: Int -> ReadS UpdateGatewayCapabilityConfiguration
$creadsPrec :: Int -> ReadS UpdateGatewayCapabilityConfiguration
Prelude.Read, Int -> UpdateGatewayCapabilityConfiguration -> ShowS
[UpdateGatewayCapabilityConfiguration] -> ShowS
UpdateGatewayCapabilityConfiguration -> String
(Int -> UpdateGatewayCapabilityConfiguration -> ShowS)
-> (UpdateGatewayCapabilityConfiguration -> String)
-> ([UpdateGatewayCapabilityConfiguration] -> ShowS)
-> Show UpdateGatewayCapabilityConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGatewayCapabilityConfiguration] -> ShowS
$cshowList :: [UpdateGatewayCapabilityConfiguration] -> ShowS
show :: UpdateGatewayCapabilityConfiguration -> String
$cshow :: UpdateGatewayCapabilityConfiguration -> String
showsPrec :: Int -> UpdateGatewayCapabilityConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateGatewayCapabilityConfiguration -> ShowS
Prelude.Show, (forall x.
 UpdateGatewayCapabilityConfiguration
 -> Rep UpdateGatewayCapabilityConfiguration x)
-> (forall x.
    Rep UpdateGatewayCapabilityConfiguration x
    -> UpdateGatewayCapabilityConfiguration)
-> Generic UpdateGatewayCapabilityConfiguration
forall x.
Rep UpdateGatewayCapabilityConfiguration x
-> UpdateGatewayCapabilityConfiguration
forall x.
UpdateGatewayCapabilityConfiguration
-> Rep UpdateGatewayCapabilityConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGatewayCapabilityConfiguration x
-> UpdateGatewayCapabilityConfiguration
$cfrom :: forall x.
UpdateGatewayCapabilityConfiguration
-> Rep UpdateGatewayCapabilityConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGatewayCapabilityConfiguration' 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:
--
-- 'gatewayId', 'updateGatewayCapabilityConfiguration_gatewayId' - The ID of the gateway to be updated.
--
-- 'capabilityNamespace', 'updateGatewayCapabilityConfiguration_capabilityNamespace' - The namespace of the gateway capability configuration to be updated. 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@.
--
-- 'capabilityConfiguration', 'updateGatewayCapabilityConfiguration_capabilityConfiguration' - The JSON document that defines the configuration for the gateway
-- capability. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli Configuring data sources (CLI)>
-- in the /IoT SiteWise User Guide/.
newUpdateGatewayCapabilityConfiguration ::
  -- | 'gatewayId'
  Prelude.Text ->
  -- | 'capabilityNamespace'
  Prelude.Text ->
  -- | 'capabilityConfiguration'
  Prelude.Text ->
  UpdateGatewayCapabilityConfiguration
newUpdateGatewayCapabilityConfiguration :: Text -> Text -> Text -> UpdateGatewayCapabilityConfiguration
newUpdateGatewayCapabilityConfiguration
  Text
pGatewayId_
  Text
pCapabilityNamespace_
  Text
pCapabilityConfiguration_ =
    UpdateGatewayCapabilityConfiguration' :: Text -> Text -> Text -> UpdateGatewayCapabilityConfiguration
UpdateGatewayCapabilityConfiguration'
      { $sel:gatewayId:UpdateGatewayCapabilityConfiguration' :: Text
gatewayId =
          Text
pGatewayId_,
        $sel:capabilityNamespace:UpdateGatewayCapabilityConfiguration' :: Text
capabilityNamespace =
          Text
pCapabilityNamespace_,
        $sel:capabilityConfiguration:UpdateGatewayCapabilityConfiguration' :: Text
capabilityConfiguration =
          Text
pCapabilityConfiguration_
      }

-- | The ID of the gateway to be updated.
updateGatewayCapabilityConfiguration_gatewayId :: Lens.Lens' UpdateGatewayCapabilityConfiguration Prelude.Text
updateGatewayCapabilityConfiguration_gatewayId :: (Text -> f Text)
-> UpdateGatewayCapabilityConfiguration
-> f UpdateGatewayCapabilityConfiguration
updateGatewayCapabilityConfiguration_gatewayId = (UpdateGatewayCapabilityConfiguration -> Text)
-> (UpdateGatewayCapabilityConfiguration
    -> Text -> UpdateGatewayCapabilityConfiguration)
-> Lens
     UpdateGatewayCapabilityConfiguration
     UpdateGatewayCapabilityConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayCapabilityConfiguration' {Text
gatewayId :: Text
$sel:gatewayId:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
gatewayId} -> Text
gatewayId) (\s :: UpdateGatewayCapabilityConfiguration
s@UpdateGatewayCapabilityConfiguration' {} Text
a -> UpdateGatewayCapabilityConfiguration
s {$sel:gatewayId:UpdateGatewayCapabilityConfiguration' :: Text
gatewayId = Text
a} :: UpdateGatewayCapabilityConfiguration)

-- | The namespace of the gateway capability configuration to be updated. 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@.
updateGatewayCapabilityConfiguration_capabilityNamespace :: Lens.Lens' UpdateGatewayCapabilityConfiguration Prelude.Text
updateGatewayCapabilityConfiguration_capabilityNamespace :: (Text -> f Text)
-> UpdateGatewayCapabilityConfiguration
-> f UpdateGatewayCapabilityConfiguration
updateGatewayCapabilityConfiguration_capabilityNamespace = (UpdateGatewayCapabilityConfiguration -> Text)
-> (UpdateGatewayCapabilityConfiguration
    -> Text -> UpdateGatewayCapabilityConfiguration)
-> Lens
     UpdateGatewayCapabilityConfiguration
     UpdateGatewayCapabilityConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayCapabilityConfiguration' {Text
capabilityNamespace :: Text
$sel:capabilityNamespace:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
capabilityNamespace} -> Text
capabilityNamespace) (\s :: UpdateGatewayCapabilityConfiguration
s@UpdateGatewayCapabilityConfiguration' {} Text
a -> UpdateGatewayCapabilityConfiguration
s {$sel:capabilityNamespace:UpdateGatewayCapabilityConfiguration' :: Text
capabilityNamespace = Text
a} :: UpdateGatewayCapabilityConfiguration)

-- | The JSON document that defines the configuration for the gateway
-- capability. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli Configuring data sources (CLI)>
-- in the /IoT SiteWise User Guide/.
updateGatewayCapabilityConfiguration_capabilityConfiguration :: Lens.Lens' UpdateGatewayCapabilityConfiguration Prelude.Text
updateGatewayCapabilityConfiguration_capabilityConfiguration :: (Text -> f Text)
-> UpdateGatewayCapabilityConfiguration
-> f UpdateGatewayCapabilityConfiguration
updateGatewayCapabilityConfiguration_capabilityConfiguration = (UpdateGatewayCapabilityConfiguration -> Text)
-> (UpdateGatewayCapabilityConfiguration
    -> Text -> UpdateGatewayCapabilityConfiguration)
-> Lens
     UpdateGatewayCapabilityConfiguration
     UpdateGatewayCapabilityConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayCapabilityConfiguration' {Text
capabilityConfiguration :: Text
$sel:capabilityConfiguration:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
capabilityConfiguration} -> Text
capabilityConfiguration) (\s :: UpdateGatewayCapabilityConfiguration
s@UpdateGatewayCapabilityConfiguration' {} Text
a -> UpdateGatewayCapabilityConfiguration
s {$sel:capabilityConfiguration:UpdateGatewayCapabilityConfiguration' :: Text
capabilityConfiguration = Text
a} :: UpdateGatewayCapabilityConfiguration)

instance
  Core.AWSRequest
    UpdateGatewayCapabilityConfiguration
  where
  type
    AWSResponse UpdateGatewayCapabilityConfiguration =
      UpdateGatewayCapabilityConfigurationResponse
  request :: UpdateGatewayCapabilityConfiguration
-> Request UpdateGatewayCapabilityConfiguration
request = Service
-> UpdateGatewayCapabilityConfiguration
-> Request UpdateGatewayCapabilityConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateGatewayCapabilityConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateGatewayCapabilityConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse UpdateGatewayCapabilityConfiguration))
-> Logger
-> Service
-> Proxy UpdateGatewayCapabilityConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateGatewayCapabilityConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> Text
-> CapabilitySyncStatus
-> UpdateGatewayCapabilityConfigurationResponse
UpdateGatewayCapabilityConfigurationResponse'
            (Int
 -> Text
 -> CapabilitySyncStatus
 -> UpdateGatewayCapabilityConfigurationResponse)
-> Either String Int
-> Either
     String
     (Text
      -> CapabilitySyncStatus
      -> UpdateGatewayCapabilityConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
              Either
  String
  (Text
   -> CapabilitySyncStatus
   -> UpdateGatewayCapabilityConfigurationResponse)
-> Either String Text
-> Either
     String
     (CapabilitySyncStatus
      -> UpdateGatewayCapabilityConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"capabilityNamespace")
              Either
  String
  (CapabilitySyncStatus
   -> UpdateGatewayCapabilityConfigurationResponse)
-> Either String CapabilitySyncStatus
-> Either String UpdateGatewayCapabilityConfigurationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String CapabilitySyncStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"capabilitySyncStatus")
      )

instance
  Prelude.Hashable
    UpdateGatewayCapabilityConfiguration

instance
  Prelude.NFData
    UpdateGatewayCapabilityConfiguration

instance
  Core.ToHeaders
    UpdateGatewayCapabilityConfiguration
  where
  toHeaders :: UpdateGatewayCapabilityConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> UpdateGatewayCapabilityConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    UpdateGatewayCapabilityConfiguration
  where
  toJSON :: UpdateGatewayCapabilityConfiguration -> Value
toJSON UpdateGatewayCapabilityConfiguration' {Text
capabilityConfiguration :: Text
capabilityNamespace :: Text
gatewayId :: Text
$sel:capabilityConfiguration:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:capabilityNamespace:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:gatewayId:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> 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
"capabilityNamespace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
capabilityNamespace),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"capabilityConfiguration"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
capabilityConfiguration
              )
          ]
      )

instance
  Core.ToPath
    UpdateGatewayCapabilityConfiguration
  where
  toPath :: UpdateGatewayCapabilityConfiguration -> ByteString
toPath UpdateGatewayCapabilityConfiguration' {Text
capabilityConfiguration :: Text
capabilityNamespace :: Text
gatewayId :: Text
$sel:capabilityConfiguration:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:capabilityNamespace:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:gatewayId:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/20200301/gateways/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
gatewayId,
        ByteString
"/capability"
      ]

instance
  Core.ToQuery
    UpdateGatewayCapabilityConfiguration
  where
  toQuery :: UpdateGatewayCapabilityConfiguration -> QueryString
toQuery = QueryString -> UpdateGatewayCapabilityConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateGatewayCapabilityConfigurationResponse' smart constructor.
data UpdateGatewayCapabilityConfigurationResponse = UpdateGatewayCapabilityConfigurationResponse'
  { -- | The response's http status code.
    UpdateGatewayCapabilityConfigurationResponse -> Int
httpStatus :: Prelude.Int,
    -- | The namespace of the gateway capability.
    UpdateGatewayCapabilityConfigurationResponse -> 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.
    --
    -- After you update a capability configuration, its sync status is
    -- @OUT_OF_SYNC@ until the gateway receives and applies or rejects the
    -- updated configuration.
    UpdateGatewayCapabilityConfigurationResponse
-> CapabilitySyncStatus
capabilitySyncStatus :: CapabilitySyncStatus
  }
  deriving (UpdateGatewayCapabilityConfigurationResponse
-> UpdateGatewayCapabilityConfigurationResponse -> Bool
(UpdateGatewayCapabilityConfigurationResponse
 -> UpdateGatewayCapabilityConfigurationResponse -> Bool)
-> (UpdateGatewayCapabilityConfigurationResponse
    -> UpdateGatewayCapabilityConfigurationResponse -> Bool)
-> Eq UpdateGatewayCapabilityConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGatewayCapabilityConfigurationResponse
-> UpdateGatewayCapabilityConfigurationResponse -> Bool
$c/= :: UpdateGatewayCapabilityConfigurationResponse
-> UpdateGatewayCapabilityConfigurationResponse -> Bool
== :: UpdateGatewayCapabilityConfigurationResponse
-> UpdateGatewayCapabilityConfigurationResponse -> Bool
$c== :: UpdateGatewayCapabilityConfigurationResponse
-> UpdateGatewayCapabilityConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateGatewayCapabilityConfigurationResponse]
ReadPrec UpdateGatewayCapabilityConfigurationResponse
Int -> ReadS UpdateGatewayCapabilityConfigurationResponse
ReadS [UpdateGatewayCapabilityConfigurationResponse]
(Int -> ReadS UpdateGatewayCapabilityConfigurationResponse)
-> ReadS [UpdateGatewayCapabilityConfigurationResponse]
-> ReadPrec UpdateGatewayCapabilityConfigurationResponse
-> ReadPrec [UpdateGatewayCapabilityConfigurationResponse]
-> Read UpdateGatewayCapabilityConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGatewayCapabilityConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateGatewayCapabilityConfigurationResponse]
readPrec :: ReadPrec UpdateGatewayCapabilityConfigurationResponse
$creadPrec :: ReadPrec UpdateGatewayCapabilityConfigurationResponse
readList :: ReadS [UpdateGatewayCapabilityConfigurationResponse]
$creadList :: ReadS [UpdateGatewayCapabilityConfigurationResponse]
readsPrec :: Int -> ReadS UpdateGatewayCapabilityConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateGatewayCapabilityConfigurationResponse
Prelude.Read, Int -> UpdateGatewayCapabilityConfigurationResponse -> ShowS
[UpdateGatewayCapabilityConfigurationResponse] -> ShowS
UpdateGatewayCapabilityConfigurationResponse -> String
(Int -> UpdateGatewayCapabilityConfigurationResponse -> ShowS)
-> (UpdateGatewayCapabilityConfigurationResponse -> String)
-> ([UpdateGatewayCapabilityConfigurationResponse] -> ShowS)
-> Show UpdateGatewayCapabilityConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGatewayCapabilityConfigurationResponse] -> ShowS
$cshowList :: [UpdateGatewayCapabilityConfigurationResponse] -> ShowS
show :: UpdateGatewayCapabilityConfigurationResponse -> String
$cshow :: UpdateGatewayCapabilityConfigurationResponse -> String
showsPrec :: Int -> UpdateGatewayCapabilityConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateGatewayCapabilityConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 UpdateGatewayCapabilityConfigurationResponse
 -> Rep UpdateGatewayCapabilityConfigurationResponse x)
-> (forall x.
    Rep UpdateGatewayCapabilityConfigurationResponse x
    -> UpdateGatewayCapabilityConfigurationResponse)
-> Generic UpdateGatewayCapabilityConfigurationResponse
forall x.
Rep UpdateGatewayCapabilityConfigurationResponse x
-> UpdateGatewayCapabilityConfigurationResponse
forall x.
UpdateGatewayCapabilityConfigurationResponse
-> Rep UpdateGatewayCapabilityConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGatewayCapabilityConfigurationResponse x
-> UpdateGatewayCapabilityConfigurationResponse
$cfrom :: forall x.
UpdateGatewayCapabilityConfigurationResponse
-> Rep UpdateGatewayCapabilityConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGatewayCapabilityConfigurationResponse' 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:
--
-- 'httpStatus', 'updateGatewayCapabilityConfigurationResponse_httpStatus' - The response's http status code.
--
-- 'capabilityNamespace', 'updateGatewayCapabilityConfigurationResponse_capabilityNamespace' - The namespace of the gateway capability.
--
-- 'capabilitySyncStatus', 'updateGatewayCapabilityConfigurationResponse_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.
--
-- After you update a capability configuration, its sync status is
-- @OUT_OF_SYNC@ until the gateway receives and applies or rejects the
-- updated configuration.
newUpdateGatewayCapabilityConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'capabilityNamespace'
  Prelude.Text ->
  -- | 'capabilitySyncStatus'
  CapabilitySyncStatus ->
  UpdateGatewayCapabilityConfigurationResponse
newUpdateGatewayCapabilityConfigurationResponse :: Int
-> Text
-> CapabilitySyncStatus
-> UpdateGatewayCapabilityConfigurationResponse
newUpdateGatewayCapabilityConfigurationResponse
  Int
pHttpStatus_
  Text
pCapabilityNamespace_
  CapabilitySyncStatus
pCapabilitySyncStatus_ =
    UpdateGatewayCapabilityConfigurationResponse' :: Int
-> Text
-> CapabilitySyncStatus
-> UpdateGatewayCapabilityConfigurationResponse
UpdateGatewayCapabilityConfigurationResponse'
      { $sel:httpStatus:UpdateGatewayCapabilityConfigurationResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:capabilityNamespace:UpdateGatewayCapabilityConfigurationResponse' :: Text
capabilityNamespace =
          Text
pCapabilityNamespace_,
        $sel:capabilitySyncStatus:UpdateGatewayCapabilityConfigurationResponse' :: CapabilitySyncStatus
capabilitySyncStatus =
          CapabilitySyncStatus
pCapabilitySyncStatus_
      }

-- | The response's http status code.
updateGatewayCapabilityConfigurationResponse_httpStatus :: Lens.Lens' UpdateGatewayCapabilityConfigurationResponse Prelude.Int
updateGatewayCapabilityConfigurationResponse_httpStatus :: (Int -> f Int)
-> UpdateGatewayCapabilityConfigurationResponse
-> f UpdateGatewayCapabilityConfigurationResponse
updateGatewayCapabilityConfigurationResponse_httpStatus = (UpdateGatewayCapabilityConfigurationResponse -> Int)
-> (UpdateGatewayCapabilityConfigurationResponse
    -> Int -> UpdateGatewayCapabilityConfigurationResponse)
-> Lens
     UpdateGatewayCapabilityConfigurationResponse
     UpdateGatewayCapabilityConfigurationResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayCapabilityConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateGatewayCapabilityConfigurationResponse' :: UpdateGatewayCapabilityConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateGatewayCapabilityConfigurationResponse
s@UpdateGatewayCapabilityConfigurationResponse' {} Int
a -> UpdateGatewayCapabilityConfigurationResponse
s {$sel:httpStatus:UpdateGatewayCapabilityConfigurationResponse' :: Int
httpStatus = Int
a} :: UpdateGatewayCapabilityConfigurationResponse)

-- | The namespace of the gateway capability.
updateGatewayCapabilityConfigurationResponse_capabilityNamespace :: Lens.Lens' UpdateGatewayCapabilityConfigurationResponse Prelude.Text
updateGatewayCapabilityConfigurationResponse_capabilityNamespace :: (Text -> f Text)
-> UpdateGatewayCapabilityConfigurationResponse
-> f UpdateGatewayCapabilityConfigurationResponse
updateGatewayCapabilityConfigurationResponse_capabilityNamespace = (UpdateGatewayCapabilityConfigurationResponse -> Text)
-> (UpdateGatewayCapabilityConfigurationResponse
    -> Text -> UpdateGatewayCapabilityConfigurationResponse)
-> Lens
     UpdateGatewayCapabilityConfigurationResponse
     UpdateGatewayCapabilityConfigurationResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayCapabilityConfigurationResponse' {Text
capabilityNamespace :: Text
$sel:capabilityNamespace:UpdateGatewayCapabilityConfigurationResponse' :: UpdateGatewayCapabilityConfigurationResponse -> Text
capabilityNamespace} -> Text
capabilityNamespace) (\s :: UpdateGatewayCapabilityConfigurationResponse
s@UpdateGatewayCapabilityConfigurationResponse' {} Text
a -> UpdateGatewayCapabilityConfigurationResponse
s {$sel:capabilityNamespace:UpdateGatewayCapabilityConfigurationResponse' :: Text
capabilityNamespace = Text
a} :: UpdateGatewayCapabilityConfigurationResponse)

-- | 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.
--
-- After you update a capability configuration, its sync status is
-- @OUT_OF_SYNC@ until the gateway receives and applies or rejects the
-- updated configuration.
updateGatewayCapabilityConfigurationResponse_capabilitySyncStatus :: Lens.Lens' UpdateGatewayCapabilityConfigurationResponse CapabilitySyncStatus
updateGatewayCapabilityConfigurationResponse_capabilitySyncStatus :: (CapabilitySyncStatus -> f CapabilitySyncStatus)
-> UpdateGatewayCapabilityConfigurationResponse
-> f UpdateGatewayCapabilityConfigurationResponse
updateGatewayCapabilityConfigurationResponse_capabilitySyncStatus = (UpdateGatewayCapabilityConfigurationResponse
 -> CapabilitySyncStatus)
-> (UpdateGatewayCapabilityConfigurationResponse
    -> CapabilitySyncStatus
    -> UpdateGatewayCapabilityConfigurationResponse)
-> Lens
     UpdateGatewayCapabilityConfigurationResponse
     UpdateGatewayCapabilityConfigurationResponse
     CapabilitySyncStatus
     CapabilitySyncStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayCapabilityConfigurationResponse' {CapabilitySyncStatus
capabilitySyncStatus :: CapabilitySyncStatus
$sel:capabilitySyncStatus:UpdateGatewayCapabilityConfigurationResponse' :: UpdateGatewayCapabilityConfigurationResponse
-> CapabilitySyncStatus
capabilitySyncStatus} -> CapabilitySyncStatus
capabilitySyncStatus) (\s :: UpdateGatewayCapabilityConfigurationResponse
s@UpdateGatewayCapabilityConfigurationResponse' {} CapabilitySyncStatus
a -> UpdateGatewayCapabilityConfigurationResponse
s {$sel:capabilitySyncStatus:UpdateGatewayCapabilityConfigurationResponse' :: CapabilitySyncStatus
capabilitySyncStatus = CapabilitySyncStatus
a} :: UpdateGatewayCapabilityConfigurationResponse)

instance
  Prelude.NFData
    UpdateGatewayCapabilityConfigurationResponse