{-# 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.GetFunctionDefinitionVersion
-- 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 Lambda function definition version,
-- including which Lambda functions are included in the version and their
-- configurations.
module Amazonka.Greengrass.GetFunctionDefinitionVersion
  ( -- * Creating a Request
    GetFunctionDefinitionVersion (..),
    newGetFunctionDefinitionVersion,

    -- * Request Lenses
    getFunctionDefinitionVersion_nextToken,
    getFunctionDefinitionVersion_functionDefinitionId,
    getFunctionDefinitionVersion_functionDefinitionVersionId,

    -- * Destructuring the Response
    GetFunctionDefinitionVersionResponse (..),
    newGetFunctionDefinitionVersionResponse,

    -- * Response Lenses
    getFunctionDefinitionVersionResponse_definition,
    getFunctionDefinitionVersionResponse_arn,
    getFunctionDefinitionVersionResponse_nextToken,
    getFunctionDefinitionVersionResponse_creationTimestamp,
    getFunctionDefinitionVersionResponse_version,
    getFunctionDefinitionVersionResponse_id,
    getFunctionDefinitionVersionResponse_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:/ 'newGetFunctionDefinitionVersion' smart constructor.
data GetFunctionDefinitionVersion = GetFunctionDefinitionVersion'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    GetFunctionDefinitionVersion -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Lambda function definition.
    GetFunctionDefinitionVersion -> Text
functionDefinitionId :: Prelude.Text,
    -- | The ID of the function definition version. This value maps to the
    -- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
    -- object, which is returned by \'\'ListFunctionDefinitionVersions\'\'
    -- requests. If the version is the last one that was associated with a
    -- function definition, the value also maps to the \'\'LatestVersion\'\'
    -- property of the corresponding \'\'DefinitionInformation\'\' object.
    GetFunctionDefinitionVersion -> Text
functionDefinitionVersionId :: Prelude.Text
  }
  deriving (GetFunctionDefinitionVersion
-> GetFunctionDefinitionVersion -> Bool
(GetFunctionDefinitionVersion
 -> GetFunctionDefinitionVersion -> Bool)
-> (GetFunctionDefinitionVersion
    -> GetFunctionDefinitionVersion -> Bool)
-> Eq GetFunctionDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFunctionDefinitionVersion
-> GetFunctionDefinitionVersion -> Bool
$c/= :: GetFunctionDefinitionVersion
-> GetFunctionDefinitionVersion -> Bool
== :: GetFunctionDefinitionVersion
-> GetFunctionDefinitionVersion -> Bool
$c== :: GetFunctionDefinitionVersion
-> GetFunctionDefinitionVersion -> Bool
Prelude.Eq, ReadPrec [GetFunctionDefinitionVersion]
ReadPrec GetFunctionDefinitionVersion
Int -> ReadS GetFunctionDefinitionVersion
ReadS [GetFunctionDefinitionVersion]
(Int -> ReadS GetFunctionDefinitionVersion)
-> ReadS [GetFunctionDefinitionVersion]
-> ReadPrec GetFunctionDefinitionVersion
-> ReadPrec [GetFunctionDefinitionVersion]
-> Read GetFunctionDefinitionVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFunctionDefinitionVersion]
$creadListPrec :: ReadPrec [GetFunctionDefinitionVersion]
readPrec :: ReadPrec GetFunctionDefinitionVersion
$creadPrec :: ReadPrec GetFunctionDefinitionVersion
readList :: ReadS [GetFunctionDefinitionVersion]
$creadList :: ReadS [GetFunctionDefinitionVersion]
readsPrec :: Int -> ReadS GetFunctionDefinitionVersion
$creadsPrec :: Int -> ReadS GetFunctionDefinitionVersion
Prelude.Read, Int -> GetFunctionDefinitionVersion -> ShowS
[GetFunctionDefinitionVersion] -> ShowS
GetFunctionDefinitionVersion -> String
(Int -> GetFunctionDefinitionVersion -> ShowS)
-> (GetFunctionDefinitionVersion -> String)
-> ([GetFunctionDefinitionVersion] -> ShowS)
-> Show GetFunctionDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFunctionDefinitionVersion] -> ShowS
$cshowList :: [GetFunctionDefinitionVersion] -> ShowS
show :: GetFunctionDefinitionVersion -> String
$cshow :: GetFunctionDefinitionVersion -> String
showsPrec :: Int -> GetFunctionDefinitionVersion -> ShowS
$cshowsPrec :: Int -> GetFunctionDefinitionVersion -> ShowS
Prelude.Show, (forall x.
 GetFunctionDefinitionVersion -> Rep GetFunctionDefinitionVersion x)
-> (forall x.
    Rep GetFunctionDefinitionVersion x -> GetFunctionDefinitionVersion)
-> Generic GetFunctionDefinitionVersion
forall x.
Rep GetFunctionDefinitionVersion x -> GetFunctionDefinitionVersion
forall x.
GetFunctionDefinitionVersion -> Rep GetFunctionDefinitionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFunctionDefinitionVersion x -> GetFunctionDefinitionVersion
$cfrom :: forall x.
GetFunctionDefinitionVersion -> Rep GetFunctionDefinitionVersion x
Prelude.Generic)

-- |
-- Create a value of 'GetFunctionDefinitionVersion' 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', 'getFunctionDefinitionVersion_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'functionDefinitionId', 'getFunctionDefinitionVersion_functionDefinitionId' - The ID of the Lambda function definition.
--
-- 'functionDefinitionVersionId', 'getFunctionDefinitionVersion_functionDefinitionVersionId' - The ID of the function definition version. This value maps to the
-- \'\'Version\'\' property of the corresponding \'\'VersionInformation\'\'
-- object, which is returned by \'\'ListFunctionDefinitionVersions\'\'
-- requests. If the version is the last one that was associated with a
-- function definition, the value also maps to the \'\'LatestVersion\'\'
-- property of the corresponding \'\'DefinitionInformation\'\' object.
newGetFunctionDefinitionVersion ::
  -- | 'functionDefinitionId'
  Prelude.Text ->
  -- | 'functionDefinitionVersionId'
  Prelude.Text ->
  GetFunctionDefinitionVersion
newGetFunctionDefinitionVersion :: Text -> Text -> GetFunctionDefinitionVersion
newGetFunctionDefinitionVersion
  Text
pFunctionDefinitionId_
  Text
pFunctionDefinitionVersionId_ =
    GetFunctionDefinitionVersion' :: Maybe Text -> Text -> Text -> GetFunctionDefinitionVersion
GetFunctionDefinitionVersion'
      { $sel:nextToken:GetFunctionDefinitionVersion' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:functionDefinitionId:GetFunctionDefinitionVersion' :: Text
functionDefinitionId = Text
pFunctionDefinitionId_,
        $sel:functionDefinitionVersionId:GetFunctionDefinitionVersion' :: Text
functionDefinitionVersionId =
          Text
pFunctionDefinitionVersionId_
      }

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

-- | The ID of the Lambda function definition.
getFunctionDefinitionVersion_functionDefinitionId :: Lens.Lens' GetFunctionDefinitionVersion Prelude.Text
getFunctionDefinitionVersion_functionDefinitionId :: (Text -> f Text)
-> GetFunctionDefinitionVersion -> f GetFunctionDefinitionVersion
getFunctionDefinitionVersion_functionDefinitionId = (GetFunctionDefinitionVersion -> Text)
-> (GetFunctionDefinitionVersion
    -> Text -> GetFunctionDefinitionVersion)
-> Lens
     GetFunctionDefinitionVersion GetFunctionDefinitionVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionDefinitionVersion' {Text
functionDefinitionId :: Text
$sel:functionDefinitionId:GetFunctionDefinitionVersion' :: GetFunctionDefinitionVersion -> Text
functionDefinitionId} -> Text
functionDefinitionId) (\s :: GetFunctionDefinitionVersion
s@GetFunctionDefinitionVersion' {} Text
a -> GetFunctionDefinitionVersion
s {$sel:functionDefinitionId:GetFunctionDefinitionVersion' :: Text
functionDefinitionId = Text
a} :: GetFunctionDefinitionVersion)

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

instance Core.AWSRequest GetFunctionDefinitionVersion where
  type
    AWSResponse GetFunctionDefinitionVersion =
      GetFunctionDefinitionVersionResponse
  request :: GetFunctionDefinitionVersion
-> Request GetFunctionDefinitionVersion
request = Service
-> GetFunctionDefinitionVersion
-> Request GetFunctionDefinitionVersion
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetFunctionDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetFunctionDefinitionVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetFunctionDefinitionVersion))
-> Logger
-> Service
-> Proxy GetFunctionDefinitionVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetFunctionDefinitionVersion)))
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 FunctionDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetFunctionDefinitionVersionResponse
GetFunctionDefinitionVersionResponse'
            (Maybe FunctionDefinitionVersion
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetFunctionDefinitionVersionResponse)
-> Either String (Maybe FunctionDefinitionVersion)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetFunctionDefinitionVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FunctionDefinitionVersion)
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
   -> GetFunctionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetFunctionDefinitionVersionResponse)
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
   -> GetFunctionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetFunctionDefinitionVersionResponse)
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
   -> GetFunctionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> GetFunctionDefinitionVersionResponse)
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 -> GetFunctionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> GetFunctionDefinitionVersionResponse)
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 -> GetFunctionDefinitionVersionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetFunctionDefinitionVersionResponse)
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 -> GetFunctionDefinitionVersionResponse)
-> Either String Int
-> Either String GetFunctionDefinitionVersionResponse
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
    GetFunctionDefinitionVersion

instance Prelude.NFData GetFunctionDefinitionVersion

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

instance Core.ToQuery GetFunctionDefinitionVersion where
  toQuery :: GetFunctionDefinitionVersion -> QueryString
toQuery GetFunctionDefinitionVersion' {Maybe Text
Text
functionDefinitionVersionId :: Text
functionDefinitionId :: Text
nextToken :: Maybe Text
$sel:functionDefinitionVersionId:GetFunctionDefinitionVersion' :: GetFunctionDefinitionVersion -> Text
$sel:functionDefinitionId:GetFunctionDefinitionVersion' :: GetFunctionDefinitionVersion -> Text
$sel:nextToken:GetFunctionDefinitionVersion' :: GetFunctionDefinitionVersion -> 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:/ 'newGetFunctionDefinitionVersionResponse' smart constructor.
data GetFunctionDefinitionVersionResponse = GetFunctionDefinitionVersionResponse'
  { -- | Information on the definition.
    GetFunctionDefinitionVersionResponse
-> Maybe FunctionDefinitionVersion
definition :: Prelude.Maybe FunctionDefinitionVersion,
    -- | The ARN of the function definition version.
    GetFunctionDefinitionVersionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    GetFunctionDefinitionVersionResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the function definition
    -- version was created.
    GetFunctionDefinitionVersionResponse -> Maybe Text
creationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The version of the function definition version.
    GetFunctionDefinitionVersionResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The ID of the function definition version.
    GetFunctionDefinitionVersionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetFunctionDefinitionVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetFunctionDefinitionVersionResponse
-> GetFunctionDefinitionVersionResponse -> Bool
(GetFunctionDefinitionVersionResponse
 -> GetFunctionDefinitionVersionResponse -> Bool)
-> (GetFunctionDefinitionVersionResponse
    -> GetFunctionDefinitionVersionResponse -> Bool)
-> Eq GetFunctionDefinitionVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFunctionDefinitionVersionResponse
-> GetFunctionDefinitionVersionResponse -> Bool
$c/= :: GetFunctionDefinitionVersionResponse
-> GetFunctionDefinitionVersionResponse -> Bool
== :: GetFunctionDefinitionVersionResponse
-> GetFunctionDefinitionVersionResponse -> Bool
$c== :: GetFunctionDefinitionVersionResponse
-> GetFunctionDefinitionVersionResponse -> Bool
Prelude.Eq, ReadPrec [GetFunctionDefinitionVersionResponse]
ReadPrec GetFunctionDefinitionVersionResponse
Int -> ReadS GetFunctionDefinitionVersionResponse
ReadS [GetFunctionDefinitionVersionResponse]
(Int -> ReadS GetFunctionDefinitionVersionResponse)
-> ReadS [GetFunctionDefinitionVersionResponse]
-> ReadPrec GetFunctionDefinitionVersionResponse
-> ReadPrec [GetFunctionDefinitionVersionResponse]
-> Read GetFunctionDefinitionVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFunctionDefinitionVersionResponse]
$creadListPrec :: ReadPrec [GetFunctionDefinitionVersionResponse]
readPrec :: ReadPrec GetFunctionDefinitionVersionResponse
$creadPrec :: ReadPrec GetFunctionDefinitionVersionResponse
readList :: ReadS [GetFunctionDefinitionVersionResponse]
$creadList :: ReadS [GetFunctionDefinitionVersionResponse]
readsPrec :: Int -> ReadS GetFunctionDefinitionVersionResponse
$creadsPrec :: Int -> ReadS GetFunctionDefinitionVersionResponse
Prelude.Read, Int -> GetFunctionDefinitionVersionResponse -> ShowS
[GetFunctionDefinitionVersionResponse] -> ShowS
GetFunctionDefinitionVersionResponse -> String
(Int -> GetFunctionDefinitionVersionResponse -> ShowS)
-> (GetFunctionDefinitionVersionResponse -> String)
-> ([GetFunctionDefinitionVersionResponse] -> ShowS)
-> Show GetFunctionDefinitionVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFunctionDefinitionVersionResponse] -> ShowS
$cshowList :: [GetFunctionDefinitionVersionResponse] -> ShowS
show :: GetFunctionDefinitionVersionResponse -> String
$cshow :: GetFunctionDefinitionVersionResponse -> String
showsPrec :: Int -> GetFunctionDefinitionVersionResponse -> ShowS
$cshowsPrec :: Int -> GetFunctionDefinitionVersionResponse -> ShowS
Prelude.Show, (forall x.
 GetFunctionDefinitionVersionResponse
 -> Rep GetFunctionDefinitionVersionResponse x)
-> (forall x.
    Rep GetFunctionDefinitionVersionResponse x
    -> GetFunctionDefinitionVersionResponse)
-> Generic GetFunctionDefinitionVersionResponse
forall x.
Rep GetFunctionDefinitionVersionResponse x
-> GetFunctionDefinitionVersionResponse
forall x.
GetFunctionDefinitionVersionResponse
-> Rep GetFunctionDefinitionVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetFunctionDefinitionVersionResponse x
-> GetFunctionDefinitionVersionResponse
$cfrom :: forall x.
GetFunctionDefinitionVersionResponse
-> Rep GetFunctionDefinitionVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetFunctionDefinitionVersionResponse' 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', 'getFunctionDefinitionVersionResponse_definition' - Information on the definition.
--
-- 'arn', 'getFunctionDefinitionVersionResponse_arn' - The ARN of the function definition version.
--
-- 'nextToken', 'getFunctionDefinitionVersionResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'creationTimestamp', 'getFunctionDefinitionVersionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the function definition
-- version was created.
--
-- 'version', 'getFunctionDefinitionVersionResponse_version' - The version of the function definition version.
--
-- 'id', 'getFunctionDefinitionVersionResponse_id' - The ID of the function definition version.
--
-- 'httpStatus', 'getFunctionDefinitionVersionResponse_httpStatus' - The response's http status code.
newGetFunctionDefinitionVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetFunctionDefinitionVersionResponse
newGetFunctionDefinitionVersionResponse :: Int -> GetFunctionDefinitionVersionResponse
newGetFunctionDefinitionVersionResponse Int
pHttpStatus_ =
  GetFunctionDefinitionVersionResponse' :: Maybe FunctionDefinitionVersion
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetFunctionDefinitionVersionResponse
GetFunctionDefinitionVersionResponse'
    { $sel:definition:GetFunctionDefinitionVersionResponse' :: Maybe FunctionDefinitionVersion
definition =
        Maybe FunctionDefinitionVersion
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetFunctionDefinitionVersionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetFunctionDefinitionVersionResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetFunctionDefinitionVersionResponse' :: Maybe Text
creationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:GetFunctionDefinitionVersionResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetFunctionDefinitionVersionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetFunctionDefinitionVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information on the definition.
getFunctionDefinitionVersionResponse_definition :: Lens.Lens' GetFunctionDefinitionVersionResponse (Prelude.Maybe FunctionDefinitionVersion)
getFunctionDefinitionVersionResponse_definition :: (Maybe FunctionDefinitionVersion
 -> f (Maybe FunctionDefinitionVersion))
-> GetFunctionDefinitionVersionResponse
-> f GetFunctionDefinitionVersionResponse
getFunctionDefinitionVersionResponse_definition = (GetFunctionDefinitionVersionResponse
 -> Maybe FunctionDefinitionVersion)
-> (GetFunctionDefinitionVersionResponse
    -> Maybe FunctionDefinitionVersion
    -> GetFunctionDefinitionVersionResponse)
-> Lens
     GetFunctionDefinitionVersionResponse
     GetFunctionDefinitionVersionResponse
     (Maybe FunctionDefinitionVersion)
     (Maybe FunctionDefinitionVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionDefinitionVersionResponse' {Maybe FunctionDefinitionVersion
definition :: Maybe FunctionDefinitionVersion
$sel:definition:GetFunctionDefinitionVersionResponse' :: GetFunctionDefinitionVersionResponse
-> Maybe FunctionDefinitionVersion
definition} -> Maybe FunctionDefinitionVersion
definition) (\s :: GetFunctionDefinitionVersionResponse
s@GetFunctionDefinitionVersionResponse' {} Maybe FunctionDefinitionVersion
a -> GetFunctionDefinitionVersionResponse
s {$sel:definition:GetFunctionDefinitionVersionResponse' :: Maybe FunctionDefinitionVersion
definition = Maybe FunctionDefinitionVersion
a} :: GetFunctionDefinitionVersionResponse)

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

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

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

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

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

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

instance
  Prelude.NFData
    GetFunctionDefinitionVersionResponse