{-# 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.CreateComponentVersion
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a component. Components are software that run on Greengrass core
-- devices. After you develop and test a component on your core device, you
-- can use this operation to upload your component to IoT Greengrass. Then,
-- you can deploy the component to other core devices.
--
-- You can use this operation to do the following:
--
-- -   __Create components from recipes__
--
--     Create a component from a recipe, which is a file that defines the
--     component\'s metadata, parameters, dependencies, lifecycle,
--     artifacts, and platform capability. For more information, see
--     <https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html IoT Greengrass component recipe reference>
--     in the /IoT Greengrass V2 Developer Guide/.
--
--     To create a component from a recipe, specify @inlineRecipe@ when you
--     call this operation.
--
-- -   __Create components from Lambda functions__
--
--     Create a component from an Lambda function that runs on IoT
--     Greengrass. This creates a recipe and artifacts from the Lambda
--     function\'s deployment package. You can use this operation to
--     migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass
--     V2.
--
--     This function only accepts Lambda functions that use the following
--     runtimes:
--
--     -   Python 2.7 – @python2.7@
--
--     -   Python 3.7 – @python3.7@
--
--     -   Python 3.8 – @python3.8@
--
--     -   Python 3.9 – @python3.9@
--
--     -   Java 8 – @java8@
--
--     -   Java 11 – @java11@
--
--     -   Node.js 10 – @nodejs10.x@
--
--     -   Node.js 12 – @nodejs12.x@
--
--     -   Node.js 14 – @nodejs14.x@
--
--     To create a component from a Lambda function, specify
--     @lambdaFunction@ when you call this operation.
--
--     IoT Greengrass currently supports Lambda functions on only Linux
--     core devices.
module Amazonka.GreengrassV2.CreateComponentVersion
  ( -- * Creating a Request
    CreateComponentVersion (..),
    newCreateComponentVersion,

    -- * Request Lenses
    createComponentVersion_clientToken,
    createComponentVersion_inlineRecipe,
    createComponentVersion_lambdaFunction,
    createComponentVersion_tags,

    -- * Destructuring the Response
    CreateComponentVersionResponse (..),
    newCreateComponentVersionResponse,

    -- * Response Lenses
    createComponentVersionResponse_arn,
    createComponentVersionResponse_httpStatus,
    createComponentVersionResponse_componentName,
    createComponentVersionResponse_componentVersion,
    createComponentVersionResponse_creationTimestamp,
    createComponentVersionResponse_status,
  )
where

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

-- | /See:/ 'newCreateComponentVersion' smart constructor.
data CreateComponentVersion = CreateComponentVersion'
  { -- | A unique, case-sensitive identifier that you can provide to ensure that
    -- the request is idempotent. Idempotency means that the request is
    -- successfully processed only once, even if you send the request multiple
    -- times. When a request succeeds, and you specify the same client token
    -- for subsequent successful requests, the IoT Greengrass V2 service
    -- returns the successful response that it caches from the previous
    -- request. IoT Greengrass V2 caches successful responses for idempotent
    -- requests for up to 8 hours.
    CreateComponentVersion -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The recipe to use to create the component. The recipe defines the
    -- component\'s metadata, parameters, dependencies, lifecycle, artifacts,
    -- and platform compatibility.
    --
    -- You must specify either @inlineRecipe@ or @lambdaFunction@.
    CreateComponentVersion -> Maybe Base64
inlineRecipe :: Prelude.Maybe Data.Base64,
    -- | The parameters to create a component from a Lambda function.
    --
    -- You must specify either @inlineRecipe@ or @lambdaFunction@.
    CreateComponentVersion -> Maybe LambdaFunctionRecipeSource
lambdaFunction :: Prelude.Maybe LambdaFunctionRecipeSource,
    -- | 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/.
    CreateComponentVersion -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (CreateComponentVersion -> CreateComponentVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateComponentVersion -> CreateComponentVersion -> Bool
$c/= :: CreateComponentVersion -> CreateComponentVersion -> Bool
== :: CreateComponentVersion -> CreateComponentVersion -> Bool
$c== :: CreateComponentVersion -> CreateComponentVersion -> Bool
Prelude.Eq, ReadPrec [CreateComponentVersion]
ReadPrec CreateComponentVersion
Int -> ReadS CreateComponentVersion
ReadS [CreateComponentVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateComponentVersion]
$creadListPrec :: ReadPrec [CreateComponentVersion]
readPrec :: ReadPrec CreateComponentVersion
$creadPrec :: ReadPrec CreateComponentVersion
readList :: ReadS [CreateComponentVersion]
$creadList :: ReadS [CreateComponentVersion]
readsPrec :: Int -> ReadS CreateComponentVersion
$creadsPrec :: Int -> ReadS CreateComponentVersion
Prelude.Read, Int -> CreateComponentVersion -> ShowS
[CreateComponentVersion] -> ShowS
CreateComponentVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateComponentVersion] -> ShowS
$cshowList :: [CreateComponentVersion] -> ShowS
show :: CreateComponentVersion -> String
$cshow :: CreateComponentVersion -> String
showsPrec :: Int -> CreateComponentVersion -> ShowS
$cshowsPrec :: Int -> CreateComponentVersion -> ShowS
Prelude.Show, forall x. Rep CreateComponentVersion x -> CreateComponentVersion
forall x. CreateComponentVersion -> Rep CreateComponentVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateComponentVersion x -> CreateComponentVersion
$cfrom :: forall x. CreateComponentVersion -> Rep CreateComponentVersion x
Prelude.Generic)

-- |
-- Create a value of 'CreateComponentVersion' 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:
--
-- 'clientToken', 'createComponentVersion_clientToken' - A unique, case-sensitive identifier that you can provide to ensure that
-- the request is idempotent. Idempotency means that the request is
-- successfully processed only once, even if you send the request multiple
-- times. When a request succeeds, and you specify the same client token
-- for subsequent successful requests, the IoT Greengrass V2 service
-- returns the successful response that it caches from the previous
-- request. IoT Greengrass V2 caches successful responses for idempotent
-- requests for up to 8 hours.
--
-- 'inlineRecipe', 'createComponentVersion_inlineRecipe' - The recipe to use to create the component. The recipe defines the
-- component\'s metadata, parameters, dependencies, lifecycle, artifacts,
-- and platform compatibility.
--
-- You must specify either @inlineRecipe@ or @lambdaFunction@.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'lambdaFunction', 'createComponentVersion_lambdaFunction' - The parameters to create a component from a Lambda function.
--
-- You must specify either @inlineRecipe@ or @lambdaFunction@.
--
-- 'tags', 'createComponentVersion_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/.
newCreateComponentVersion ::
  CreateComponentVersion
newCreateComponentVersion :: CreateComponentVersion
newCreateComponentVersion =
  CreateComponentVersion'
    { $sel:clientToken:CreateComponentVersion' :: Maybe Text
clientToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:inlineRecipe:CreateComponentVersion' :: Maybe Base64
inlineRecipe = forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaFunction:CreateComponentVersion' :: Maybe LambdaFunctionRecipeSource
lambdaFunction = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateComponentVersion' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique, case-sensitive identifier that you can provide to ensure that
-- the request is idempotent. Idempotency means that the request is
-- successfully processed only once, even if you send the request multiple
-- times. When a request succeeds, and you specify the same client token
-- for subsequent successful requests, the IoT Greengrass V2 service
-- returns the successful response that it caches from the previous
-- request. IoT Greengrass V2 caches successful responses for idempotent
-- requests for up to 8 hours.
createComponentVersion_clientToken :: Lens.Lens' CreateComponentVersion (Prelude.Maybe Prelude.Text)
createComponentVersion_clientToken :: Lens' CreateComponentVersion (Maybe Text)
createComponentVersion_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersion' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateComponentVersion' :: CreateComponentVersion -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateComponentVersion
s@CreateComponentVersion' {} Maybe Text
a -> CreateComponentVersion
s {$sel:clientToken:CreateComponentVersion' :: Maybe Text
clientToken = Maybe Text
a} :: CreateComponentVersion)

-- | The recipe to use to create the component. The recipe defines the
-- component\'s metadata, parameters, dependencies, lifecycle, artifacts,
-- and platform compatibility.
--
-- You must specify either @inlineRecipe@ or @lambdaFunction@.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
createComponentVersion_inlineRecipe :: Lens.Lens' CreateComponentVersion (Prelude.Maybe Prelude.ByteString)
createComponentVersion_inlineRecipe :: Lens' CreateComponentVersion (Maybe ByteString)
createComponentVersion_inlineRecipe = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersion' {Maybe Base64
inlineRecipe :: Maybe Base64
$sel:inlineRecipe:CreateComponentVersion' :: CreateComponentVersion -> Maybe Base64
inlineRecipe} -> Maybe Base64
inlineRecipe) (\s :: CreateComponentVersion
s@CreateComponentVersion' {} Maybe Base64
a -> CreateComponentVersion
s {$sel:inlineRecipe:CreateComponentVersion' :: Maybe Base64
inlineRecipe = Maybe Base64
a} :: CreateComponentVersion) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 Iso' Base64 ByteString
Data._Base64

-- | The parameters to create a component from a Lambda function.
--
-- You must specify either @inlineRecipe@ or @lambdaFunction@.
createComponentVersion_lambdaFunction :: Lens.Lens' CreateComponentVersion (Prelude.Maybe LambdaFunctionRecipeSource)
createComponentVersion_lambdaFunction :: Lens' CreateComponentVersion (Maybe LambdaFunctionRecipeSource)
createComponentVersion_lambdaFunction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersion' {Maybe LambdaFunctionRecipeSource
lambdaFunction :: Maybe LambdaFunctionRecipeSource
$sel:lambdaFunction:CreateComponentVersion' :: CreateComponentVersion -> Maybe LambdaFunctionRecipeSource
lambdaFunction} -> Maybe LambdaFunctionRecipeSource
lambdaFunction) (\s :: CreateComponentVersion
s@CreateComponentVersion' {} Maybe LambdaFunctionRecipeSource
a -> CreateComponentVersion
s {$sel:lambdaFunction:CreateComponentVersion' :: Maybe LambdaFunctionRecipeSource
lambdaFunction = Maybe LambdaFunctionRecipeSource
a} :: CreateComponentVersion)

-- | 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/.
createComponentVersion_tags :: Lens.Lens' CreateComponentVersion (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createComponentVersion_tags :: Lens' CreateComponentVersion (Maybe (HashMap Text Text))
createComponentVersion_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersion' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateComponentVersion' :: CreateComponentVersion -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateComponentVersion
s@CreateComponentVersion' {} Maybe (HashMap Text Text)
a -> CreateComponentVersion
s {$sel:tags:CreateComponentVersion' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateComponentVersion) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateComponentVersion where
  type
    AWSResponse CreateComponentVersion =
      CreateComponentVersionResponse
  request :: (Service -> Service)
-> CreateComponentVersion -> Request CreateComponentVersion
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateComponentVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateComponentVersion)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int
-> Text
-> Text
-> POSIX
-> CloudComponentStatus
-> CreateComponentVersionResponse
CreateComponentVersionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"componentName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"componentVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"creationTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"status")
      )

instance Prelude.Hashable CreateComponentVersion where
  hashWithSalt :: Int -> CreateComponentVersion -> Int
hashWithSalt Int
_salt CreateComponentVersion' {Maybe Text
Maybe (HashMap Text Text)
Maybe Base64
Maybe LambdaFunctionRecipeSource
tags :: Maybe (HashMap Text Text)
lambdaFunction :: Maybe LambdaFunctionRecipeSource
inlineRecipe :: Maybe Base64
clientToken :: Maybe Text
$sel:tags:CreateComponentVersion' :: CreateComponentVersion -> Maybe (HashMap Text Text)
$sel:lambdaFunction:CreateComponentVersion' :: CreateComponentVersion -> Maybe LambdaFunctionRecipeSource
$sel:inlineRecipe:CreateComponentVersion' :: CreateComponentVersion -> Maybe Base64
$sel:clientToken:CreateComponentVersion' :: CreateComponentVersion -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Base64
inlineRecipe
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LambdaFunctionRecipeSource
lambdaFunction
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData CreateComponentVersion where
  rnf :: CreateComponentVersion -> ()
rnf CreateComponentVersion' {Maybe Text
Maybe (HashMap Text Text)
Maybe Base64
Maybe LambdaFunctionRecipeSource
tags :: Maybe (HashMap Text Text)
lambdaFunction :: Maybe LambdaFunctionRecipeSource
inlineRecipe :: Maybe Base64
clientToken :: Maybe Text
$sel:tags:CreateComponentVersion' :: CreateComponentVersion -> Maybe (HashMap Text Text)
$sel:lambdaFunction:CreateComponentVersion' :: CreateComponentVersion -> Maybe LambdaFunctionRecipeSource
$sel:inlineRecipe:CreateComponentVersion' :: CreateComponentVersion -> Maybe Base64
$sel:clientToken:CreateComponentVersion' :: CreateComponentVersion -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Base64
inlineRecipe
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LambdaFunctionRecipeSource
lambdaFunction
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags

instance Data.ToHeaders CreateComponentVersion where
  toHeaders :: CreateComponentVersion -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON CreateComponentVersion where
  toJSON :: CreateComponentVersion -> Value
toJSON CreateComponentVersion' {Maybe Text
Maybe (HashMap Text Text)
Maybe Base64
Maybe LambdaFunctionRecipeSource
tags :: Maybe (HashMap Text Text)
lambdaFunction :: Maybe LambdaFunctionRecipeSource
inlineRecipe :: Maybe Base64
clientToken :: Maybe Text
$sel:tags:CreateComponentVersion' :: CreateComponentVersion -> Maybe (HashMap Text Text)
$sel:lambdaFunction:CreateComponentVersion' :: CreateComponentVersion -> Maybe LambdaFunctionRecipeSource
$sel:inlineRecipe:CreateComponentVersion' :: CreateComponentVersion -> Maybe Base64
$sel:clientToken:CreateComponentVersion' :: CreateComponentVersion -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"inlineRecipe" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Base64
inlineRecipe,
            (Key
"lambdaFunction" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaFunctionRecipeSource
lambdaFunction,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
          ]
      )

instance Data.ToPath CreateComponentVersion where
  toPath :: CreateComponentVersion -> ByteString
toPath =
    forall a b. a -> b -> a
Prelude.const
      ByteString
"/greengrass/v2/createComponentVersion"

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

-- | /See:/ 'newCreateComponentVersionResponse' smart constructor.
data CreateComponentVersionResponse = CreateComponentVersionResponse'
  { -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the component version.
    CreateComponentVersionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateComponentVersionResponse -> Int
httpStatus :: Prelude.Int,
    -- | The name of the component.
    CreateComponentVersionResponse -> Text
componentName :: Prelude.Text,
    -- | The version of the component.
    CreateComponentVersionResponse -> Text
componentVersion :: Prelude.Text,
    -- | The time at which the component was created, expressed in ISO 8601
    -- format.
    CreateComponentVersionResponse -> POSIX
creationTimestamp :: Data.POSIX,
    -- | The status of the component version in IoT Greengrass V2. This status is
    -- different from the status of the component on a core device.
    CreateComponentVersionResponse -> CloudComponentStatus
status :: CloudComponentStatus
  }
  deriving (CreateComponentVersionResponse
-> CreateComponentVersionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateComponentVersionResponse
-> CreateComponentVersionResponse -> Bool
$c/= :: CreateComponentVersionResponse
-> CreateComponentVersionResponse -> Bool
== :: CreateComponentVersionResponse
-> CreateComponentVersionResponse -> Bool
$c== :: CreateComponentVersionResponse
-> CreateComponentVersionResponse -> Bool
Prelude.Eq, ReadPrec [CreateComponentVersionResponse]
ReadPrec CreateComponentVersionResponse
Int -> ReadS CreateComponentVersionResponse
ReadS [CreateComponentVersionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateComponentVersionResponse]
$creadListPrec :: ReadPrec [CreateComponentVersionResponse]
readPrec :: ReadPrec CreateComponentVersionResponse
$creadPrec :: ReadPrec CreateComponentVersionResponse
readList :: ReadS [CreateComponentVersionResponse]
$creadList :: ReadS [CreateComponentVersionResponse]
readsPrec :: Int -> ReadS CreateComponentVersionResponse
$creadsPrec :: Int -> ReadS CreateComponentVersionResponse
Prelude.Read, Int -> CreateComponentVersionResponse -> ShowS
[CreateComponentVersionResponse] -> ShowS
CreateComponentVersionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateComponentVersionResponse] -> ShowS
$cshowList :: [CreateComponentVersionResponse] -> ShowS
show :: CreateComponentVersionResponse -> String
$cshow :: CreateComponentVersionResponse -> String
showsPrec :: Int -> CreateComponentVersionResponse -> ShowS
$cshowsPrec :: Int -> CreateComponentVersionResponse -> ShowS
Prelude.Show, forall x.
Rep CreateComponentVersionResponse x
-> CreateComponentVersionResponse
forall x.
CreateComponentVersionResponse
-> Rep CreateComponentVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateComponentVersionResponse x
-> CreateComponentVersionResponse
$cfrom :: forall x.
CreateComponentVersionResponse
-> Rep CreateComponentVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateComponentVersionResponse' 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', 'createComponentVersionResponse_arn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the component version.
--
-- 'httpStatus', 'createComponentVersionResponse_httpStatus' - The response's http status code.
--
-- 'componentName', 'createComponentVersionResponse_componentName' - The name of the component.
--
-- 'componentVersion', 'createComponentVersionResponse_componentVersion' - The version of the component.
--
-- 'creationTimestamp', 'createComponentVersionResponse_creationTimestamp' - The time at which the component was created, expressed in ISO 8601
-- format.
--
-- 'status', 'createComponentVersionResponse_status' - The status of the component version in IoT Greengrass V2. This status is
-- different from the status of the component on a core device.
newCreateComponentVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'componentName'
  Prelude.Text ->
  -- | 'componentVersion'
  Prelude.Text ->
  -- | 'creationTimestamp'
  Prelude.UTCTime ->
  -- | 'status'
  CloudComponentStatus ->
  CreateComponentVersionResponse
newCreateComponentVersionResponse :: Int
-> Text
-> Text
-> UTCTime
-> CloudComponentStatus
-> CreateComponentVersionResponse
newCreateComponentVersionResponse
  Int
pHttpStatus_
  Text
pComponentName_
  Text
pComponentVersion_
  UTCTime
pCreationTimestamp_
  CloudComponentStatus
pStatus_ =
    CreateComponentVersionResponse'
      { $sel:arn:CreateComponentVersionResponse' :: Maybe Text
arn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateComponentVersionResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:componentName:CreateComponentVersionResponse' :: Text
componentName = Text
pComponentName_,
        $sel:componentVersion:CreateComponentVersionResponse' :: Text
componentVersion = Text
pComponentVersion_,
        $sel:creationTimestamp:CreateComponentVersionResponse' :: POSIX
creationTimestamp =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTimestamp_,
        $sel:status:CreateComponentVersionResponse' :: CloudComponentStatus
status = CloudComponentStatus
pStatus_
      }

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the component version.
createComponentVersionResponse_arn :: Lens.Lens' CreateComponentVersionResponse (Prelude.Maybe Prelude.Text)
createComponentVersionResponse_arn :: Lens' CreateComponentVersionResponse (Maybe Text)
createComponentVersionResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersionResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateComponentVersionResponse
s@CreateComponentVersionResponse' {} Maybe Text
a -> CreateComponentVersionResponse
s {$sel:arn:CreateComponentVersionResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateComponentVersionResponse)

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

-- | The name of the component.
createComponentVersionResponse_componentName :: Lens.Lens' CreateComponentVersionResponse Prelude.Text
createComponentVersionResponse_componentName :: Lens' CreateComponentVersionResponse Text
createComponentVersionResponse_componentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersionResponse' {Text
componentName :: Text
$sel:componentName:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> Text
componentName} -> Text
componentName) (\s :: CreateComponentVersionResponse
s@CreateComponentVersionResponse' {} Text
a -> CreateComponentVersionResponse
s {$sel:componentName:CreateComponentVersionResponse' :: Text
componentName = Text
a} :: CreateComponentVersionResponse)

-- | The version of the component.
createComponentVersionResponse_componentVersion :: Lens.Lens' CreateComponentVersionResponse Prelude.Text
createComponentVersionResponse_componentVersion :: Lens' CreateComponentVersionResponse Text
createComponentVersionResponse_componentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersionResponse' {Text
componentVersion :: Text
$sel:componentVersion:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> Text
componentVersion} -> Text
componentVersion) (\s :: CreateComponentVersionResponse
s@CreateComponentVersionResponse' {} Text
a -> CreateComponentVersionResponse
s {$sel:componentVersion:CreateComponentVersionResponse' :: Text
componentVersion = Text
a} :: CreateComponentVersionResponse)

-- | The time at which the component was created, expressed in ISO 8601
-- format.
createComponentVersionResponse_creationTimestamp :: Lens.Lens' CreateComponentVersionResponse Prelude.UTCTime
createComponentVersionResponse_creationTimestamp :: Lens' CreateComponentVersionResponse UTCTime
createComponentVersionResponse_creationTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersionResponse' {POSIX
creationTimestamp :: POSIX
$sel:creationTimestamp:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> POSIX
creationTimestamp} -> POSIX
creationTimestamp) (\s :: CreateComponentVersionResponse
s@CreateComponentVersionResponse' {} POSIX
a -> CreateComponentVersionResponse
s {$sel:creationTimestamp:CreateComponentVersionResponse' :: POSIX
creationTimestamp = POSIX
a} :: CreateComponentVersionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The status of the component version in IoT Greengrass V2. This status is
-- different from the status of the component on a core device.
createComponentVersionResponse_status :: Lens.Lens' CreateComponentVersionResponse CloudComponentStatus
createComponentVersionResponse_status :: Lens' CreateComponentVersionResponse CloudComponentStatus
createComponentVersionResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentVersionResponse' {CloudComponentStatus
status :: CloudComponentStatus
$sel:status:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> CloudComponentStatus
status} -> CloudComponentStatus
status) (\s :: CreateComponentVersionResponse
s@CreateComponentVersionResponse' {} CloudComponentStatus
a -> CreateComponentVersionResponse
s {$sel:status:CreateComponentVersionResponse' :: CloudComponentStatus
status = CloudComponentStatus
a} :: CreateComponentVersionResponse)

instance
  Prelude.NFData
    CreateComponentVersionResponse
  where
  rnf :: CreateComponentVersionResponse -> ()
rnf CreateComponentVersionResponse' {Int
Maybe Text
Text
POSIX
CloudComponentStatus
status :: CloudComponentStatus
creationTimestamp :: POSIX
componentVersion :: Text
componentName :: Text
httpStatus :: Int
arn :: Maybe Text
$sel:status:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> CloudComponentStatus
$sel:creationTimestamp:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> POSIX
$sel:componentVersion:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> Text
$sel:componentName:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> Text
$sel:httpStatus:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> Int
$sel:arn:CreateComponentVersionResponse' :: CreateComponentVersionResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
componentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
componentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CloudComponentStatus
status