{-# 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.GreengrassV2.GetCoreDevice
-- 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)
--
-- Retrieves metadata for a Greengrass core device.
module Amazonka.GreengrassV2.GetCoreDevice
  ( -- * Creating a Request
    GetCoreDevice (..),
    newGetCoreDevice,

    -- * Request Lenses
    getCoreDevice_coreDeviceThingName,

    -- * Destructuring the Response
    GetCoreDeviceResponse (..),
    newGetCoreDeviceResponse,

    -- * Response Lenses
    getCoreDeviceResponse_status,
    getCoreDeviceResponse_platform,
    getCoreDeviceResponse_architecture,
    getCoreDeviceResponse_coreDeviceThingName,
    getCoreDeviceResponse_tags,
    getCoreDeviceResponse_coreVersion,
    getCoreDeviceResponse_lastStatusUpdateTimestamp,
    getCoreDeviceResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetCoreDevice' smart constructor.
data GetCoreDevice = GetCoreDevice'
  { -- | The name of the core device. This is also the name of the IoT thing.
    GetCoreDevice -> Text
coreDeviceThingName :: Prelude.Text
  }
  deriving (GetCoreDevice -> GetCoreDevice -> Bool
(GetCoreDevice -> GetCoreDevice -> Bool)
-> (GetCoreDevice -> GetCoreDevice -> Bool) -> Eq GetCoreDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCoreDevice -> GetCoreDevice -> Bool
$c/= :: GetCoreDevice -> GetCoreDevice -> Bool
== :: GetCoreDevice -> GetCoreDevice -> Bool
$c== :: GetCoreDevice -> GetCoreDevice -> Bool
Prelude.Eq, ReadPrec [GetCoreDevice]
ReadPrec GetCoreDevice
Int -> ReadS GetCoreDevice
ReadS [GetCoreDevice]
(Int -> ReadS GetCoreDevice)
-> ReadS [GetCoreDevice]
-> ReadPrec GetCoreDevice
-> ReadPrec [GetCoreDevice]
-> Read GetCoreDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCoreDevice]
$creadListPrec :: ReadPrec [GetCoreDevice]
readPrec :: ReadPrec GetCoreDevice
$creadPrec :: ReadPrec GetCoreDevice
readList :: ReadS [GetCoreDevice]
$creadList :: ReadS [GetCoreDevice]
readsPrec :: Int -> ReadS GetCoreDevice
$creadsPrec :: Int -> ReadS GetCoreDevice
Prelude.Read, Int -> GetCoreDevice -> ShowS
[GetCoreDevice] -> ShowS
GetCoreDevice -> String
(Int -> GetCoreDevice -> ShowS)
-> (GetCoreDevice -> String)
-> ([GetCoreDevice] -> ShowS)
-> Show GetCoreDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCoreDevice] -> ShowS
$cshowList :: [GetCoreDevice] -> ShowS
show :: GetCoreDevice -> String
$cshow :: GetCoreDevice -> String
showsPrec :: Int -> GetCoreDevice -> ShowS
$cshowsPrec :: Int -> GetCoreDevice -> ShowS
Prelude.Show, (forall x. GetCoreDevice -> Rep GetCoreDevice x)
-> (forall x. Rep GetCoreDevice x -> GetCoreDevice)
-> Generic GetCoreDevice
forall x. Rep GetCoreDevice x -> GetCoreDevice
forall x. GetCoreDevice -> Rep GetCoreDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCoreDevice x -> GetCoreDevice
$cfrom :: forall x. GetCoreDevice -> Rep GetCoreDevice x
Prelude.Generic)

-- |
-- Create a value of 'GetCoreDevice' 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:
--
-- 'coreDeviceThingName', 'getCoreDevice_coreDeviceThingName' - The name of the core device. This is also the name of the IoT thing.
newGetCoreDevice ::
  -- | 'coreDeviceThingName'
  Prelude.Text ->
  GetCoreDevice
newGetCoreDevice :: Text -> GetCoreDevice
newGetCoreDevice Text
pCoreDeviceThingName_ =
  GetCoreDevice' :: Text -> GetCoreDevice
GetCoreDevice'
    { $sel:coreDeviceThingName:GetCoreDevice' :: Text
coreDeviceThingName =
        Text
pCoreDeviceThingName_
    }

-- | The name of the core device. This is also the name of the IoT thing.
getCoreDevice_coreDeviceThingName :: Lens.Lens' GetCoreDevice Prelude.Text
getCoreDevice_coreDeviceThingName :: (Text -> f Text) -> GetCoreDevice -> f GetCoreDevice
getCoreDevice_coreDeviceThingName = (GetCoreDevice -> Text)
-> (GetCoreDevice -> Text -> GetCoreDevice)
-> Lens GetCoreDevice GetCoreDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDevice' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:GetCoreDevice' :: GetCoreDevice -> Text
coreDeviceThingName} -> Text
coreDeviceThingName) (\s :: GetCoreDevice
s@GetCoreDevice' {} Text
a -> GetCoreDevice
s {$sel:coreDeviceThingName:GetCoreDevice' :: Text
coreDeviceThingName = Text
a} :: GetCoreDevice)

instance Core.AWSRequest GetCoreDevice where
  type
    AWSResponse GetCoreDevice =
      GetCoreDeviceResponse
  request :: GetCoreDevice -> Request GetCoreDevice
request = Service -> GetCoreDevice -> Request GetCoreDevice
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetCoreDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetCoreDevice)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetCoreDevice))
-> Logger
-> Service
-> Proxy GetCoreDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetCoreDevice)))
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 CoreDeviceStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Int
-> GetCoreDeviceResponse
GetCoreDeviceResponse'
            (Maybe CoreDeviceStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> GetCoreDeviceResponse)
-> Either String (Maybe CoreDeviceStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetCoreDeviceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CoreDeviceStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetCoreDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetCoreDeviceResponse)
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
"platform")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetCoreDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetCoreDeviceResponse)
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
"architecture")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetCoreDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Text -> Maybe POSIX -> Int -> GetCoreDeviceResponse)
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
"coreDeviceThingName")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe Text -> Maybe POSIX -> Int -> GetCoreDeviceResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String (Maybe Text -> Maybe POSIX -> Int -> GetCoreDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Maybe POSIX -> Int -> GetCoreDeviceResponse)
-> Either String (Maybe Text)
-> Either String (Maybe POSIX -> Int -> GetCoreDeviceResponse)
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
"coreVersion")
            Either String (Maybe POSIX -> Int -> GetCoreDeviceResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> GetCoreDeviceResponse)
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
"lastStatusUpdateTimestamp")
            Either String (Int -> GetCoreDeviceResponse)
-> Either String Int -> Either String GetCoreDeviceResponse
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 GetCoreDevice

instance Prelude.NFData GetCoreDevice

instance Core.ToHeaders GetCoreDevice where
  toHeaders :: GetCoreDevice -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetCoreDevice -> 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.ToPath GetCoreDevice where
  toPath :: GetCoreDevice -> ByteString
toPath GetCoreDevice' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:GetCoreDevice' :: GetCoreDevice -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/coreDevices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
coreDeviceThingName
      ]

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

-- | /See:/ 'newGetCoreDeviceResponse' smart constructor.
data GetCoreDeviceResponse = GetCoreDeviceResponse'
  { -- | The status of the core device. The core device status can be:
    --
    -- -   @HEALTHY@ – The IoT Greengrass Core software and all components run
    --     on the core device without issue.
    --
    -- -   @UNHEALTHY@ – The IoT Greengrass Core software or a component is in
    --     a failed state on the core device.
    GetCoreDeviceResponse -> Maybe CoreDeviceStatus
status :: Prelude.Maybe CoreDeviceStatus,
    -- | The operating system platform that the core device runs.
    GetCoreDeviceResponse -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
    -- | The computer architecture of the core device.
    GetCoreDeviceResponse -> Maybe Text
architecture :: Prelude.Maybe Prelude.Text,
    -- | The name of the core device. This is also the name of the IoT thing.
    GetCoreDeviceResponse -> Maybe Text
coreDeviceThingName :: Prelude.Maybe Prelude.Text,
    -- | A list of key-value pairs that contain metadata for the resource. For
    -- more information, see
    -- <https://docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html Tag your resources>
    -- in the /IoT Greengrass V2 Developer Guide/.
    GetCoreDeviceResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The version of the IoT Greengrass Core software that the core device
    -- runs. This version is equivalent to the version of the Greengrass
    -- nucleus component that runs on the core device. For more information,
    -- see the
    -- <https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html Greengrass nucleus component>
    -- in the /IoT Greengrass V2 Developer Guide/.
    GetCoreDeviceResponse -> Maybe Text
coreVersion :: Prelude.Maybe Prelude.Text,
    -- | The time at which the core device\'s status last updated, expressed in
    -- ISO 8601 format.
    GetCoreDeviceResponse -> Maybe POSIX
lastStatusUpdateTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    GetCoreDeviceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCoreDeviceResponse -> GetCoreDeviceResponse -> Bool
(GetCoreDeviceResponse -> GetCoreDeviceResponse -> Bool)
-> (GetCoreDeviceResponse -> GetCoreDeviceResponse -> Bool)
-> Eq GetCoreDeviceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCoreDeviceResponse -> GetCoreDeviceResponse -> Bool
$c/= :: GetCoreDeviceResponse -> GetCoreDeviceResponse -> Bool
== :: GetCoreDeviceResponse -> GetCoreDeviceResponse -> Bool
$c== :: GetCoreDeviceResponse -> GetCoreDeviceResponse -> Bool
Prelude.Eq, ReadPrec [GetCoreDeviceResponse]
ReadPrec GetCoreDeviceResponse
Int -> ReadS GetCoreDeviceResponse
ReadS [GetCoreDeviceResponse]
(Int -> ReadS GetCoreDeviceResponse)
-> ReadS [GetCoreDeviceResponse]
-> ReadPrec GetCoreDeviceResponse
-> ReadPrec [GetCoreDeviceResponse]
-> Read GetCoreDeviceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCoreDeviceResponse]
$creadListPrec :: ReadPrec [GetCoreDeviceResponse]
readPrec :: ReadPrec GetCoreDeviceResponse
$creadPrec :: ReadPrec GetCoreDeviceResponse
readList :: ReadS [GetCoreDeviceResponse]
$creadList :: ReadS [GetCoreDeviceResponse]
readsPrec :: Int -> ReadS GetCoreDeviceResponse
$creadsPrec :: Int -> ReadS GetCoreDeviceResponse
Prelude.Read, Int -> GetCoreDeviceResponse -> ShowS
[GetCoreDeviceResponse] -> ShowS
GetCoreDeviceResponse -> String
(Int -> GetCoreDeviceResponse -> ShowS)
-> (GetCoreDeviceResponse -> String)
-> ([GetCoreDeviceResponse] -> ShowS)
-> Show GetCoreDeviceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCoreDeviceResponse] -> ShowS
$cshowList :: [GetCoreDeviceResponse] -> ShowS
show :: GetCoreDeviceResponse -> String
$cshow :: GetCoreDeviceResponse -> String
showsPrec :: Int -> GetCoreDeviceResponse -> ShowS
$cshowsPrec :: Int -> GetCoreDeviceResponse -> ShowS
Prelude.Show, (forall x. GetCoreDeviceResponse -> Rep GetCoreDeviceResponse x)
-> (forall x. Rep GetCoreDeviceResponse x -> GetCoreDeviceResponse)
-> Generic GetCoreDeviceResponse
forall x. Rep GetCoreDeviceResponse x -> GetCoreDeviceResponse
forall x. GetCoreDeviceResponse -> Rep GetCoreDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCoreDeviceResponse x -> GetCoreDeviceResponse
$cfrom :: forall x. GetCoreDeviceResponse -> Rep GetCoreDeviceResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCoreDeviceResponse' 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', 'getCoreDeviceResponse_status' - The status of the core device. The core device status can be:
--
-- -   @HEALTHY@ – The IoT Greengrass Core software and all components run
--     on the core device without issue.
--
-- -   @UNHEALTHY@ – The IoT Greengrass Core software or a component is in
--     a failed state on the core device.
--
-- 'platform', 'getCoreDeviceResponse_platform' - The operating system platform that the core device runs.
--
-- 'architecture', 'getCoreDeviceResponse_architecture' - The computer architecture of the core device.
--
-- 'coreDeviceThingName', 'getCoreDeviceResponse_coreDeviceThingName' - The name of the core device. This is also the name of the IoT thing.
--
-- 'tags', 'getCoreDeviceResponse_tags' - A list of key-value pairs that contain metadata for the resource. For
-- more information, see
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html Tag your resources>
-- in the /IoT Greengrass V2 Developer Guide/.
--
-- 'coreVersion', 'getCoreDeviceResponse_coreVersion' - The version of the IoT Greengrass Core software that the core device
-- runs. This version is equivalent to the version of the Greengrass
-- nucleus component that runs on the core device. For more information,
-- see the
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html Greengrass nucleus component>
-- in the /IoT Greengrass V2 Developer Guide/.
--
-- 'lastStatusUpdateTimestamp', 'getCoreDeviceResponse_lastStatusUpdateTimestamp' - The time at which the core device\'s status last updated, expressed in
-- ISO 8601 format.
--
-- 'httpStatus', 'getCoreDeviceResponse_httpStatus' - The response's http status code.
newGetCoreDeviceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCoreDeviceResponse
newGetCoreDeviceResponse :: Int -> GetCoreDeviceResponse
newGetCoreDeviceResponse Int
pHttpStatus_ =
  GetCoreDeviceResponse' :: Maybe CoreDeviceStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Int
-> GetCoreDeviceResponse
GetCoreDeviceResponse'
    { $sel:status:GetCoreDeviceResponse' :: Maybe CoreDeviceStatus
status = Maybe CoreDeviceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:platform:GetCoreDeviceResponse' :: Maybe Text
platform = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:architecture:GetCoreDeviceResponse' :: Maybe Text
architecture = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:coreDeviceThingName:GetCoreDeviceResponse' :: Maybe Text
coreDeviceThingName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GetCoreDeviceResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:coreVersion:GetCoreDeviceResponse' :: Maybe Text
coreVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastStatusUpdateTimestamp:GetCoreDeviceResponse' :: Maybe POSIX
lastStatusUpdateTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCoreDeviceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the core device. The core device status can be:
--
-- -   @HEALTHY@ – The IoT Greengrass Core software and all components run
--     on the core device without issue.
--
-- -   @UNHEALTHY@ – The IoT Greengrass Core software or a component is in
--     a failed state on the core device.
getCoreDeviceResponse_status :: Lens.Lens' GetCoreDeviceResponse (Prelude.Maybe CoreDeviceStatus)
getCoreDeviceResponse_status :: (Maybe CoreDeviceStatus -> f (Maybe CoreDeviceStatus))
-> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_status = (GetCoreDeviceResponse -> Maybe CoreDeviceStatus)
-> (GetCoreDeviceResponse
    -> Maybe CoreDeviceStatus -> GetCoreDeviceResponse)
-> Lens
     GetCoreDeviceResponse
     GetCoreDeviceResponse
     (Maybe CoreDeviceStatus)
     (Maybe CoreDeviceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Maybe CoreDeviceStatus
status :: Maybe CoreDeviceStatus
$sel:status:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Maybe CoreDeviceStatus
status} -> Maybe CoreDeviceStatus
status) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Maybe CoreDeviceStatus
a -> GetCoreDeviceResponse
s {$sel:status:GetCoreDeviceResponse' :: Maybe CoreDeviceStatus
status = Maybe CoreDeviceStatus
a} :: GetCoreDeviceResponse)

-- | The operating system platform that the core device runs.
getCoreDeviceResponse_platform :: Lens.Lens' GetCoreDeviceResponse (Prelude.Maybe Prelude.Text)
getCoreDeviceResponse_platform :: (Maybe Text -> f (Maybe Text))
-> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_platform = (GetCoreDeviceResponse -> Maybe Text)
-> (GetCoreDeviceResponse -> Maybe Text -> GetCoreDeviceResponse)
-> Lens
     GetCoreDeviceResponse
     GetCoreDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Maybe Text
platform :: Maybe Text
$sel:platform:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Maybe Text
platform} -> Maybe Text
platform) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Maybe Text
a -> GetCoreDeviceResponse
s {$sel:platform:GetCoreDeviceResponse' :: Maybe Text
platform = Maybe Text
a} :: GetCoreDeviceResponse)

-- | The computer architecture of the core device.
getCoreDeviceResponse_architecture :: Lens.Lens' GetCoreDeviceResponse (Prelude.Maybe Prelude.Text)
getCoreDeviceResponse_architecture :: (Maybe Text -> f (Maybe Text))
-> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_architecture = (GetCoreDeviceResponse -> Maybe Text)
-> (GetCoreDeviceResponse -> Maybe Text -> GetCoreDeviceResponse)
-> Lens
     GetCoreDeviceResponse
     GetCoreDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Maybe Text
architecture :: Maybe Text
$sel:architecture:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Maybe Text
architecture} -> Maybe Text
architecture) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Maybe Text
a -> GetCoreDeviceResponse
s {$sel:architecture:GetCoreDeviceResponse' :: Maybe Text
architecture = Maybe Text
a} :: GetCoreDeviceResponse)

-- | The name of the core device. This is also the name of the IoT thing.
getCoreDeviceResponse_coreDeviceThingName :: Lens.Lens' GetCoreDeviceResponse (Prelude.Maybe Prelude.Text)
getCoreDeviceResponse_coreDeviceThingName :: (Maybe Text -> f (Maybe Text))
-> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_coreDeviceThingName = (GetCoreDeviceResponse -> Maybe Text)
-> (GetCoreDeviceResponse -> Maybe Text -> GetCoreDeviceResponse)
-> Lens
     GetCoreDeviceResponse
     GetCoreDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Maybe Text
coreDeviceThingName :: Maybe Text
$sel:coreDeviceThingName:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Maybe Text
coreDeviceThingName} -> Maybe Text
coreDeviceThingName) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Maybe Text
a -> GetCoreDeviceResponse
s {$sel:coreDeviceThingName:GetCoreDeviceResponse' :: Maybe Text
coreDeviceThingName = Maybe Text
a} :: GetCoreDeviceResponse)

-- | A list of key-value pairs that contain metadata for the resource. For
-- more information, see
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html Tag your resources>
-- in the /IoT Greengrass V2 Developer Guide/.
getCoreDeviceResponse_tags :: Lens.Lens' GetCoreDeviceResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getCoreDeviceResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_tags = (GetCoreDeviceResponse -> Maybe (HashMap Text Text))
-> (GetCoreDeviceResponse
    -> Maybe (HashMap Text Text) -> GetCoreDeviceResponse)
-> Lens
     GetCoreDeviceResponse
     GetCoreDeviceResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Maybe (HashMap Text Text)
a -> GetCoreDeviceResponse
s {$sel:tags:GetCoreDeviceResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetCoreDeviceResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetCoreDeviceResponse -> f GetCoreDeviceResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetCoreDeviceResponse
-> f GetCoreDeviceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The version of the IoT Greengrass Core software that the core device
-- runs. This version is equivalent to the version of the Greengrass
-- nucleus component that runs on the core device. For more information,
-- see the
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html Greengrass nucleus component>
-- in the /IoT Greengrass V2 Developer Guide/.
getCoreDeviceResponse_coreVersion :: Lens.Lens' GetCoreDeviceResponse (Prelude.Maybe Prelude.Text)
getCoreDeviceResponse_coreVersion :: (Maybe Text -> f (Maybe Text))
-> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_coreVersion = (GetCoreDeviceResponse -> Maybe Text)
-> (GetCoreDeviceResponse -> Maybe Text -> GetCoreDeviceResponse)
-> Lens
     GetCoreDeviceResponse
     GetCoreDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Maybe Text
coreVersion :: Maybe Text
$sel:coreVersion:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Maybe Text
coreVersion} -> Maybe Text
coreVersion) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Maybe Text
a -> GetCoreDeviceResponse
s {$sel:coreVersion:GetCoreDeviceResponse' :: Maybe Text
coreVersion = Maybe Text
a} :: GetCoreDeviceResponse)

-- | The time at which the core device\'s status last updated, expressed in
-- ISO 8601 format.
getCoreDeviceResponse_lastStatusUpdateTimestamp :: Lens.Lens' GetCoreDeviceResponse (Prelude.Maybe Prelude.UTCTime)
getCoreDeviceResponse_lastStatusUpdateTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_lastStatusUpdateTimestamp = (GetCoreDeviceResponse -> Maybe POSIX)
-> (GetCoreDeviceResponse -> Maybe POSIX -> GetCoreDeviceResponse)
-> Lens
     GetCoreDeviceResponse
     GetCoreDeviceResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Maybe POSIX
lastStatusUpdateTimestamp :: Maybe POSIX
$sel:lastStatusUpdateTimestamp:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Maybe POSIX
lastStatusUpdateTimestamp} -> Maybe POSIX
lastStatusUpdateTimestamp) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Maybe POSIX
a -> GetCoreDeviceResponse
s {$sel:lastStatusUpdateTimestamp:GetCoreDeviceResponse' :: Maybe POSIX
lastStatusUpdateTimestamp = Maybe POSIX
a} :: GetCoreDeviceResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetCoreDeviceResponse -> f GetCoreDeviceResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetCoreDeviceResponse
-> f GetCoreDeviceResponse
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 response's http status code.
getCoreDeviceResponse_httpStatus :: Lens.Lens' GetCoreDeviceResponse Prelude.Int
getCoreDeviceResponse_httpStatus :: (Int -> f Int) -> GetCoreDeviceResponse -> f GetCoreDeviceResponse
getCoreDeviceResponse_httpStatus = (GetCoreDeviceResponse -> Int)
-> (GetCoreDeviceResponse -> Int -> GetCoreDeviceResponse)
-> Lens GetCoreDeviceResponse GetCoreDeviceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoreDeviceResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCoreDeviceResponse' :: GetCoreDeviceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCoreDeviceResponse
s@GetCoreDeviceResponse' {} Int
a -> GetCoreDeviceResponse
s {$sel:httpStatus:GetCoreDeviceResponse' :: Int
httpStatus = Int
a} :: GetCoreDeviceResponse)

instance Prelude.NFData GetCoreDeviceResponse