{-# 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.WorkLink.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)
--
-- Provides information about a user\'s device.
module Amazonka.WorkLink.DescribeDevice
  ( -- * Creating a Request
    DescribeDevice (..),
    newDescribeDevice,

    -- * Request Lenses
    describeDevice_fleetArn,
    describeDevice_deviceId,

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

    -- * Response Lenses
    describeDeviceResponse_status,
    describeDeviceResponse_manufacturer,
    describeDeviceResponse_lastAccessedTime,
    describeDeviceResponse_operatingSystem,
    describeDeviceResponse_username,
    describeDeviceResponse_model,
    describeDeviceResponse_operatingSystemVersion,
    describeDeviceResponse_firstAccessedTime,
    describeDeviceResponse_patchLevel,
    describeDeviceResponse_httpStatus,
  )
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.WorkLink.Types

-- | /See:/ 'newDescribeDevice' smart constructor.
data DescribeDevice = DescribeDevice'
  { -- | The ARN of the fleet.
    DescribeDevice -> Text
fleetArn :: Prelude.Text,
    -- | A unique identifier for a registered user\'s device.
    DescribeDevice -> Text
deviceId :: 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:
--
-- 'fleetArn', 'describeDevice_fleetArn' - The ARN of the fleet.
--
-- 'deviceId', 'describeDevice_deviceId' - A unique identifier for a registered user\'s device.
newDescribeDevice ::
  -- | 'fleetArn'
  Prelude.Text ->
  -- | 'deviceId'
  Prelude.Text ->
  DescribeDevice
newDescribeDevice :: Text -> Text -> DescribeDevice
newDescribeDevice Text
pFleetArn_ Text
pDeviceId_ =
  DescribeDevice' :: Text -> Text -> DescribeDevice
DescribeDevice'
    { $sel:fleetArn:DescribeDevice' :: Text
fleetArn = Text
pFleetArn_,
      $sel:deviceId:DescribeDevice' :: Text
deviceId = Text
pDeviceId_
    }

-- | The ARN of the fleet.
describeDevice_fleetArn :: Lens.Lens' DescribeDevice Prelude.Text
describeDevice_fleetArn :: (Text -> f Text) -> DescribeDevice -> f DescribeDevice
describeDevice_fleetArn = (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
fleetArn :: Text
$sel:fleetArn:DescribeDevice' :: DescribeDevice -> Text
fleetArn} -> Text
fleetArn) (\s :: DescribeDevice
s@DescribeDevice' {} Text
a -> DescribeDevice
s {$sel:fleetArn:DescribeDevice' :: Text
fleetArn = Text
a} :: DescribeDevice)

-- | A unique identifier for a registered user\'s device.
describeDevice_deviceId :: Lens.Lens' DescribeDevice Prelude.Text
describeDevice_deviceId :: (Text -> f Text) -> DescribeDevice -> f DescribeDevice
describeDevice_deviceId = (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
deviceId :: Text
$sel:deviceId:DescribeDevice' :: DescribeDevice -> Text
deviceId} -> Text
deviceId) (\s :: DescribeDevice
s@DescribeDevice' {} Text
a -> DescribeDevice
s {$sel:deviceId:DescribeDevice' :: Text
deviceId = 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 DeviceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeDeviceResponse
DescribeDeviceResponse'
            (Maybe DeviceStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Int
 -> DescribeDeviceResponse)
-> Either String (Maybe DeviceStatus)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> DescribeDeviceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DeviceStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> 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
"Manufacturer")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> DescribeDeviceResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> 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
"LastAccessedTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> 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
"OperatingSystem")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> 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
"Username")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Int -> 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
"Model")
            Either
  String
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Int -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe POSIX -> Maybe Text -> Int -> 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
"OperatingSystemVersion")
            Either
  String (Maybe POSIX -> Maybe Text -> Int -> DescribeDeviceResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe Text -> Int -> 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
"FirstAccessedTime")
            Either String (Maybe Text -> Int -> DescribeDeviceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> 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
"PatchLevel")
            Either String (Int -> DescribeDeviceResponse)
-> Either String Int -> Either String 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))
      )

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
"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' {Text
deviceId :: Text
fleetArn :: Text
$sel:deviceId:DescribeDevice' :: DescribeDevice -> Text
$sel:fleetArn:DescribeDevice' :: DescribeDevice -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceId)
          ]
      )

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

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 current state of the device.
    DescribeDeviceResponse -> Maybe DeviceStatus
status :: Prelude.Maybe DeviceStatus,
    -- | The manufacturer of the device.
    DescribeDeviceResponse -> Maybe Text
manufacturer :: Prelude.Maybe Prelude.Text,
    -- | The date that the device last accessed Amazon WorkLink.
    DescribeDeviceResponse -> Maybe POSIX
lastAccessedTime :: Prelude.Maybe Core.POSIX,
    -- | The operating system of the device.
    DescribeDeviceResponse -> Maybe Text
operatingSystem :: Prelude.Maybe Prelude.Text,
    -- | The user name associated with the device.
    DescribeDeviceResponse -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | The model of the device.
    DescribeDeviceResponse -> Maybe Text
model :: Prelude.Maybe Prelude.Text,
    -- | The operating system version of the device.
    DescribeDeviceResponse -> Maybe Text
operatingSystemVersion :: Prelude.Maybe Prelude.Text,
    -- | The date that the device first signed in to Amazon WorkLink.
    DescribeDeviceResponse -> Maybe POSIX
firstAccessedTime :: Prelude.Maybe Core.POSIX,
    -- | The operating system patch level of the device.
    DescribeDeviceResponse -> Maybe Text
patchLevel :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeDeviceResponse -> Int
httpStatus :: Prelude.Int
  }
  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:
--
-- 'status', 'describeDeviceResponse_status' - The current state of the device.
--
-- 'manufacturer', 'describeDeviceResponse_manufacturer' - The manufacturer of the device.
--
-- 'lastAccessedTime', 'describeDeviceResponse_lastAccessedTime' - The date that the device last accessed Amazon WorkLink.
--
-- 'operatingSystem', 'describeDeviceResponse_operatingSystem' - The operating system of the device.
--
-- 'username', 'describeDeviceResponse_username' - The user name associated with the device.
--
-- 'model', 'describeDeviceResponse_model' - The model of the device.
--
-- 'operatingSystemVersion', 'describeDeviceResponse_operatingSystemVersion' - The operating system version of the device.
--
-- 'firstAccessedTime', 'describeDeviceResponse_firstAccessedTime' - The date that the device first signed in to Amazon WorkLink.
--
-- 'patchLevel', 'describeDeviceResponse_patchLevel' - The operating system patch level of the device.
--
-- 'httpStatus', 'describeDeviceResponse_httpStatus' - The response's http status code.
newDescribeDeviceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDeviceResponse
newDescribeDeviceResponse :: Int -> DescribeDeviceResponse
newDescribeDeviceResponse Int
pHttpStatus_ =
  DescribeDeviceResponse' :: Maybe DeviceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeDeviceResponse
DescribeDeviceResponse'
    { $sel:status:DescribeDeviceResponse' :: Maybe DeviceStatus
status = Maybe DeviceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:manufacturer:DescribeDeviceResponse' :: Maybe Text
manufacturer = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastAccessedTime:DescribeDeviceResponse' :: Maybe POSIX
lastAccessedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:operatingSystem:DescribeDeviceResponse' :: Maybe Text
operatingSystem = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:username:DescribeDeviceResponse' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:model:DescribeDeviceResponse' :: Maybe Text
model = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operatingSystemVersion:DescribeDeviceResponse' :: Maybe Text
operatingSystemVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firstAccessedTime:DescribeDeviceResponse' :: Maybe POSIX
firstAccessedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:patchLevel:DescribeDeviceResponse' :: Maybe Text
patchLevel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDeviceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current state of the device.
describeDeviceResponse_status :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe DeviceStatus)
describeDeviceResponse_status :: (Maybe DeviceStatus -> f (Maybe DeviceStatus))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_status = (DescribeDeviceResponse -> Maybe DeviceStatus)
-> (DescribeDeviceResponse
    -> Maybe DeviceStatus -> DescribeDeviceResponse)
-> Lens
     DescribeDeviceResponse
     DescribeDeviceResponse
     (Maybe DeviceStatus)
     (Maybe DeviceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeviceResponse' {Maybe DeviceStatus
status :: Maybe DeviceStatus
$sel:status:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe DeviceStatus
status} -> Maybe DeviceStatus
status) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe DeviceStatus
a -> DescribeDeviceResponse
s {$sel:status:DescribeDeviceResponse' :: Maybe DeviceStatus
status = Maybe DeviceStatus
a} :: DescribeDeviceResponse)

-- | The manufacturer of the device.
describeDeviceResponse_manufacturer :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_manufacturer :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_manufacturer = (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
manufacturer :: Maybe Text
$sel:manufacturer:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
manufacturer} -> Maybe Text
manufacturer) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:manufacturer:DescribeDeviceResponse' :: Maybe Text
manufacturer = Maybe Text
a} :: DescribeDeviceResponse)

-- | The date that the device last accessed Amazon WorkLink.
describeDeviceResponse_lastAccessedTime :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.UTCTime)
describeDeviceResponse_lastAccessedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_lastAccessedTime = (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
lastAccessedTime :: Maybe POSIX
$sel:lastAccessedTime:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe POSIX
lastAccessedTime} -> Maybe POSIX
lastAccessedTime) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe POSIX
a -> DescribeDeviceResponse
s {$sel:lastAccessedTime:DescribeDeviceResponse' :: Maybe POSIX
lastAccessedTime = 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

-- | The operating system of the device.
describeDeviceResponse_operatingSystem :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_operatingSystem :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_operatingSystem = (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
operatingSystem :: Maybe Text
$sel:operatingSystem:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
operatingSystem} -> Maybe Text
operatingSystem) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:operatingSystem:DescribeDeviceResponse' :: Maybe Text
operatingSystem = Maybe Text
a} :: DescribeDeviceResponse)

-- | The user name associated with the device.
describeDeviceResponse_username :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_username :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_username = (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
username :: Maybe Text
$sel:username:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
username} -> Maybe Text
username) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:username:DescribeDeviceResponse' :: Maybe Text
username = Maybe Text
a} :: DescribeDeviceResponse)

-- | The model of the device.
describeDeviceResponse_model :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_model :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_model = (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
model :: Maybe Text
$sel:model:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
model} -> Maybe Text
model) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:model:DescribeDeviceResponse' :: Maybe Text
model = Maybe Text
a} :: DescribeDeviceResponse)

-- | The operating system version of the device.
describeDeviceResponse_operatingSystemVersion :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_operatingSystemVersion :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_operatingSystemVersion = (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
operatingSystemVersion :: Maybe Text
$sel:operatingSystemVersion:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
operatingSystemVersion} -> Maybe Text
operatingSystemVersion) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:operatingSystemVersion:DescribeDeviceResponse' :: Maybe Text
operatingSystemVersion = Maybe Text
a} :: DescribeDeviceResponse)

-- | The date that the device first signed in to Amazon WorkLink.
describeDeviceResponse_firstAccessedTime :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.UTCTime)
describeDeviceResponse_firstAccessedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_firstAccessedTime = (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
firstAccessedTime :: Maybe POSIX
$sel:firstAccessedTime:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe POSIX
firstAccessedTime} -> Maybe POSIX
firstAccessedTime) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe POSIX
a -> DescribeDeviceResponse
s {$sel:firstAccessedTime:DescribeDeviceResponse' :: Maybe POSIX
firstAccessedTime = 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

-- | The operating system patch level of the device.
describeDeviceResponse_patchLevel :: Lens.Lens' DescribeDeviceResponse (Prelude.Maybe Prelude.Text)
describeDeviceResponse_patchLevel :: (Maybe Text -> f (Maybe Text))
-> DescribeDeviceResponse -> f DescribeDeviceResponse
describeDeviceResponse_patchLevel = (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
patchLevel :: Maybe Text
$sel:patchLevel:DescribeDeviceResponse' :: DescribeDeviceResponse -> Maybe Text
patchLevel} -> Maybe Text
patchLevel) (\s :: DescribeDeviceResponse
s@DescribeDeviceResponse' {} Maybe Text
a -> DescribeDeviceResponse
s {$sel:patchLevel:DescribeDeviceResponse' :: Maybe Text
patchLevel = 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)

instance Prelude.NFData DescribeDeviceResponse