{-# 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.SageMaker.DescribeDevice
-- 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)
--
-- Describes the device.
module Amazonka.SageMaker.DescribeDevice
  ( -- * Creating a Request
    DescribeDevice (..),
    newDescribeDevice,

    -- * Request Lenses
    describeDevice_nextToken,
    describeDevice_deviceName,
    describeDevice_deviceFleetName,

    -- * Destructuring the Response
    DescribeDeviceResponse (..),
    newDescribeDeviceResponse,

    -- * Response Lenses
    describeDeviceResponse_deviceArn,
    describeDeviceResponse_nextToken,
    describeDeviceResponse_models,
    describeDeviceResponse_maxModels,
    describeDeviceResponse_latestHeartbeat,
    describeDeviceResponse_description,
    describeDeviceResponse_iotThingName,
    describeDeviceResponse_httpStatus,
    describeDeviceResponse_deviceName,
    describeDeviceResponse_deviceFleetName,
    describeDeviceResponse_registrationTime,
  )
where

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

-- | /See:/ 'newDescribeDevice' smart constructor.
data DescribeDevice = DescribeDevice'
  { -- | Next token of device description.
    DescribeDevice -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of the device.
    DescribeDevice -> Text
deviceName :: Prelude.Text,
    -- | The name of the fleet the devices belong to.
    DescribeDevice -> Text
deviceFleetName :: Prelude.Text
  }
  deriving (DescribeDevice -> DescribeDevice -> Bool
(DescribeDevice -> DescribeDevice -> Bool)
-> (DescribeDevice -> DescribeDevice -> Bool) -> Eq DescribeDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDevice -> DescribeDevice -> Bool
$c/= :: DescribeDevice -> DescribeDevice -> Bool
== :: DescribeDevice -> DescribeDevice -> Bool
$c== :: DescribeDevice -> DescribeDevice -> Bool
Prelude.Eq, ReadPrec [DescribeDevice]
ReadPrec DescribeDevice
Int -> ReadS DescribeDevice
ReadS [DescribeDevice]
(Int -> ReadS DescribeDevice)
-> ReadS [DescribeDevice]
-> ReadPrec DescribeDevice
-> ReadPrec [DescribeDevice]
-> Read DescribeDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDevice]
$creadListPrec :: ReadPrec [DescribeDevice]
readPrec :: ReadPrec DescribeDevice
$creadPrec :: ReadPrec DescribeDevice
readList :: ReadS [DescribeDevice]
$creadList :: ReadS [DescribeDevice]
readsPrec :: Int -> ReadS DescribeDevice
$creadsPrec :: Int -> ReadS DescribeDevice
Prelude.Read, Int -> DescribeDevice -> ShowS
[DescribeDevice] -> ShowS
DescribeDevice -> String
(Int -> DescribeDevice -> ShowS)
-> (DescribeDevice -> String)
-> ([DescribeDevice] -> ShowS)
-> Show DescribeDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDevice] -> ShowS
$cshowList :: [DescribeDevice] -> ShowS
show :: DescribeDevice -> String
$cshow :: DescribeDevice -> String
showsPrec :: Int -> DescribeDevice -> ShowS
$cshowsPrec :: Int -> DescribeDevice -> ShowS
Prelude.Show, (forall x. DescribeDevice -> Rep DescribeDevice x)
-> (forall x. Rep DescribeDevice x -> DescribeDevice)
-> Generic DescribeDevice
forall x. Rep DescribeDevice x -> DescribeDevice
forall x. DescribeDevice -> Rep DescribeDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDevice x -> DescribeDevice
$cfrom :: forall x. DescribeDevice -> Rep DescribeDevice x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDevice' 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:
--
-- 'nextToken', 'describeDevice_nextToken' - Next token of device description.
--
-- 'deviceName', 'describeDevice_deviceName' - The unique ID of the device.
--
-- 'deviceFleetName', 'describeDevice_deviceFleetName' - The name of the fleet the devices belong to.
newDescribeDevice ::
  -- | 'deviceName'
  Prelude.Text ->
  -- | 'deviceFleetName'
  Prelude.Text ->
  DescribeDevice
newDescribeDevice :: Text -> Text -> DescribeDevice
newDescribeDevice Text
pDeviceName_ Text
pDeviceFleetName_ =
  DescribeDevice' :: Maybe Text -> Text -> Text -> DescribeDevice
DescribeDevice'
    { $sel:nextToken:DescribeDevice' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceName:DescribeDevice' :: Text
deviceName = Text
pDeviceName_,
      $sel:deviceFleetName:DescribeDevice' :: Text
deviceFleetName = Text
pDeviceFleetName_
    }

-- | Next token of device description.
describeDevice_nextToken :: Lens.Lens' DescribeDevice (Prelude.Maybe Prelude.Text)
describeDevice_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDevice -> f DescribeDevice
describeDevice_nextToken = (DescribeDevice -> Maybe Text)
-> (DescribeDevice -> Maybe Text -> DescribeDevice)
-> Lens DescribeDevice DescribeDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDevice' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDevice' :: DescribeDevice -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDevice
s@DescribeDevice' {} Maybe Text
a -> DescribeDevice
s {$sel:nextToken:DescribeDevice' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDevice)

-- | The unique ID of the device.
describeDevice_deviceName :: Lens.Lens' DescribeDevice Prelude.Text
describeDevice_deviceName :: (Text -> f Text) -> DescribeDevice -> f DescribeDevice
describeDevice_deviceName = (DescribeDevice -> Text)
-> (DescribeDevice -> Text -> DescribeDevice)
-> Lens DescribeDevice DescribeDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDevice' {Text
deviceName :: Text
$sel:deviceName:DescribeDevice' :: DescribeDevice -> Text
deviceName} -> Text
deviceName) (\s :: DescribeDevice
s@DescribeDevice' {} Text
a -> DescribeDevice
s {$sel:deviceName:DescribeDevice' :: Text
deviceName = Text
a} :: DescribeDevice)

-- | The name of the fleet the devices belong to.
describeDevice_deviceFleetName :: Lens.Lens' DescribeDevice Prelude.Text
describeDevice_deviceFleetName :: (Text -> f Text) -> DescribeDevice -> f DescribeDevice
describeDevice_deviceFleetName = (DescribeDevice -> Text)
-> (DescribeDevice -> Text -> DescribeDevice)
-> Lens DescribeDevice DescribeDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDevice' {Text
deviceFleetName :: Text
$sel:deviceFleetName:DescribeDevice' :: DescribeDevice -> Text
deviceFleetName} -> Text
deviceFleetName) (\s :: DescribeDevice
s@DescribeDevice' {} Text
a -> DescribeDevice
s {$sel:deviceFleetName:DescribeDevice' :: Text
deviceFleetName = Text
a} :: DescribeDevice)

instance Core.AWSRequest DescribeDevice where
  type
    AWSResponse DescribeDevice =
      DescribeDeviceResponse
  request :: DescribeDevice -> Request DescribeDevice
request = Service -> DescribeDevice -> Request DescribeDevice
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDevice)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeDevice))
-> Logger
-> Service
-> Proxy DescribeDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDevice)))
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 ->
          Maybe Text
-> Maybe Text
-> Maybe [EdgeModel]
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> Text
-> Text
-> POSIX
-> DescribeDeviceResponse
DescribeDeviceResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [EdgeModel]
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> Text
 -> Text
 -> POSIX
 -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [EdgeModel]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> POSIX
      -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeviceArn")
            Either
  String
  (Maybe Text
   -> Maybe [EdgeModel]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> POSIX
   -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [EdgeModel]
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> POSIX
      -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [EdgeModel]
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> POSIX
   -> DescribeDeviceResponse)
-> Either String (Maybe [EdgeModel])
-> Either
     String
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> POSIX
      -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [EdgeModel]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Models" Either String (Maybe (Maybe [EdgeModel]))
-> Maybe [EdgeModel] -> Either String (Maybe [EdgeModel])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EdgeModel]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> POSIX
   -> DescribeDeviceResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> POSIX
      -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MaxModels")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> POSIX
   -> DescribeDeviceResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> POSIX
      -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LatestHeartbeat")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> POSIX
   -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int -> Text -> Text -> POSIX -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either
  String
  (Maybe Text
   -> Int -> Text -> Text -> POSIX -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> Text -> Text -> POSIX -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IotThingName")
            Either
  String (Int -> Text -> Text -> POSIX -> DescribeDeviceResponse)
-> Either String Int
-> Either String (Text -> Text -> POSIX -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> Text -> POSIX -> DescribeDeviceResponse)
-> Either String Text
-> Either String (Text -> POSIX -> DescribeDeviceResponse)
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
"DeviceName")
            Either String (Text -> POSIX -> DescribeDeviceResponse)
-> Either String Text
-> Either String (POSIX -> DescribeDeviceResponse)
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
"DeviceFleetName")
            Either String (POSIX -> DescribeDeviceResponse)
-> Either String POSIX -> Either String DescribeDeviceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"RegistrationTime")
      )

instance Prelude.Hashable DescribeDevice

instance Prelude.NFData DescribeDevice

instance Core.ToHeaders DescribeDevice where
  toHeaders :: DescribeDevice -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeDevice -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.DescribeDevice" :: Prelude.ByteString),
            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 DescribeDevice where
  toJSON :: DescribeDevice -> Value
toJSON DescribeDevice' {Maybe Text
Text
deviceFleetName :: Text
deviceName :: Text
nextToken :: Maybe Text
$sel:deviceFleetName:DescribeDevice' :: DescribeDevice -> Text
$sel:deviceName:DescribeDevice' :: DescribeDevice -> Text
$sel:nextToken:DescribeDevice' :: DescribeDevice -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DeviceFleetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceFleetName)
          ]
      )

instance Core.ToPath DescribeDevice where
  toPath :: DescribeDevice -> ByteString
toPath = ByteString -> DescribeDevice -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDescribeDeviceResponse' smart constructor.
data DescribeDeviceResponse = DescribeDeviceResponse'
  { -- | The Amazon Resource Name (ARN) of the device.
    DescribeDeviceResponse -> Maybe Text
deviceArn :: Prelude.Maybe Prelude.Text,
    -- | The response from the last list when returning a list large enough to
    -- need tokening.
    DescribeDeviceResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Models on the device.
    DescribeDeviceResponse -> Maybe [EdgeModel]
models :: Prelude.Maybe [EdgeModel],
    -- | The maximum number of models.
    DescribeDeviceResponse -> Maybe Int
maxModels :: Prelude.Maybe Prelude.Int,
    -- | The last heartbeat received from the device.
    DescribeDeviceResponse -> Maybe POSIX
latestHeartbeat :: Prelude.Maybe Core.POSIX,
    -- | A description of the device.
    DescribeDeviceResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Internet of Things (IoT) object thing name
    -- associated with the device.
    DescribeDeviceResponse -> Maybe Text
iotThingName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeDeviceResponse -> Int
httpStatus :: Prelude.Int,
    -- | The unique identifier of the device.
    DescribeDeviceResponse -> Text
deviceName :: Prelude.Text,
    -- | The name of the fleet the device belongs to.
    DescribeDeviceResponse -> Text
deviceFleetName :: Prelude.Text,
    -- | The timestamp of the last registration or de-reregistration.
    DescribeDeviceResponse -> POSIX
registrationTime :: Core.POSIX
  }
  deriving (DescribeDeviceResponse -> DescribeDeviceResponse -> Bool
(DescribeDeviceResponse -> DescribeDeviceResponse -> Bool)
-> (DescribeDeviceResponse -> DescribeDeviceResponse -> Bool)
-> Eq DescribeDeviceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDeviceResponse -> DescribeDeviceResponse -> Bool
$c/= :: DescribeDeviceResponse -> DescribeDeviceResponse -> Bool
== :: DescribeDeviceResponse -> DescribeDeviceResponse -> Bool
$c== :: DescribeDeviceResponse -> DescribeDeviceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDeviceResponse]
ReadPrec DescribeDeviceResponse
Int -> ReadS DescribeDeviceResponse
ReadS [DescribeDeviceResponse]
(Int -> ReadS DescribeDeviceResponse)
-> ReadS [DescribeDeviceResponse]
-> ReadPrec DescribeDeviceResponse
-> ReadPrec [DescribeDeviceResponse]
-> Read DescribeDeviceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDeviceResponse]
$creadListPrec :: ReadPrec [DescribeDeviceResponse]
readPrec :: ReadPrec DescribeDeviceResponse
$creadPrec :: ReadPrec DescribeDeviceResponse
readList :: ReadS [DescribeDeviceResponse]
$creadList :: ReadS [DescribeDeviceResponse]
readsPrec :: Int -> ReadS DescribeDeviceResponse
$creadsPrec :: Int -> ReadS DescribeDeviceResponse
Prelude.Read, Int -> DescribeDeviceResponse -> ShowS
[DescribeDeviceResponse] -> ShowS
DescribeDeviceResponse -> String
(Int -> DescribeDeviceResponse -> ShowS)
-> (DescribeDeviceResponse -> String)
-> ([DescribeDeviceResponse] -> ShowS)
-> Show DescribeDeviceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDeviceResponse] -> ShowS
$cshowList :: [DescribeDeviceResponse] -> ShowS
show :: DescribeDeviceResponse -> String
$cshow :: DescribeDeviceResponse -> String
showsPrec :: Int -> DescribeDeviceResponse -> ShowS
$cshowsPrec :: Int -> DescribeDeviceResponse -> ShowS
Prelude.Show, (forall x. DescribeDeviceResponse -> Rep DescribeDeviceResponse x)
-> (forall x.
    Rep DescribeDeviceResponse x -> DescribeDeviceResponse)
-> Generic DescribeDeviceResponse
forall x. Rep DescribeDeviceResponse x -> DescribeDeviceResponse
forall x. DescribeDeviceResponse -> Rep DescribeDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDeviceResponse x -> DescribeDeviceResponse
$cfrom :: forall x. DescribeDeviceResponse -> Rep DescribeDeviceResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDeviceResponse' 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:
--
-- 'deviceArn', 'describeDeviceResponse_deviceArn' - The Amazon Resource Name (ARN) of the device.
--
-- 'nextToken', 'describeDeviceResponse_nextToken' - The response from the last list when returning a list large enough to
-- need tokening.
--
-- 'models', 'describeDeviceResponse_models' - Models on the device.
--
-- 'maxModels', 'describeDeviceResponse_maxModels' - The maximum number of models.
--
-- 'latestHeartbeat', 'describeDeviceResponse_latestHeartbeat' - The last heartbeat received from the device.
--
-- 'description', 'describeDeviceResponse_description' - A description of the device.
--
-- 'iotThingName', 'describeDeviceResponse_iotThingName' - The Amazon Web Services Internet of Things (IoT) object thing name
-- associated with the device.
--
-- 'httpStatus', 'describeDeviceResponse_httpStatus' - The response's http status code.
--
-- 'deviceName', 'describeDeviceResponse_deviceName' - The unique identifier of the device.
--
-- 'deviceFleetName', 'describeDeviceResponse_deviceFleetName' - The name of the fleet the device belongs to.
--
-- 'registrationTime', 'describeDeviceResponse_registrationTime' - The timestamp of the last registration or de-reregistration.
newDescribeDeviceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'deviceName'
  Prelude.Text ->
  -- | 'deviceFleetName'
  Prelude.Text ->
  -- | 'registrationTime'
  Prelude.UTCTime ->
  DescribeDeviceResponse
newDescribeDeviceResponse :: Int -> Text -> Text -> UTCTime -> DescribeDeviceResponse
newDescribeDeviceResponse
  Int
pHttpStatus_
  Text
pDeviceName_
  Text
pDeviceFleetName_
  UTCTime
pRegistrationTime_ =
    DescribeDeviceResponse' :: Maybe Text
-> Maybe Text
-> Maybe [EdgeModel]
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> Text
-> Text
-> POSIX
-> DescribeDeviceResponse
DescribeDeviceResponse'
      { $sel:deviceArn:DescribeDeviceResponse' :: Maybe Text
deviceArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeDeviceResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:models:DescribeDeviceResponse' :: Maybe [EdgeModel]
models = Maybe [EdgeModel]
forall a. Maybe a
Prelude.Nothing,
        $sel:maxModels:DescribeDeviceResponse' :: Maybe Int
maxModels = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:latestHeartbeat:DescribeDeviceResponse' :: Maybe POSIX
latestHeartbeat = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:description:DescribeDeviceResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:iotThingName:DescribeDeviceResponse' :: Maybe Text
iotThingName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeDeviceResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:deviceName:DescribeDeviceResponse' :: Text
deviceName = Text
pDeviceName_,
        $sel:deviceFleetName:DescribeDeviceResponse' :: Text
deviceFleetName = Text
pDeviceFleetName_,
        $sel:registrationTime:DescribeDeviceResponse' :: POSIX
registrationTime =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pRegistrationTime_
      }

-- | The Amazon Resource Name (ARN) of the device.
describeDeviceResponse_deviceArn :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_deviceArn :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_deviceArn = (DescribeDeviceResponse -> Maybe Text)
-> (DescribeDeviceResponse -> Maybe Text -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe Text
deviceArn :: Maybe Text
$sel:deviceArn:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
deviceArn} -> Maybe Text
deviceArn) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:deviceArn:DescribeDeviceResponse' :: Maybe Text
deviceArn = Maybe Text
a} :: DescribeDeviceResponse)

-- | The response from the last list when returning a list large enough to
-- need tokening.
describeDeviceResponse_nextToken :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_nextToken = (DescribeDeviceResponse -> Maybe Text)
-> (DescribeDeviceResponse -> Maybe Text -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:nextToken:DescribeDeviceResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDeviceResponse)

-- | Models on the device.
describeDeviceResponse_models :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe [EdgeModel])
describeDeviceResponse_models :: (Maybe [EdgeModel] -> f (Maybe [EdgeModel]))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_models = (DescribeDeviceResponse -> Maybe [EdgeModel])
-> (DescribeDeviceResponse
    -> Maybe [EdgeModel] -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe [EdgeModel])
     (Maybe [EdgeModel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe [EdgeModel]
models :: Maybe [EdgeModel]
$sel:models:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe [EdgeModel]
models} -> Maybe [EdgeModel]
models) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe [EdgeModel]
a -> DescribeDeviceResponse
s {$sel:models:DescribeDeviceResponse' :: Maybe [EdgeModel]
models = Maybe [EdgeModel]
a} :: DescribeDeviceResponse) ((Maybe [EdgeModel] -> f (Maybe [EdgeModel]))
 -> DescribeDeviceResponse -> f DescribeDeviceResponse)
-> ((Maybe [EdgeModel] -> f (Maybe [EdgeModel]))
    -> Maybe [EdgeModel] -> f (Maybe [EdgeModel]))
-> (Maybe [EdgeModel] -> f (Maybe [EdgeModel]))
-> DescribeDeviceResponse
-> f DescribeDeviceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [EdgeModel] [EdgeModel] [EdgeModel] [EdgeModel]
-> Iso
     (Maybe [EdgeModel])
     (Maybe [EdgeModel])
     (Maybe [EdgeModel])
     (Maybe [EdgeModel])
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 AnIso [EdgeModel] [EdgeModel] [EdgeModel] [EdgeModel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of models.
describeDeviceResponse_maxModels :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Int)
describeDeviceResponse_maxModels :: (Maybe Int -> f (Maybe Int))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_maxModels = (DescribeDeviceResponse -> Maybe Int)
-> (DescribeDeviceResponse -> Maybe Int -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe Int
maxModels :: Maybe Int
$sel:maxModels:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Int
maxModels} -> Maybe Int
maxModels) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Int
a -> DescribeDeviceResponse
s {$sel:maxModels:DescribeDeviceResponse' :: Maybe Int
maxModels = Maybe Int
a} :: DescribeDeviceResponse)

-- | The last heartbeat received from the device.
describeDeviceResponse_latestHeartbeat :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.UTCTime)
describeDeviceResponse_latestHeartbeat :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_latestHeartbeat = (DescribeDeviceResponse -> Maybe POSIX)
-> (DescribeDeviceResponse
    -> Maybe POSIX -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe POSIX
latestHeartbeat :: Maybe POSIX
$sel:latestHeartbeat:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe POSIX
latestHeartbeat} -> Maybe POSIX
latestHeartbeat) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe POSIX
a -> DescribeDeviceResponse
s {$sel:latestHeartbeat:DescribeDeviceResponse' :: Maybe POSIX
latestHeartbeat = Maybe POSIX
a} :: DescribeDeviceResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeDeviceResponse -> f DescribeDeviceResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDeviceResponse
-> f DescribeDeviceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A description of the device.
describeDeviceResponse_description :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_description :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_description = (DescribeDeviceResponse -> Maybe Text)
-> (DescribeDeviceResponse -> Maybe Text -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:description:DescribeDeviceResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeDeviceResponse)

-- | The Amazon Web Services Internet of Things (IoT) object thing name
-- associated with the device.
describeDeviceResponse_iotThingName :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_iotThingName :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_iotThingName = (DescribeDeviceResponse -> Maybe Text)
-> (DescribeDeviceResponse -> Maybe Text -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe Text
iotThingName :: Maybe Text
$sel:iotThingName:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
iotThingName} -> Maybe Text
iotThingName) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:iotThingName:DescribeDeviceResponse' :: Maybe Text
iotThingName = Maybe Text
a} :: DescribeDeviceResponse)

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

-- | The unique identifier of the device.
describeDeviceResponse_deviceName :: Lens.Lens' DescribeDeviceResponse Prelude.Text
describeDeviceResponse_deviceName :: (Text -> f Text)
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_deviceName = (DescribeDeviceResponse -> Text)
-> (DescribeDeviceResponse -> Text -> DescribeDeviceResponse)
-> Lens DescribeDeviceResponse DescribeDeviceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Text
deviceName :: Text
$sel:deviceName:DescribeDeviceResponse' :: DescribeDeviceResponse -> Text
deviceName} -> Text
deviceName) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Text
a -> DescribeDeviceResponse
s {$sel:deviceName:DescribeDeviceResponse' :: Text
deviceName = Text
a} :: DescribeDeviceResponse)

-- | The name of the fleet the device belongs to.
describeDeviceResponse_deviceFleetName :: Lens.Lens' DescribeDeviceResponse Prelude.Text
describeDeviceResponse_deviceFleetName :: (Text -> f Text)
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_deviceFleetName = (DescribeDeviceResponse -> Text)
-> (DescribeDeviceResponse -> Text -> DescribeDeviceResponse)
-> Lens DescribeDeviceResponse DescribeDeviceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Text
deviceFleetName :: Text
$sel:deviceFleetName:DescribeDeviceResponse' :: DescribeDeviceResponse -> Text
deviceFleetName} -> Text
deviceFleetName) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Text
a -> DescribeDeviceResponse
s {$sel:deviceFleetName:DescribeDeviceResponse' :: Text
deviceFleetName = Text
a} :: DescribeDeviceResponse)

-- | The timestamp of the last registration or de-reregistration.
describeDeviceResponse_registrationTime :: Lens.Lens' DescribeDeviceResponse Prelude.UTCTime
describeDeviceResponse_registrationTime :: (UTCTime -> f UTCTime)
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_registrationTime = (DescribeDeviceResponse -> POSIX)
-> (DescribeDeviceResponse -> POSIX -> DescribeDeviceResponse)
-> Lens DescribeDeviceResponse DescribeDeviceResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {POSIX
registrationTime :: POSIX
$sel:registrationTime:DescribeDeviceResponse' :: DescribeDeviceResponse -> POSIX
registrationTime} -> POSIX
registrationTime) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} POSIX
a -> DescribeDeviceResponse
s {$sel:registrationTime:DescribeDeviceResponse' :: POSIX
registrationTime = POSIX
a} :: DescribeDeviceResponse) ((POSIX -> f POSIX)
 -> DescribeDeviceResponse -> f DescribeDeviceResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeDeviceResponse
-> f DescribeDeviceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Prelude.NFData DescribeDeviceResponse