{-# 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.KinesisVideo.StartEdgeConfigurationUpdate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- An asynchronous API that updates a stream’s existing edge configuration.
-- The Kinesis Video Stream will sync the stream’s edge configuration with
-- the Edge Agent IoT Greengrass component that runs on an IoT Hub Device,
-- setup at your premise. The time to sync can vary and depends on the
-- connectivity of the Hub Device. The @SyncStatus@ will be updated as the
-- edge configuration is acknowledged, and synced with the Edge Agent.
--
-- If this API is invoked for the first time, a new edge configuration will
-- be created for the stream, and the sync status will be set to @SYNCING@.
-- You will have to wait for the sync status to reach a terminal state such
-- as: @IN_SYNC@, or @SYNC_FAILED@, before using this API again. If you
-- invoke this API during the syncing process, a @ResourceInUseException@
-- will be thrown. The connectivity of the stream’s edge configuration and
-- the Edge Agent will be retried for 15 minutes. After 15 minutes, the
-- status will transition into the @SYNC_FAILED@ state.
module Amazonka.KinesisVideo.StartEdgeConfigurationUpdate
  ( -- * Creating a Request
    StartEdgeConfigurationUpdate (..),
    newStartEdgeConfigurationUpdate,

    -- * Request Lenses
    startEdgeConfigurationUpdate_streamARN,
    startEdgeConfigurationUpdate_streamName,
    startEdgeConfigurationUpdate_edgeConfig,

    -- * Destructuring the Response
    StartEdgeConfigurationUpdateResponse (..),
    newStartEdgeConfigurationUpdateResponse,

    -- * Response Lenses
    startEdgeConfigurationUpdateResponse_creationTime,
    startEdgeConfigurationUpdateResponse_edgeConfig,
    startEdgeConfigurationUpdateResponse_failedStatusDetails,
    startEdgeConfigurationUpdateResponse_lastUpdatedTime,
    startEdgeConfigurationUpdateResponse_streamARN,
    startEdgeConfigurationUpdateResponse_streamName,
    startEdgeConfigurationUpdateResponse_syncStatus,
    startEdgeConfigurationUpdateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisVideo.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newStartEdgeConfigurationUpdate' smart constructor.
data StartEdgeConfigurationUpdate = StartEdgeConfigurationUpdate'
  { -- | The Amazon Resource Name (ARN) of the stream. Specify either the
    -- @StreamName@ or the @StreamARN@.
    StartEdgeConfigurationUpdate -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
    -- | The name of the stream whose edge configuration you want to update.
    -- Specify either the @StreamName@ or the @StreamARN@.
    StartEdgeConfigurationUpdate -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
    -- | The edge configuration details required to invoke the update process.
    StartEdgeConfigurationUpdate -> EdgeConfig
edgeConfig :: EdgeConfig
  }
  deriving (StartEdgeConfigurationUpdate
-> StartEdgeConfigurationUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartEdgeConfigurationUpdate
-> StartEdgeConfigurationUpdate -> Bool
$c/= :: StartEdgeConfigurationUpdate
-> StartEdgeConfigurationUpdate -> Bool
== :: StartEdgeConfigurationUpdate
-> StartEdgeConfigurationUpdate -> Bool
$c== :: StartEdgeConfigurationUpdate
-> StartEdgeConfigurationUpdate -> Bool
Prelude.Eq, Int -> StartEdgeConfigurationUpdate -> ShowS
[StartEdgeConfigurationUpdate] -> ShowS
StartEdgeConfigurationUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartEdgeConfigurationUpdate] -> ShowS
$cshowList :: [StartEdgeConfigurationUpdate] -> ShowS
show :: StartEdgeConfigurationUpdate -> String
$cshow :: StartEdgeConfigurationUpdate -> String
showsPrec :: Int -> StartEdgeConfigurationUpdate -> ShowS
$cshowsPrec :: Int -> StartEdgeConfigurationUpdate -> ShowS
Prelude.Show, forall x.
Rep StartEdgeConfigurationUpdate x -> StartEdgeConfigurationUpdate
forall x.
StartEdgeConfigurationUpdate -> Rep StartEdgeConfigurationUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartEdgeConfigurationUpdate x -> StartEdgeConfigurationUpdate
$cfrom :: forall x.
StartEdgeConfigurationUpdate -> Rep StartEdgeConfigurationUpdate x
Prelude.Generic)

-- |
-- Create a value of 'StartEdgeConfigurationUpdate' 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:
--
-- 'streamARN', 'startEdgeConfigurationUpdate_streamARN' - The Amazon Resource Name (ARN) of the stream. Specify either the
-- @StreamName@ or the @StreamARN@.
--
-- 'streamName', 'startEdgeConfigurationUpdate_streamName' - The name of the stream whose edge configuration you want to update.
-- Specify either the @StreamName@ or the @StreamARN@.
--
-- 'edgeConfig', 'startEdgeConfigurationUpdate_edgeConfig' - The edge configuration details required to invoke the update process.
newStartEdgeConfigurationUpdate ::
  -- | 'edgeConfig'
  EdgeConfig ->
  StartEdgeConfigurationUpdate
newStartEdgeConfigurationUpdate :: EdgeConfig -> StartEdgeConfigurationUpdate
newStartEdgeConfigurationUpdate EdgeConfig
pEdgeConfig_ =
  StartEdgeConfigurationUpdate'
    { $sel:streamARN:StartEdgeConfigurationUpdate' :: Maybe Text
streamARN =
        forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:StartEdgeConfigurationUpdate' :: Maybe Text
streamName = forall a. Maybe a
Prelude.Nothing,
      $sel:edgeConfig:StartEdgeConfigurationUpdate' :: EdgeConfig
edgeConfig = EdgeConfig
pEdgeConfig_
    }

-- | The Amazon Resource Name (ARN) of the stream. Specify either the
-- @StreamName@ or the @StreamARN@.
startEdgeConfigurationUpdate_streamARN :: Lens.Lens' StartEdgeConfigurationUpdate (Prelude.Maybe Prelude.Text)
startEdgeConfigurationUpdate_streamARN :: Lens' StartEdgeConfigurationUpdate (Maybe Text)
startEdgeConfigurationUpdate_streamARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdate' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: StartEdgeConfigurationUpdate
s@StartEdgeConfigurationUpdate' {} Maybe Text
a -> StartEdgeConfigurationUpdate
s {$sel:streamARN:StartEdgeConfigurationUpdate' :: Maybe Text
streamARN = Maybe Text
a} :: StartEdgeConfigurationUpdate)

-- | The name of the stream whose edge configuration you want to update.
-- Specify either the @StreamName@ or the @StreamARN@.
startEdgeConfigurationUpdate_streamName :: Lens.Lens' StartEdgeConfigurationUpdate (Prelude.Maybe Prelude.Text)
startEdgeConfigurationUpdate_streamName :: Lens' StartEdgeConfigurationUpdate (Maybe Text)
startEdgeConfigurationUpdate_streamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdate' {Maybe Text
streamName :: Maybe Text
$sel:streamName:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: StartEdgeConfigurationUpdate
s@StartEdgeConfigurationUpdate' {} Maybe Text
a -> StartEdgeConfigurationUpdate
s {$sel:streamName:StartEdgeConfigurationUpdate' :: Maybe Text
streamName = Maybe Text
a} :: StartEdgeConfigurationUpdate)

-- | The edge configuration details required to invoke the update process.
startEdgeConfigurationUpdate_edgeConfig :: Lens.Lens' StartEdgeConfigurationUpdate EdgeConfig
startEdgeConfigurationUpdate_edgeConfig :: Lens' StartEdgeConfigurationUpdate EdgeConfig
startEdgeConfigurationUpdate_edgeConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdate' {EdgeConfig
edgeConfig :: EdgeConfig
$sel:edgeConfig:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> EdgeConfig
edgeConfig} -> EdgeConfig
edgeConfig) (\s :: StartEdgeConfigurationUpdate
s@StartEdgeConfigurationUpdate' {} EdgeConfig
a -> StartEdgeConfigurationUpdate
s {$sel:edgeConfig:StartEdgeConfigurationUpdate' :: EdgeConfig
edgeConfig = EdgeConfig
a} :: StartEdgeConfigurationUpdate)

instance Core.AWSRequest StartEdgeConfigurationUpdate where
  type
    AWSResponse StartEdgeConfigurationUpdate =
      StartEdgeConfigurationUpdateResponse
  request :: (Service -> Service)
-> StartEdgeConfigurationUpdate
-> Request StartEdgeConfigurationUpdate
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 StartEdgeConfigurationUpdate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartEdgeConfigurationUpdate)))
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 ->
          Maybe POSIX
-> Maybe EdgeConfig
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe SyncStatus
-> Int
-> StartEdgeConfigurationUpdateResponse
StartEdgeConfigurationUpdateResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EdgeConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FailedStatusDetails")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastUpdatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StreamARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StreamName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SyncStatus")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance
  Prelude.Hashable
    StartEdgeConfigurationUpdate
  where
  hashWithSalt :: Int -> StartEdgeConfigurationUpdate -> Int
hashWithSalt Int
_salt StartEdgeConfigurationUpdate' {Maybe Text
EdgeConfig
edgeConfig :: EdgeConfig
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:edgeConfig:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> EdgeConfig
$sel:streamName:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
$sel:streamARN:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EdgeConfig
edgeConfig

instance Prelude.NFData StartEdgeConfigurationUpdate where
  rnf :: StartEdgeConfigurationUpdate -> ()
rnf StartEdgeConfigurationUpdate' {Maybe Text
EdgeConfig
edgeConfig :: EdgeConfig
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:edgeConfig:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> EdgeConfig
$sel:streamName:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
$sel:streamARN:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EdgeConfig
edgeConfig

instance Data.ToHeaders StartEdgeConfigurationUpdate where
  toHeaders :: StartEdgeConfigurationUpdate -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON StartEdgeConfigurationUpdate where
  toJSON :: StartEdgeConfigurationUpdate -> Value
toJSON StartEdgeConfigurationUpdate' {Maybe Text
EdgeConfig
edgeConfig :: EdgeConfig
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:edgeConfig:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> EdgeConfig
$sel:streamName:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
$sel:streamARN:StartEdgeConfigurationUpdate' :: StartEdgeConfigurationUpdate -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"StreamARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamARN,
            (Key
"StreamName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName,
            forall a. a -> Maybe a
Prelude.Just (Key
"EdgeConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EdgeConfig
edgeConfig)
          ]
      )

instance Data.ToPath StartEdgeConfigurationUpdate where
  toPath :: StartEdgeConfigurationUpdate -> ByteString
toPath =
    forall a b. a -> b -> a
Prelude.const ByteString
"/startEdgeConfigurationUpdate"

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

-- | /See:/ 'newStartEdgeConfigurationUpdateResponse' smart constructor.
data StartEdgeConfigurationUpdateResponse = StartEdgeConfigurationUpdateResponse'
  { -- | The timestamp at which a stream’s edge configuration was first created.
    StartEdgeConfigurationUpdateResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | A description of the stream\'s edge configuration that will be used to
    -- sync with the Edge Agent IoT Greengrass component. The Edge Agent
    -- component will run on an IoT Hub Device setup at your premise.
    StartEdgeConfigurationUpdateResponse -> Maybe EdgeConfig
edgeConfig :: Prelude.Maybe EdgeConfig,
    -- | A description of the generated failure status.
    StartEdgeConfigurationUpdateResponse -> Maybe Text
failedStatusDetails :: Prelude.Maybe Prelude.Text,
    -- | The timestamp at which a stream’s edge configuration was last updated.
    StartEdgeConfigurationUpdateResponse -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the stream.
    StartEdgeConfigurationUpdateResponse -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
    -- | The name of the stream from which the edge configuration was updated.
    StartEdgeConfigurationUpdateResponse -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
    -- | The current sync status of the stream\'s edge configuration. When you
    -- invoke this API, the sync status will be set to the @SYNCING@ state. Use
    -- the @DescribeEdgeConfiguration@ API to get the latest status of the edge
    -- configuration.
    StartEdgeConfigurationUpdateResponse -> Maybe SyncStatus
syncStatus :: Prelude.Maybe SyncStatus,
    -- | The response's http status code.
    StartEdgeConfigurationUpdateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartEdgeConfigurationUpdateResponse
-> StartEdgeConfigurationUpdateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartEdgeConfigurationUpdateResponse
-> StartEdgeConfigurationUpdateResponse -> Bool
$c/= :: StartEdgeConfigurationUpdateResponse
-> StartEdgeConfigurationUpdateResponse -> Bool
== :: StartEdgeConfigurationUpdateResponse
-> StartEdgeConfigurationUpdateResponse -> Bool
$c== :: StartEdgeConfigurationUpdateResponse
-> StartEdgeConfigurationUpdateResponse -> Bool
Prelude.Eq, Int -> StartEdgeConfigurationUpdateResponse -> ShowS
[StartEdgeConfigurationUpdateResponse] -> ShowS
StartEdgeConfigurationUpdateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartEdgeConfigurationUpdateResponse] -> ShowS
$cshowList :: [StartEdgeConfigurationUpdateResponse] -> ShowS
show :: StartEdgeConfigurationUpdateResponse -> String
$cshow :: StartEdgeConfigurationUpdateResponse -> String
showsPrec :: Int -> StartEdgeConfigurationUpdateResponse -> ShowS
$cshowsPrec :: Int -> StartEdgeConfigurationUpdateResponse -> ShowS
Prelude.Show, forall x.
Rep StartEdgeConfigurationUpdateResponse x
-> StartEdgeConfigurationUpdateResponse
forall x.
StartEdgeConfigurationUpdateResponse
-> Rep StartEdgeConfigurationUpdateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartEdgeConfigurationUpdateResponse x
-> StartEdgeConfigurationUpdateResponse
$cfrom :: forall x.
StartEdgeConfigurationUpdateResponse
-> Rep StartEdgeConfigurationUpdateResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartEdgeConfigurationUpdateResponse' 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:
--
-- 'creationTime', 'startEdgeConfigurationUpdateResponse_creationTime' - The timestamp at which a stream’s edge configuration was first created.
--
-- 'edgeConfig', 'startEdgeConfigurationUpdateResponse_edgeConfig' - A description of the stream\'s edge configuration that will be used to
-- sync with the Edge Agent IoT Greengrass component. The Edge Agent
-- component will run on an IoT Hub Device setup at your premise.
--
-- 'failedStatusDetails', 'startEdgeConfigurationUpdateResponse_failedStatusDetails' - A description of the generated failure status.
--
-- 'lastUpdatedTime', 'startEdgeConfigurationUpdateResponse_lastUpdatedTime' - The timestamp at which a stream’s edge configuration was last updated.
--
-- 'streamARN', 'startEdgeConfigurationUpdateResponse_streamARN' - The Amazon Resource Name (ARN) of the stream.
--
-- 'streamName', 'startEdgeConfigurationUpdateResponse_streamName' - The name of the stream from which the edge configuration was updated.
--
-- 'syncStatus', 'startEdgeConfigurationUpdateResponse_syncStatus' - The current sync status of the stream\'s edge configuration. When you
-- invoke this API, the sync status will be set to the @SYNCING@ state. Use
-- the @DescribeEdgeConfiguration@ API to get the latest status of the edge
-- configuration.
--
-- 'httpStatus', 'startEdgeConfigurationUpdateResponse_httpStatus' - The response's http status code.
newStartEdgeConfigurationUpdateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartEdgeConfigurationUpdateResponse
newStartEdgeConfigurationUpdateResponse :: Int -> StartEdgeConfigurationUpdateResponse
newStartEdgeConfigurationUpdateResponse Int
pHttpStatus_ =
  StartEdgeConfigurationUpdateResponse'
    { $sel:creationTime:StartEdgeConfigurationUpdateResponse' :: Maybe POSIX
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:edgeConfig:StartEdgeConfigurationUpdateResponse' :: Maybe EdgeConfig
edgeConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:failedStatusDetails:StartEdgeConfigurationUpdateResponse' :: Maybe Text
failedStatusDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:StartEdgeConfigurationUpdateResponse' :: Maybe POSIX
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:streamARN:StartEdgeConfigurationUpdateResponse' :: Maybe Text
streamARN = forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:StartEdgeConfigurationUpdateResponse' :: Maybe Text
streamName = forall a. Maybe a
Prelude.Nothing,
      $sel:syncStatus:StartEdgeConfigurationUpdateResponse' :: Maybe SyncStatus
syncStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartEdgeConfigurationUpdateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The timestamp at which a stream’s edge configuration was first created.
startEdgeConfigurationUpdateResponse_creationTime :: Lens.Lens' StartEdgeConfigurationUpdateResponse (Prelude.Maybe Prelude.UTCTime)
startEdgeConfigurationUpdateResponse_creationTime :: Lens' StartEdgeConfigurationUpdateResponse (Maybe UTCTime)
startEdgeConfigurationUpdateResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdateResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: StartEdgeConfigurationUpdateResponse
s@StartEdgeConfigurationUpdateResponse' {} Maybe POSIX
a -> StartEdgeConfigurationUpdateResponse
s {$sel:creationTime:StartEdgeConfigurationUpdateResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: StartEdgeConfigurationUpdateResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A description of the stream\'s edge configuration that will be used to
-- sync with the Edge Agent IoT Greengrass component. The Edge Agent
-- component will run on an IoT Hub Device setup at your premise.
startEdgeConfigurationUpdateResponse_edgeConfig :: Lens.Lens' StartEdgeConfigurationUpdateResponse (Prelude.Maybe EdgeConfig)
startEdgeConfigurationUpdateResponse_edgeConfig :: Lens' StartEdgeConfigurationUpdateResponse (Maybe EdgeConfig)
startEdgeConfigurationUpdateResponse_edgeConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdateResponse' {Maybe EdgeConfig
edgeConfig :: Maybe EdgeConfig
$sel:edgeConfig:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe EdgeConfig
edgeConfig} -> Maybe EdgeConfig
edgeConfig) (\s :: StartEdgeConfigurationUpdateResponse
s@StartEdgeConfigurationUpdateResponse' {} Maybe EdgeConfig
a -> StartEdgeConfigurationUpdateResponse
s {$sel:edgeConfig:StartEdgeConfigurationUpdateResponse' :: Maybe EdgeConfig
edgeConfig = Maybe EdgeConfig
a} :: StartEdgeConfigurationUpdateResponse)

-- | A description of the generated failure status.
startEdgeConfigurationUpdateResponse_failedStatusDetails :: Lens.Lens' StartEdgeConfigurationUpdateResponse (Prelude.Maybe Prelude.Text)
startEdgeConfigurationUpdateResponse_failedStatusDetails :: Lens' StartEdgeConfigurationUpdateResponse (Maybe Text)
startEdgeConfigurationUpdateResponse_failedStatusDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdateResponse' {Maybe Text
failedStatusDetails :: Maybe Text
$sel:failedStatusDetails:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe Text
failedStatusDetails} -> Maybe Text
failedStatusDetails) (\s :: StartEdgeConfigurationUpdateResponse
s@StartEdgeConfigurationUpdateResponse' {} Maybe Text
a -> StartEdgeConfigurationUpdateResponse
s {$sel:failedStatusDetails:StartEdgeConfigurationUpdateResponse' :: Maybe Text
failedStatusDetails = Maybe Text
a} :: StartEdgeConfigurationUpdateResponse)

-- | The timestamp at which a stream’s edge configuration was last updated.
startEdgeConfigurationUpdateResponse_lastUpdatedTime :: Lens.Lens' StartEdgeConfigurationUpdateResponse (Prelude.Maybe Prelude.UTCTime)
startEdgeConfigurationUpdateResponse_lastUpdatedTime :: Lens' StartEdgeConfigurationUpdateResponse (Maybe UTCTime)
startEdgeConfigurationUpdateResponse_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdateResponse' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: StartEdgeConfigurationUpdateResponse
s@StartEdgeConfigurationUpdateResponse' {} Maybe POSIX
a -> StartEdgeConfigurationUpdateResponse
s {$sel:lastUpdatedTime:StartEdgeConfigurationUpdateResponse' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: StartEdgeConfigurationUpdateResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Name (ARN) of the stream.
startEdgeConfigurationUpdateResponse_streamARN :: Lens.Lens' StartEdgeConfigurationUpdateResponse (Prelude.Maybe Prelude.Text)
startEdgeConfigurationUpdateResponse_streamARN :: Lens' StartEdgeConfigurationUpdateResponse (Maybe Text)
startEdgeConfigurationUpdateResponse_streamARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdateResponse' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: StartEdgeConfigurationUpdateResponse
s@StartEdgeConfigurationUpdateResponse' {} Maybe Text
a -> StartEdgeConfigurationUpdateResponse
s {$sel:streamARN:StartEdgeConfigurationUpdateResponse' :: Maybe Text
streamARN = Maybe Text
a} :: StartEdgeConfigurationUpdateResponse)

-- | The name of the stream from which the edge configuration was updated.
startEdgeConfigurationUpdateResponse_streamName :: Lens.Lens' StartEdgeConfigurationUpdateResponse (Prelude.Maybe Prelude.Text)
startEdgeConfigurationUpdateResponse_streamName :: Lens' StartEdgeConfigurationUpdateResponse (Maybe Text)
startEdgeConfigurationUpdateResponse_streamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdateResponse' {Maybe Text
streamName :: Maybe Text
$sel:streamName:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: StartEdgeConfigurationUpdateResponse
s@StartEdgeConfigurationUpdateResponse' {} Maybe Text
a -> StartEdgeConfigurationUpdateResponse
s {$sel:streamName:StartEdgeConfigurationUpdateResponse' :: Maybe Text
streamName = Maybe Text
a} :: StartEdgeConfigurationUpdateResponse)

-- | The current sync status of the stream\'s edge configuration. When you
-- invoke this API, the sync status will be set to the @SYNCING@ state. Use
-- the @DescribeEdgeConfiguration@ API to get the latest status of the edge
-- configuration.
startEdgeConfigurationUpdateResponse_syncStatus :: Lens.Lens' StartEdgeConfigurationUpdateResponse (Prelude.Maybe SyncStatus)
startEdgeConfigurationUpdateResponse_syncStatus :: Lens' StartEdgeConfigurationUpdateResponse (Maybe SyncStatus)
startEdgeConfigurationUpdateResponse_syncStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEdgeConfigurationUpdateResponse' {Maybe SyncStatus
syncStatus :: Maybe SyncStatus
$sel:syncStatus:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe SyncStatus
syncStatus} -> Maybe SyncStatus
syncStatus) (\s :: StartEdgeConfigurationUpdateResponse
s@StartEdgeConfigurationUpdateResponse' {} Maybe SyncStatus
a -> StartEdgeConfigurationUpdateResponse
s {$sel:syncStatus:StartEdgeConfigurationUpdateResponse' :: Maybe SyncStatus
syncStatus = Maybe SyncStatus
a} :: StartEdgeConfigurationUpdateResponse)

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

instance
  Prelude.NFData
    StartEdgeConfigurationUpdateResponse
  where
  rnf :: StartEdgeConfigurationUpdateResponse -> ()
rnf StartEdgeConfigurationUpdateResponse' {Int
Maybe Text
Maybe POSIX
Maybe SyncStatus
Maybe EdgeConfig
httpStatus :: Int
syncStatus :: Maybe SyncStatus
streamName :: Maybe Text
streamARN :: Maybe Text
lastUpdatedTime :: Maybe POSIX
failedStatusDetails :: Maybe Text
edgeConfig :: Maybe EdgeConfig
creationTime :: Maybe POSIX
$sel:httpStatus:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Int
$sel:syncStatus:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe SyncStatus
$sel:streamName:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe Text
$sel:streamARN:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe Text
$sel:lastUpdatedTime:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe POSIX
$sel:failedStatusDetails:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe Text
$sel:edgeConfig:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe EdgeConfig
$sel:creationTime:StartEdgeConfigurationUpdateResponse' :: StartEdgeConfigurationUpdateResponse -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EdgeConfig
edgeConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failedStatusDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SyncStatus
syncStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus