{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types
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
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]
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
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.
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'
      { $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 :: Lens' UpdateGatewayCapabilityConfiguration Text
updateGatewayCapabilityConfiguration_gatewayId = 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 :: Lens' UpdateGatewayCapabilityConfiguration Text
updateGatewayCapabilityConfiguration_capabilityNamespace = 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 :: Lens' UpdateGatewayCapabilityConfiguration Text
updateGatewayCapabilityConfiguration_capabilityConfiguration = 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 :: (Service -> Service)
-> UpdateGatewayCapabilityConfiguration
-> Request UpdateGatewayCapabilityConfiguration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateGatewayCapabilityConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateGatewayCapabilityConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> Text
-> CapabilitySyncStatus
-> UpdateGatewayCapabilityConfigurationResponse
UpdateGatewayCapabilityConfigurationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String 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 -> Either String a
Data..:> Key
"capabilitySyncStatus")
      )

instance
  Prelude.Hashable
    UpdateGatewayCapabilityConfiguration
  where
  hashWithSalt :: Int -> UpdateGatewayCapabilityConfiguration -> Int
hashWithSalt
    Int
_salt
    UpdateGatewayCapabilityConfiguration' {Text
capabilityConfiguration :: Text
capabilityNamespace :: Text
gatewayId :: Text
$sel:capabilityConfiguration:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:capabilityNamespace:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:gatewayId:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
capabilityNamespace
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
capabilityConfiguration

instance
  Prelude.NFData
    UpdateGatewayCapabilityConfiguration
  where
  rnf :: UpdateGatewayCapabilityConfiguration -> ()
rnf UpdateGatewayCapabilityConfiguration' {Text
capabilityConfiguration :: Text
capabilityNamespace :: Text
gatewayId :: Text
$sel:capabilityConfiguration:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:capabilityNamespace:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
$sel:gatewayId:UpdateGatewayCapabilityConfiguration' :: UpdateGatewayCapabilityConfiguration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
capabilityConfiguration

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

instance
  Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"capabilityNamespace" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
capabilityNamespace),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"capabilityConfiguration"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
capabilityConfiguration
              )
          ]
      )

instance
  Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/20200301/gateways/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
gatewayId,
        ByteString
"/capability"
      ]

instance
  Data.ToQuery
    UpdateGatewayCapabilityConfiguration
  where
  toQuery :: UpdateGatewayCapabilityConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
      { $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 :: Lens' UpdateGatewayCapabilityConfigurationResponse Int
updateGatewayCapabilityConfigurationResponse_httpStatus = 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 :: Lens' UpdateGatewayCapabilityConfigurationResponse Text
updateGatewayCapabilityConfigurationResponse_capabilityNamespace = 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 :: Lens'
  UpdateGatewayCapabilityConfigurationResponse CapabilitySyncStatus
updateGatewayCapabilityConfigurationResponse_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
  where
  rnf :: UpdateGatewayCapabilityConfigurationResponse -> ()
rnf UpdateGatewayCapabilityConfigurationResponse' {Int
Text
CapabilitySyncStatus
capabilitySyncStatus :: CapabilitySyncStatus
capabilityNamespace :: Text
httpStatus :: Int
$sel:capabilitySyncStatus:UpdateGatewayCapabilityConfigurationResponse' :: UpdateGatewayCapabilityConfigurationResponse
-> CapabilitySyncStatus
$sel:capabilityNamespace:UpdateGatewayCapabilityConfigurationResponse' :: UpdateGatewayCapabilityConfigurationResponse -> Text
$sel:httpStatus:UpdateGatewayCapabilityConfigurationResponse' :: UpdateGatewayCapabilityConfigurationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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