{-# 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.Greengrass.GetDeviceDefinitionVersion
-- 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 information about a device definition version.
module Amazonka.Greengrass.GetDeviceDefinitionVersion
  ( -- * Creating a Request
    GetDeviceDefinitionVersion (..),
    newGetDeviceDefinitionVersion,

    -- * Request Lenses
    getDeviceDefinitionVersion_nextToken,
    getDeviceDefinitionVersion_deviceDefinitionVersionId,
    getDeviceDefinitionVersion_deviceDefinitionId,

    -- * Destructuring the Response
    GetDeviceDefinitionVersionResponse (..),
    newGetDeviceDefinitionVersionResponse,

    -- * Response Lenses
    getDeviceDefinitionVersionResponse_definition,
    getDeviceDefinitionVersionResponse_arn,
    getDeviceDefinitionVersionResponse_nextToken,
    getDeviceDefinitionVersionResponse_creationTimestamp,
    getDeviceDefinitionVersionResponse_version,
    getDeviceDefinitionVersionResponse_id,
    getDeviceDefinitionVersionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.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:/ 'newGetDeviceDefinitionVersion' smart constructor.
data GetDeviceDefinitionVersion = GetDeviceDefinitionVersion'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    GetDeviceDefinitionVersion -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the device definition version. This value maps to the
    -- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
    -- object, which is returned by \'\'ListDeviceDefinitionVersions\'\'
    -- requests. If the version is the last one that was associated with a
    -- device definition, the value also maps to the \'\'LatestVersion\'\'
    -- property of the corresponding \'\'DefinitionInformation\'\' object.
    GetDeviceDefinitionVersion -> Text
deviceDefinitionVersionId :: Prelude.Text,
    -- | The ID of the device definition.
    GetDeviceDefinitionVersion -> Text
deviceDefinitionId :: Prelude.Text
  }
  deriving (GetDeviceDefinitionVersion -> GetDeviceDefinitionVersion -> Bool
(GetDeviceDefinitionVersion -> GetDeviceDefinitionVersion -> Bool)
-> (GetDeviceDefinitionVersion
    -> GetDeviceDefinitionVersion -> Bool)
-> Eq GetDeviceDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeviceDefinitionVersion -> GetDeviceDefinitionVersion -> Bool
$c/= :: GetDeviceDefinitionVersion -> GetDeviceDefinitionVersion -> Bool
== :: GetDeviceDefinitionVersion -> GetDeviceDefinitionVersion -> Bool
$c== :: GetDeviceDefinitionVersion -> GetDeviceDefinitionVersion -> Bool
Prelude.Eq, ReadPrec [GetDeviceDefinitionVersion]
ReadPrec GetDeviceDefinitionVersion
Int -> ReadS GetDeviceDefinitionVersion
ReadS [GetDeviceDefinitionVersion]
(Int -> ReadS GetDeviceDefinitionVersion)
-> ReadS [GetDeviceDefinitionVersion]
-> ReadPrec GetDeviceDefinitionVersion
-> ReadPrec [GetDeviceDefinitionVersion]
-> Read GetDeviceDefinitionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeviceDefinitionVersion]
$creadListPrec :: ReadPrec [GetDeviceDefinitionVersion]
readPrec :: ReadPrec GetDeviceDefinitionVersion
$creadPrec :: ReadPrec GetDeviceDefinitionVersion
readList :: ReadS [GetDeviceDefinitionVersion]
$creadList :: ReadS [GetDeviceDefinitionVersion]
readsPrec :: Int -> ReadS GetDeviceDefinitionVersion
$creadsPrec :: Int -> ReadS GetDeviceDefinitionVersion
Prelude.Read, Int -> GetDeviceDefinitionVersion -> ShowS
[GetDeviceDefinitionVersion] -> ShowS
GetDeviceDefinitionVersion -> String
(Int -> GetDeviceDefinitionVersion -> ShowS)
-> (GetDeviceDefinitionVersion -> String)
-> ([GetDeviceDefinitionVersion] -> ShowS)
-> Show GetDeviceDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeviceDefinitionVersion] -> ShowS
$cshowList :: [GetDeviceDefinitionVersion] -> ShowS
show :: GetDeviceDefinitionVersion -> String
$cshow :: GetDeviceDefinitionVersion -> String
showsPrec :: Int -> GetDeviceDefinitionVersion -> ShowS
$cshowsPrec :: Int -> GetDeviceDefinitionVersion -> ShowS
Prelude.Show, (forall x.
 GetDeviceDefinitionVersion -> Rep GetDeviceDefinitionVersion x)
-> (forall x.
    Rep GetDeviceDefinitionVersion x -> GetDeviceDefinitionVersion)
-> Generic GetDeviceDefinitionVersion
forall x.
Rep GetDeviceDefinitionVersion x -> GetDeviceDefinitionVersion
forall x.
GetDeviceDefinitionVersion -> Rep GetDeviceDefinitionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDeviceDefinitionVersion x -> GetDeviceDefinitionVersion
$cfrom :: forall x.
GetDeviceDefinitionVersion -> Rep GetDeviceDefinitionVersion x
Prelude.Generic)

-- |
-- Create a value of 'GetDeviceDefinitionVersion' 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', 'getDeviceDefinitionVersion_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'deviceDefinitionVersionId', 'getDeviceDefinitionVersion_deviceDefinitionVersionId' - The ID of the device definition version. This value maps to the
-- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
-- object, which is returned by \'\'ListDeviceDefinitionVersions\'\'
-- requests. If the version is the last one that was associated with a
-- device definition, the value also maps to the \'\'LatestVersion\'\'
-- property of the corresponding \'\'DefinitionInformation\'\' object.
--
-- 'deviceDefinitionId', 'getDeviceDefinitionVersion_deviceDefinitionId' - The ID of the device definition.
newGetDeviceDefinitionVersion ::
  -- | 'deviceDefinitionVersionId'
  Prelude.Text ->
  -- | 'deviceDefinitionId'
  Prelude.Text ->
  GetDeviceDefinitionVersion
newGetDeviceDefinitionVersion :: Text -> Text -> GetDeviceDefinitionVersion
newGetDeviceDefinitionVersion
  Text
pDeviceDefinitionVersionId_
  Text
pDeviceDefinitionId_ =
    GetDeviceDefinitionVersion' :: Maybe Text -> Text -> Text -> GetDeviceDefinitionVersion
GetDeviceDefinitionVersion'
      { $sel:nextToken:GetDeviceDefinitionVersion' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:deviceDefinitionVersionId:GetDeviceDefinitionVersion' :: Text
deviceDefinitionVersionId =
          Text
pDeviceDefinitionVersionId_,
        $sel:deviceDefinitionId:GetDeviceDefinitionVersion' :: Text
deviceDefinitionId = Text
pDeviceDefinitionId_
      }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
getDeviceDefinitionVersion_nextToken :: Lens.Lens' GetDeviceDefinitionVersion (Prelude.Maybe Prelude.Text)
getDeviceDefinitionVersion_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetDeviceDefinitionVersion -> f GetDeviceDefinitionVersion
getDeviceDefinitionVersion_nextToken = (GetDeviceDefinitionVersion -> Maybe Text)
-> (GetDeviceDefinitionVersion
    -> Maybe Text -> GetDeviceDefinitionVersion)
-> Lens
     GetDeviceDefinitionVersion
     GetDeviceDefinitionVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersion' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetDeviceDefinitionVersion
s@GetDeviceDefinitionVersion' {} Maybe Text
a -> GetDeviceDefinitionVersion
s {$sel:nextToken:GetDeviceDefinitionVersion' :: Maybe Text
nextToken = Maybe Text
a} :: GetDeviceDefinitionVersion)

-- | The ID of the device definition version. This value maps to the
-- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
-- object, which is returned by \'\'ListDeviceDefinitionVersions\'\'
-- requests. If the version is the last one that was associated with a
-- device definition, the value also maps to the \'\'LatestVersion\'\'
-- property of the corresponding \'\'DefinitionInformation\'\' object.
getDeviceDefinitionVersion_deviceDefinitionVersionId :: Lens.Lens' GetDeviceDefinitionVersion Prelude.Text
getDeviceDefinitionVersion_deviceDefinitionVersionId :: (Text -> f Text)
-> GetDeviceDefinitionVersion -> f GetDeviceDefinitionVersion
getDeviceDefinitionVersion_deviceDefinitionVersionId = (GetDeviceDefinitionVersion -> Text)
-> (GetDeviceDefinitionVersion
    -> Text -> GetDeviceDefinitionVersion)
-> Lens
     GetDeviceDefinitionVersion GetDeviceDefinitionVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersion' {Text
deviceDefinitionVersionId :: Text
$sel:deviceDefinitionVersionId:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Text
deviceDefinitionVersionId} -> Text
deviceDefinitionVersionId) (\s :: GetDeviceDefinitionVersion
s@GetDeviceDefinitionVersion' {} Text
a -> GetDeviceDefinitionVersion
s {$sel:deviceDefinitionVersionId:GetDeviceDefinitionVersion' :: Text
deviceDefinitionVersionId = Text
a} :: GetDeviceDefinitionVersion)

-- | The ID of the device definition.
getDeviceDefinitionVersion_deviceDefinitionId :: Lens.Lens' GetDeviceDefinitionVersion Prelude.Text
getDeviceDefinitionVersion_deviceDefinitionId :: (Text -> f Text)
-> GetDeviceDefinitionVersion -> f GetDeviceDefinitionVersion
getDeviceDefinitionVersion_deviceDefinitionId = (GetDeviceDefinitionVersion -> Text)
-> (GetDeviceDefinitionVersion
    -> Text -> GetDeviceDefinitionVersion)
-> Lens
     GetDeviceDefinitionVersion GetDeviceDefinitionVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersion' {Text
deviceDefinitionId :: Text
$sel:deviceDefinitionId:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Text
deviceDefinitionId} -> Text
deviceDefinitionId) (\s :: GetDeviceDefinitionVersion
s@GetDeviceDefinitionVersion' {} Text
a -> GetDeviceDefinitionVersion
s {$sel:deviceDefinitionId:GetDeviceDefinitionVersion' :: Text
deviceDefinitionId = Text
a} :: GetDeviceDefinitionVersion)

instance Core.AWSRequest GetDeviceDefinitionVersion where
  type
    AWSResponse GetDeviceDefinitionVersion =
      GetDeviceDefinitionVersionResponse
  request :: GetDeviceDefinitionVersion -> Request GetDeviceDefinitionVersion
request = Service
-> GetDeviceDefinitionVersion -> Request GetDeviceDefinitionVersion
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDeviceDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDeviceDefinitionVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetDeviceDefinitionVersion))
-> Logger
-> Service
-> Proxy GetDeviceDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDeviceDefinitionVersion)))
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 DeviceDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeviceDefinitionVersionResponse
GetDeviceDefinitionVersionResponse'
            (Maybe DeviceDefinitionVersion
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetDeviceDefinitionVersionResponse)
-> Either String (Maybe DeviceDefinitionVersion)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetDeviceDefinitionVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DeviceDefinitionVersion)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Definition")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetDeviceDefinitionVersionResponse)
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
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetDeviceDefinitionVersionResponse)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> GetDeviceDefinitionVersionResponse)
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
"CreationTimestamp")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> GetDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> GetDeviceDefinitionVersionResponse)
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
"Version")
            Either
  String (Maybe Text -> Int -> GetDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetDeviceDefinitionVersionResponse)
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
"Id")
            Either String (Int -> GetDeviceDefinitionVersionResponse)
-> Either String Int
-> Either String GetDeviceDefinitionVersionResponse
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 GetDeviceDefinitionVersion

instance Prelude.NFData GetDeviceDefinitionVersion

instance Core.ToHeaders GetDeviceDefinitionVersion where
  toHeaders :: GetDeviceDefinitionVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetDeviceDefinitionVersion -> 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 GetDeviceDefinitionVersion where
  toPath :: GetDeviceDefinitionVersion -> ByteString
toPath GetDeviceDefinitionVersion' {Maybe Text
Text
deviceDefinitionId :: Text
deviceDefinitionVersionId :: Text
nextToken :: Maybe Text
$sel:deviceDefinitionId:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Text
$sel:deviceDefinitionVersionId:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Text
$sel:nextToken:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/devices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deviceDefinitionId,
        ByteString
"/versions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deviceDefinitionVersionId
      ]

instance Core.ToQuery GetDeviceDefinitionVersion where
  toQuery :: GetDeviceDefinitionVersion -> QueryString
toQuery GetDeviceDefinitionVersion' {Maybe Text
Text
deviceDefinitionId :: Text
deviceDefinitionVersionId :: Text
nextToken :: Maybe Text
$sel:deviceDefinitionId:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Text
$sel:deviceDefinitionVersionId:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Text
$sel:nextToken:GetDeviceDefinitionVersion' :: GetDeviceDefinitionVersion -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken]

-- | /See:/ 'newGetDeviceDefinitionVersionResponse' smart constructor.
data GetDeviceDefinitionVersionResponse = GetDeviceDefinitionVersionResponse'
  { -- | Information about the device definition version.
    GetDeviceDefinitionVersionResponse -> Maybe DeviceDefinitionVersion
definition :: Prelude.Maybe DeviceDefinitionVersion,
    -- | The ARN of the device definition version.
    GetDeviceDefinitionVersionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    GetDeviceDefinitionVersionResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the device definition
    -- version was created.
    GetDeviceDefinitionVersionResponse -> Maybe Text
creationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The version of the device definition version.
    GetDeviceDefinitionVersionResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The ID of the device definition version.
    GetDeviceDefinitionVersionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetDeviceDefinitionVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDeviceDefinitionVersionResponse
-> GetDeviceDefinitionVersionResponse -> Bool
(GetDeviceDefinitionVersionResponse
 -> GetDeviceDefinitionVersionResponse -> Bool)
-> (GetDeviceDefinitionVersionResponse
    -> GetDeviceDefinitionVersionResponse -> Bool)
-> Eq GetDeviceDefinitionVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeviceDefinitionVersionResponse
-> GetDeviceDefinitionVersionResponse -> Bool
$c/= :: GetDeviceDefinitionVersionResponse
-> GetDeviceDefinitionVersionResponse -> Bool
== :: GetDeviceDefinitionVersionResponse
-> GetDeviceDefinitionVersionResponse -> Bool
$c== :: GetDeviceDefinitionVersionResponse
-> GetDeviceDefinitionVersionResponse -> Bool
Prelude.Eq, ReadPrec [GetDeviceDefinitionVersionResponse]
ReadPrec GetDeviceDefinitionVersionResponse
Int -> ReadS GetDeviceDefinitionVersionResponse
ReadS [GetDeviceDefinitionVersionResponse]
(Int -> ReadS GetDeviceDefinitionVersionResponse)
-> ReadS [GetDeviceDefinitionVersionResponse]
-> ReadPrec GetDeviceDefinitionVersionResponse
-> ReadPrec [GetDeviceDefinitionVersionResponse]
-> Read GetDeviceDefinitionVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeviceDefinitionVersionResponse]
$creadListPrec :: ReadPrec [GetDeviceDefinitionVersionResponse]
readPrec :: ReadPrec GetDeviceDefinitionVersionResponse
$creadPrec :: ReadPrec GetDeviceDefinitionVersionResponse
readList :: ReadS [GetDeviceDefinitionVersionResponse]
$creadList :: ReadS [GetDeviceDefinitionVersionResponse]
readsPrec :: Int -> ReadS GetDeviceDefinitionVersionResponse
$creadsPrec :: Int -> ReadS GetDeviceDefinitionVersionResponse
Prelude.Read, Int -> GetDeviceDefinitionVersionResponse -> ShowS
[GetDeviceDefinitionVersionResponse] -> ShowS
GetDeviceDefinitionVersionResponse -> String
(Int -> GetDeviceDefinitionVersionResponse -> ShowS)
-> (GetDeviceDefinitionVersionResponse -> String)
-> ([GetDeviceDefinitionVersionResponse] -> ShowS)
-> Show GetDeviceDefinitionVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeviceDefinitionVersionResponse] -> ShowS
$cshowList :: [GetDeviceDefinitionVersionResponse] -> ShowS
show :: GetDeviceDefinitionVersionResponse -> String
$cshow :: GetDeviceDefinitionVersionResponse -> String
showsPrec :: Int -> GetDeviceDefinitionVersionResponse -> ShowS
$cshowsPrec :: Int -> GetDeviceDefinitionVersionResponse -> ShowS
Prelude.Show, (forall x.
 GetDeviceDefinitionVersionResponse
 -> Rep GetDeviceDefinitionVersionResponse x)
-> (forall x.
    Rep GetDeviceDefinitionVersionResponse x
    -> GetDeviceDefinitionVersionResponse)
-> Generic GetDeviceDefinitionVersionResponse
forall x.
Rep GetDeviceDefinitionVersionResponse x
-> GetDeviceDefinitionVersionResponse
forall x.
GetDeviceDefinitionVersionResponse
-> Rep GetDeviceDefinitionVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDeviceDefinitionVersionResponse x
-> GetDeviceDefinitionVersionResponse
$cfrom :: forall x.
GetDeviceDefinitionVersionResponse
-> Rep GetDeviceDefinitionVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDeviceDefinitionVersionResponse' 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:
--
-- 'definition', 'getDeviceDefinitionVersionResponse_definition' - Information about the device definition version.
--
-- 'arn', 'getDeviceDefinitionVersionResponse_arn' - The ARN of the device definition version.
--
-- 'nextToken', 'getDeviceDefinitionVersionResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'creationTimestamp', 'getDeviceDefinitionVersionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the device definition
-- version was created.
--
-- 'version', 'getDeviceDefinitionVersionResponse_version' - The version of the device definition version.
--
-- 'id', 'getDeviceDefinitionVersionResponse_id' - The ID of the device definition version.
--
-- 'httpStatus', 'getDeviceDefinitionVersionResponse_httpStatus' - The response's http status code.
newGetDeviceDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDeviceDefinitionVersionResponse
newGetDeviceDefinitionVersionResponse :: Int -> GetDeviceDefinitionVersionResponse
newGetDeviceDefinitionVersionResponse Int
pHttpStatus_ =
  GetDeviceDefinitionVersionResponse' :: Maybe DeviceDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeviceDefinitionVersionResponse
GetDeviceDefinitionVersionResponse'
    { $sel:definition:GetDeviceDefinitionVersionResponse' :: Maybe DeviceDefinitionVersion
definition =
        Maybe DeviceDefinitionVersion
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetDeviceDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetDeviceDefinitionVersionResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetDeviceDefinitionVersionResponse' :: Maybe Text
creationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:GetDeviceDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetDeviceDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDeviceDefinitionVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the device definition version.
getDeviceDefinitionVersionResponse_definition :: Lens.Lens' GetDeviceDefinitionVersionResponse (Prelude.Maybe DeviceDefinitionVersion)
getDeviceDefinitionVersionResponse_definition :: (Maybe DeviceDefinitionVersion
 -> f (Maybe DeviceDefinitionVersion))
-> GetDeviceDefinitionVersionResponse
-> f GetDeviceDefinitionVersionResponse
getDeviceDefinitionVersionResponse_definition = (GetDeviceDefinitionVersionResponse
 -> Maybe DeviceDefinitionVersion)
-> (GetDeviceDefinitionVersionResponse
    -> Maybe DeviceDefinitionVersion
    -> GetDeviceDefinitionVersionResponse)
-> Lens
     GetDeviceDefinitionVersionResponse
     GetDeviceDefinitionVersionResponse
     (Maybe DeviceDefinitionVersion)
     (Maybe DeviceDefinitionVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersionResponse' {Maybe DeviceDefinitionVersion
definition :: Maybe DeviceDefinitionVersion
$sel:definition:GetDeviceDefinitionVersionResponse' :: GetDeviceDefinitionVersionResponse -> Maybe DeviceDefinitionVersion
definition} -> Maybe DeviceDefinitionVersion
definition) (\s :: GetDeviceDefinitionVersionResponse
s@GetDeviceDefinitionVersionResponse' {} Maybe DeviceDefinitionVersion
a -> GetDeviceDefinitionVersionResponse
s {$sel:definition:GetDeviceDefinitionVersionResponse' :: Maybe DeviceDefinitionVersion
definition = Maybe DeviceDefinitionVersion
a} :: GetDeviceDefinitionVersionResponse)

-- | The ARN of the device definition version.
getDeviceDefinitionVersionResponse_arn :: Lens.Lens' GetDeviceDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
getDeviceDefinitionVersionResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetDeviceDefinitionVersionResponse
-> f GetDeviceDefinitionVersionResponse
getDeviceDefinitionVersionResponse_arn = (GetDeviceDefinitionVersionResponse -> Maybe Text)
-> (GetDeviceDefinitionVersionResponse
    -> Maybe Text -> GetDeviceDefinitionVersionResponse)
-> Lens
     GetDeviceDefinitionVersionResponse
     GetDeviceDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersionResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetDeviceDefinitionVersionResponse' :: GetDeviceDefinitionVersionResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetDeviceDefinitionVersionResponse
s@GetDeviceDefinitionVersionResponse' {} Maybe Text
a -> GetDeviceDefinitionVersionResponse
s {$sel:arn:GetDeviceDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
a} :: GetDeviceDefinitionVersionResponse)

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
getDeviceDefinitionVersionResponse_nextToken :: Lens.Lens' GetDeviceDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
getDeviceDefinitionVersionResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetDeviceDefinitionVersionResponse
-> f GetDeviceDefinitionVersionResponse
getDeviceDefinitionVersionResponse_nextToken = (GetDeviceDefinitionVersionResponse -> Maybe Text)
-> (GetDeviceDefinitionVersionResponse
    -> Maybe Text -> GetDeviceDefinitionVersionResponse)
-> Lens
     GetDeviceDefinitionVersionResponse
     GetDeviceDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersionResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetDeviceDefinitionVersionResponse' :: GetDeviceDefinitionVersionResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetDeviceDefinitionVersionResponse
s@GetDeviceDefinitionVersionResponse' {} Maybe Text
a -> GetDeviceDefinitionVersionResponse
s {$sel:nextToken:GetDeviceDefinitionVersionResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetDeviceDefinitionVersionResponse)

-- | The time, in milliseconds since the epoch, when the device definition
-- version was created.
getDeviceDefinitionVersionResponse_creationTimestamp :: Lens.Lens' GetDeviceDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
getDeviceDefinitionVersionResponse_creationTimestamp :: (Maybe Text -> f (Maybe Text))
-> GetDeviceDefinitionVersionResponse
-> f GetDeviceDefinitionVersionResponse
getDeviceDefinitionVersionResponse_creationTimestamp = (GetDeviceDefinitionVersionResponse -> Maybe Text)
-> (GetDeviceDefinitionVersionResponse
    -> Maybe Text -> GetDeviceDefinitionVersionResponse)
-> Lens
     GetDeviceDefinitionVersionResponse
     GetDeviceDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersionResponse' {Maybe Text
creationTimestamp :: Maybe Text
$sel:creationTimestamp:GetDeviceDefinitionVersionResponse' :: GetDeviceDefinitionVersionResponse -> Maybe Text
creationTimestamp} -> Maybe Text
creationTimestamp) (\s :: GetDeviceDefinitionVersionResponse
s@GetDeviceDefinitionVersionResponse' {} Maybe Text
a -> GetDeviceDefinitionVersionResponse
s {$sel:creationTimestamp:GetDeviceDefinitionVersionResponse' :: Maybe Text
creationTimestamp = Maybe Text
a} :: GetDeviceDefinitionVersionResponse)

-- | The version of the device definition version.
getDeviceDefinitionVersionResponse_version :: Lens.Lens' GetDeviceDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
getDeviceDefinitionVersionResponse_version :: (Maybe Text -> f (Maybe Text))
-> GetDeviceDefinitionVersionResponse
-> f GetDeviceDefinitionVersionResponse
getDeviceDefinitionVersionResponse_version = (GetDeviceDefinitionVersionResponse -> Maybe Text)
-> (GetDeviceDefinitionVersionResponse
    -> Maybe Text -> GetDeviceDefinitionVersionResponse)
-> Lens
     GetDeviceDefinitionVersionResponse
     GetDeviceDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersionResponse' {Maybe Text
version :: Maybe Text
$sel:version:GetDeviceDefinitionVersionResponse' :: GetDeviceDefinitionVersionResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: GetDeviceDefinitionVersionResponse
s@GetDeviceDefinitionVersionResponse' {} Maybe Text
a -> GetDeviceDefinitionVersionResponse
s {$sel:version:GetDeviceDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
a} :: GetDeviceDefinitionVersionResponse)

-- | The ID of the device definition version.
getDeviceDefinitionVersionResponse_id :: Lens.Lens' GetDeviceDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
getDeviceDefinitionVersionResponse_id :: (Maybe Text -> f (Maybe Text))
-> GetDeviceDefinitionVersionResponse
-> f GetDeviceDefinitionVersionResponse
getDeviceDefinitionVersionResponse_id = (GetDeviceDefinitionVersionResponse -> Maybe Text)
-> (GetDeviceDefinitionVersionResponse
    -> Maybe Text -> GetDeviceDefinitionVersionResponse)
-> Lens
     GetDeviceDefinitionVersionResponse
     GetDeviceDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceDefinitionVersionResponse' {Maybe Text
id :: Maybe Text
$sel:id:GetDeviceDefinitionVersionResponse' :: GetDeviceDefinitionVersionResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: GetDeviceDefinitionVersionResponse
s@GetDeviceDefinitionVersionResponse' {} Maybe Text
a -> GetDeviceDefinitionVersionResponse
s {$sel:id:GetDeviceDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
a} :: GetDeviceDefinitionVersionResponse)

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

instance
  Prelude.NFData
    GetDeviceDefinitionVersionResponse