{-# 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.CreateDeviceDefinitionVersion
-- 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)
--
-- Creates a version of a device definition that has already been defined.
module Amazonka.Greengrass.CreateDeviceDefinitionVersion
  ( -- * Creating a Request
    CreateDeviceDefinitionVersion (..),
    newCreateDeviceDefinitionVersion,

    -- * Request Lenses
    createDeviceDefinitionVersion_amznClientToken,
    createDeviceDefinitionVersion_devices,
    createDeviceDefinitionVersion_deviceDefinitionId,

    -- * Destructuring the Response
    CreateDeviceDefinitionVersionResponse (..),
    newCreateDeviceDefinitionVersionResponse,

    -- * Response Lenses
    createDeviceDefinitionVersionResponse_arn,
    createDeviceDefinitionVersionResponse_creationTimestamp,
    createDeviceDefinitionVersionResponse_version,
    createDeviceDefinitionVersionResponse_id,
    createDeviceDefinitionVersionResponse_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:/ 'newCreateDeviceDefinitionVersion' smart constructor.
data CreateDeviceDefinitionVersion = CreateDeviceDefinitionVersion'
  { -- | A client token used to correlate requests and responses.
    CreateDeviceDefinitionVersion -> Maybe Text
amznClientToken :: Prelude.Maybe Prelude.Text,
    -- | A list of devices in the definition version.
    CreateDeviceDefinitionVersion -> Maybe [Device]
devices :: Prelude.Maybe [Device],
    -- | The ID of the device definition.
    CreateDeviceDefinitionVersion -> Text
deviceDefinitionId :: Prelude.Text
  }
  deriving (CreateDeviceDefinitionVersion
-> CreateDeviceDefinitionVersion -> Bool
(CreateDeviceDefinitionVersion
 -> CreateDeviceDefinitionVersion -> Bool)
-> (CreateDeviceDefinitionVersion
    -> CreateDeviceDefinitionVersion -> Bool)
-> Eq CreateDeviceDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeviceDefinitionVersion
-> CreateDeviceDefinitionVersion -> Bool
$c/= :: CreateDeviceDefinitionVersion
-> CreateDeviceDefinitionVersion -> Bool
== :: CreateDeviceDefinitionVersion
-> CreateDeviceDefinitionVersion -> Bool
$c== :: CreateDeviceDefinitionVersion
-> CreateDeviceDefinitionVersion -> Bool
Prelude.Eq, ReadPrec [CreateDeviceDefinitionVersion]
ReadPrec CreateDeviceDefinitionVersion
Int -> ReadS CreateDeviceDefinitionVersion
ReadS [CreateDeviceDefinitionVersion]
(Int -> ReadS CreateDeviceDefinitionVersion)
-> ReadS [CreateDeviceDefinitionVersion]
-> ReadPrec CreateDeviceDefinitionVersion
-> ReadPrec [CreateDeviceDefinitionVersion]
-> Read CreateDeviceDefinitionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeviceDefinitionVersion]
$creadListPrec :: ReadPrec [CreateDeviceDefinitionVersion]
readPrec :: ReadPrec CreateDeviceDefinitionVersion
$creadPrec :: ReadPrec CreateDeviceDefinitionVersion
readList :: ReadS [CreateDeviceDefinitionVersion]
$creadList :: ReadS [CreateDeviceDefinitionVersion]
readsPrec :: Int -> ReadS CreateDeviceDefinitionVersion
$creadsPrec :: Int -> ReadS CreateDeviceDefinitionVersion
Prelude.Read, Int -> CreateDeviceDefinitionVersion -> ShowS
[CreateDeviceDefinitionVersion] -> ShowS
CreateDeviceDefinitionVersion -> String
(Int -> CreateDeviceDefinitionVersion -> ShowS)
-> (CreateDeviceDefinitionVersion -> String)
-> ([CreateDeviceDefinitionVersion] -> ShowS)
-> Show CreateDeviceDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeviceDefinitionVersion] -> ShowS
$cshowList :: [CreateDeviceDefinitionVersion] -> ShowS
show :: CreateDeviceDefinitionVersion -> String
$cshow :: CreateDeviceDefinitionVersion -> String
showsPrec :: Int -> CreateDeviceDefinitionVersion -> ShowS
$cshowsPrec :: Int -> CreateDeviceDefinitionVersion -> ShowS
Prelude.Show, (forall x.
 CreateDeviceDefinitionVersion
 -> Rep CreateDeviceDefinitionVersion x)
-> (forall x.
    Rep CreateDeviceDefinitionVersion x
    -> CreateDeviceDefinitionVersion)
-> Generic CreateDeviceDefinitionVersion
forall x.
Rep CreateDeviceDefinitionVersion x
-> CreateDeviceDefinitionVersion
forall x.
CreateDeviceDefinitionVersion
-> Rep CreateDeviceDefinitionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDeviceDefinitionVersion x
-> CreateDeviceDefinitionVersion
$cfrom :: forall x.
CreateDeviceDefinitionVersion
-> Rep CreateDeviceDefinitionVersion x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeviceDefinitionVersion' 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:
--
-- 'amznClientToken', 'createDeviceDefinitionVersion_amznClientToken' - A client token used to correlate requests and responses.
--
-- 'devices', 'createDeviceDefinitionVersion_devices' - A list of devices in the definition version.
--
-- 'deviceDefinitionId', 'createDeviceDefinitionVersion_deviceDefinitionId' - The ID of the device definition.
newCreateDeviceDefinitionVersion ::
  -- | 'deviceDefinitionId'
  Prelude.Text ->
  CreateDeviceDefinitionVersion
newCreateDeviceDefinitionVersion :: Text -> CreateDeviceDefinitionVersion
newCreateDeviceDefinitionVersion Text
pDeviceDefinitionId_ =
  CreateDeviceDefinitionVersion' :: Maybe Text
-> Maybe [Device] -> Text -> CreateDeviceDefinitionVersion
CreateDeviceDefinitionVersion'
    { $sel:amznClientToken:CreateDeviceDefinitionVersion' :: Maybe Text
amznClientToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:devices:CreateDeviceDefinitionVersion' :: Maybe [Device]
devices = Maybe [Device]
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceDefinitionId:CreateDeviceDefinitionVersion' :: Text
deviceDefinitionId = Text
pDeviceDefinitionId_
    }

-- | A client token used to correlate requests and responses.
createDeviceDefinitionVersion_amznClientToken :: Lens.Lens' CreateDeviceDefinitionVersion (Prelude.Maybe Prelude.Text)
createDeviceDefinitionVersion_amznClientToken :: (Maybe Text -> f (Maybe Text))
-> CreateDeviceDefinitionVersion -> f CreateDeviceDefinitionVersion
createDeviceDefinitionVersion_amznClientToken = (CreateDeviceDefinitionVersion -> Maybe Text)
-> (CreateDeviceDefinitionVersion
    -> Maybe Text -> CreateDeviceDefinitionVersion)
-> Lens
     CreateDeviceDefinitionVersion
     CreateDeviceDefinitionVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceDefinitionVersion' {Maybe Text
amznClientToken :: Maybe Text
$sel:amznClientToken:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Maybe Text
amznClientToken} -> Maybe Text
amznClientToken) (\s :: CreateDeviceDefinitionVersion
s@CreateDeviceDefinitionVersion' {} Maybe Text
a -> CreateDeviceDefinitionVersion
s {$sel:amznClientToken:CreateDeviceDefinitionVersion' :: Maybe Text
amznClientToken = Maybe Text
a} :: CreateDeviceDefinitionVersion)

-- | A list of devices in the definition version.
createDeviceDefinitionVersion_devices :: Lens.Lens' CreateDeviceDefinitionVersion (Prelude.Maybe [Device])
createDeviceDefinitionVersion_devices :: (Maybe [Device] -> f (Maybe [Device]))
-> CreateDeviceDefinitionVersion -> f CreateDeviceDefinitionVersion
createDeviceDefinitionVersion_devices = (CreateDeviceDefinitionVersion -> Maybe [Device])
-> (CreateDeviceDefinitionVersion
    -> Maybe [Device] -> CreateDeviceDefinitionVersion)
-> Lens
     CreateDeviceDefinitionVersion
     CreateDeviceDefinitionVersion
     (Maybe [Device])
     (Maybe [Device])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceDefinitionVersion' {Maybe [Device]
devices :: Maybe [Device]
$sel:devices:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Maybe [Device]
devices} -> Maybe [Device]
devices) (\s :: CreateDeviceDefinitionVersion
s@CreateDeviceDefinitionVersion' {} Maybe [Device]
a -> CreateDeviceDefinitionVersion
s {$sel:devices:CreateDeviceDefinitionVersion' :: Maybe [Device]
devices = Maybe [Device]
a} :: CreateDeviceDefinitionVersion) ((Maybe [Device] -> f (Maybe [Device]))
 -> CreateDeviceDefinitionVersion
 -> f CreateDeviceDefinitionVersion)
-> ((Maybe [Device] -> f (Maybe [Device]))
    -> Maybe [Device] -> f (Maybe [Device]))
-> (Maybe [Device] -> f (Maybe [Device]))
-> CreateDeviceDefinitionVersion
-> f CreateDeviceDefinitionVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Device] [Device] [Device] [Device]
-> Iso
     (Maybe [Device]) (Maybe [Device]) (Maybe [Device]) (Maybe [Device])
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 [Device] [Device] [Device] [Device]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Core.AWSRequest
    CreateDeviceDefinitionVersion
  where
  type
    AWSResponse CreateDeviceDefinitionVersion =
      CreateDeviceDefinitionVersionResponse
  request :: CreateDeviceDefinitionVersion
-> Request CreateDeviceDefinitionVersion
request = Service
-> CreateDeviceDefinitionVersion
-> Request CreateDeviceDefinitionVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDeviceDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDeviceDefinitionVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDeviceDefinitionVersion))
-> Logger
-> Service
-> Proxy CreateDeviceDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDeviceDefinitionVersion)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDeviceDefinitionVersionResponse
CreateDeviceDefinitionVersionResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateDeviceDefinitionVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateDeviceDefinitionVersionResponse)
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 -> CreateDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateDeviceDefinitionVersionResponse)
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 -> CreateDeviceDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDeviceDefinitionVersionResponse)
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 -> CreateDeviceDefinitionVersionResponse)
-> Either String Int
-> Either String CreateDeviceDefinitionVersionResponse
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
    CreateDeviceDefinitionVersion

instance Prelude.NFData CreateDeviceDefinitionVersion

instance Core.ToHeaders CreateDeviceDefinitionVersion where
  toHeaders :: CreateDeviceDefinitionVersion -> ResponseHeaders
toHeaders CreateDeviceDefinitionVersion' {Maybe [Device]
Maybe Text
Text
deviceDefinitionId :: Text
devices :: Maybe [Device]
amznClientToken :: Maybe Text
$sel:deviceDefinitionId:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Text
$sel:devices:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Maybe [Device]
$sel:amznClientToken:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amzn-Client-Token" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
amznClientToken,
        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 CreateDeviceDefinitionVersion where
  toJSON :: CreateDeviceDefinitionVersion -> Value
toJSON CreateDeviceDefinitionVersion' {Maybe [Device]
Maybe Text
Text
deviceDefinitionId :: Text
devices :: Maybe [Device]
amznClientToken :: Maybe Text
$sel:deviceDefinitionId:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Text
$sel:devices:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Maybe [Device]
$sel:amznClientToken:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"Devices" Text -> [Device] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Device] -> Pair) -> Maybe [Device] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Device]
devices]
      )

instance Core.ToPath CreateDeviceDefinitionVersion where
  toPath :: CreateDeviceDefinitionVersion -> ByteString
toPath CreateDeviceDefinitionVersion' {Maybe [Device]
Maybe Text
Text
deviceDefinitionId :: Text
devices :: Maybe [Device]
amznClientToken :: Maybe Text
$sel:deviceDefinitionId:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Text
$sel:devices:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> Maybe [Device]
$sel:amznClientToken:CreateDeviceDefinitionVersion' :: CreateDeviceDefinitionVersion -> 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"
      ]

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

-- | /See:/ 'newCreateDeviceDefinitionVersionResponse' smart constructor.
data CreateDeviceDefinitionVersionResponse = CreateDeviceDefinitionVersionResponse'
  { -- | The ARN of the version.
    CreateDeviceDefinitionVersionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the version was created.
    CreateDeviceDefinitionVersionResponse -> Maybe Text
creationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The ID of the version.
    CreateDeviceDefinitionVersionResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The ID of the parent definition that the version is associated with.
    CreateDeviceDefinitionVersionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateDeviceDefinitionVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDeviceDefinitionVersionResponse
-> CreateDeviceDefinitionVersionResponse -> Bool
(CreateDeviceDefinitionVersionResponse
 -> CreateDeviceDefinitionVersionResponse -> Bool)
-> (CreateDeviceDefinitionVersionResponse
    -> CreateDeviceDefinitionVersionResponse -> Bool)
-> Eq CreateDeviceDefinitionVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeviceDefinitionVersionResponse
-> CreateDeviceDefinitionVersionResponse -> Bool
$c/= :: CreateDeviceDefinitionVersionResponse
-> CreateDeviceDefinitionVersionResponse -> Bool
== :: CreateDeviceDefinitionVersionResponse
-> CreateDeviceDefinitionVersionResponse -> Bool
$c== :: CreateDeviceDefinitionVersionResponse
-> CreateDeviceDefinitionVersionResponse -> Bool
Prelude.Eq, ReadPrec [CreateDeviceDefinitionVersionResponse]
ReadPrec CreateDeviceDefinitionVersionResponse
Int -> ReadS CreateDeviceDefinitionVersionResponse
ReadS [CreateDeviceDefinitionVersionResponse]
(Int -> ReadS CreateDeviceDefinitionVersionResponse)
-> ReadS [CreateDeviceDefinitionVersionResponse]
-> ReadPrec CreateDeviceDefinitionVersionResponse
-> ReadPrec [CreateDeviceDefinitionVersionResponse]
-> Read CreateDeviceDefinitionVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeviceDefinitionVersionResponse]
$creadListPrec :: ReadPrec [CreateDeviceDefinitionVersionResponse]
readPrec :: ReadPrec CreateDeviceDefinitionVersionResponse
$creadPrec :: ReadPrec CreateDeviceDefinitionVersionResponse
readList :: ReadS [CreateDeviceDefinitionVersionResponse]
$creadList :: ReadS [CreateDeviceDefinitionVersionResponse]
readsPrec :: Int -> ReadS CreateDeviceDefinitionVersionResponse
$creadsPrec :: Int -> ReadS CreateDeviceDefinitionVersionResponse
Prelude.Read, Int -> CreateDeviceDefinitionVersionResponse -> ShowS
[CreateDeviceDefinitionVersionResponse] -> ShowS
CreateDeviceDefinitionVersionResponse -> String
(Int -> CreateDeviceDefinitionVersionResponse -> ShowS)
-> (CreateDeviceDefinitionVersionResponse -> String)
-> ([CreateDeviceDefinitionVersionResponse] -> ShowS)
-> Show CreateDeviceDefinitionVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeviceDefinitionVersionResponse] -> ShowS
$cshowList :: [CreateDeviceDefinitionVersionResponse] -> ShowS
show :: CreateDeviceDefinitionVersionResponse -> String
$cshow :: CreateDeviceDefinitionVersionResponse -> String
showsPrec :: Int -> CreateDeviceDefinitionVersionResponse -> ShowS
$cshowsPrec :: Int -> CreateDeviceDefinitionVersionResponse -> ShowS
Prelude.Show, (forall x.
 CreateDeviceDefinitionVersionResponse
 -> Rep CreateDeviceDefinitionVersionResponse x)
-> (forall x.
    Rep CreateDeviceDefinitionVersionResponse x
    -> CreateDeviceDefinitionVersionResponse)
-> Generic CreateDeviceDefinitionVersionResponse
forall x.
Rep CreateDeviceDefinitionVersionResponse x
-> CreateDeviceDefinitionVersionResponse
forall x.
CreateDeviceDefinitionVersionResponse
-> Rep CreateDeviceDefinitionVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDeviceDefinitionVersionResponse x
-> CreateDeviceDefinitionVersionResponse
$cfrom :: forall x.
CreateDeviceDefinitionVersionResponse
-> Rep CreateDeviceDefinitionVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeviceDefinitionVersionResponse' 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:
--
-- 'arn', 'createDeviceDefinitionVersionResponse_arn' - The ARN of the version.
--
-- 'creationTimestamp', 'createDeviceDefinitionVersionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the version was created.
--
-- 'version', 'createDeviceDefinitionVersionResponse_version' - The ID of the version.
--
-- 'id', 'createDeviceDefinitionVersionResponse_id' - The ID of the parent definition that the version is associated with.
--
-- 'httpStatus', 'createDeviceDefinitionVersionResponse_httpStatus' - The response's http status code.
newCreateDeviceDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDeviceDefinitionVersionResponse
newCreateDeviceDefinitionVersionResponse :: Int -> CreateDeviceDefinitionVersionResponse
newCreateDeviceDefinitionVersionResponse Int
pHttpStatus_ =
  CreateDeviceDefinitionVersionResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDeviceDefinitionVersionResponse
CreateDeviceDefinitionVersionResponse'
    { $sel:arn:CreateDeviceDefinitionVersionResponse' :: Maybe Text
arn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:CreateDeviceDefinitionVersionResponse' :: Maybe Text
creationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:CreateDeviceDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateDeviceDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDeviceDefinitionVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

-- | The ID of the parent definition that the version is associated with.
createDeviceDefinitionVersionResponse_id :: Lens.Lens' CreateDeviceDefinitionVersionResponse (Prelude.Maybe Prelude.Text)
createDeviceDefinitionVersionResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateDeviceDefinitionVersionResponse
-> f CreateDeviceDefinitionVersionResponse
createDeviceDefinitionVersionResponse_id = (CreateDeviceDefinitionVersionResponse -> Maybe Text)
-> (CreateDeviceDefinitionVersionResponse
    -> Maybe Text -> CreateDeviceDefinitionVersionResponse)
-> Lens
     CreateDeviceDefinitionVersionResponse
     CreateDeviceDefinitionVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceDefinitionVersionResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateDeviceDefinitionVersionResponse' :: CreateDeviceDefinitionVersionResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateDeviceDefinitionVersionResponse
s@CreateDeviceDefinitionVersionResponse' {} Maybe Text
a -> CreateDeviceDefinitionVersionResponse
s {$sel:id:CreateDeviceDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
a} :: CreateDeviceDefinitionVersionResponse)

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

instance
  Prelude.NFData
    CreateDeviceDefinitionVersionResponse