{-# 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.GetFunctionDefinition
-- 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, including its
-- creation time and latest version.
module Amazonka.Greengrass.GetFunctionDefinition
  ( -- * Creating a Request
    GetFunctionDefinition (..),
    newGetFunctionDefinition,

    -- * Request Lenses
    getFunctionDefinition_functionDefinitionId,

    -- * Destructuring the Response
    GetFunctionDefinitionResponse (..),
    newGetFunctionDefinitionResponse,

    -- * Response Lenses
    getFunctionDefinitionResponse_latestVersionArn,
    getFunctionDefinitionResponse_arn,
    getFunctionDefinitionResponse_name,
    getFunctionDefinitionResponse_creationTimestamp,
    getFunctionDefinitionResponse_id,
    getFunctionDefinitionResponse_latestVersion,
    getFunctionDefinitionResponse_lastUpdatedTimestamp,
    getFunctionDefinitionResponse_tags,
    getFunctionDefinitionResponse_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:/ 'newGetFunctionDefinition' smart constructor.
data GetFunctionDefinition = GetFunctionDefinition'
  { -- | The ID of the Lambda function definition.
    GetFunctionDefinition -> Text
functionDefinitionId :: Prelude.Text
  }
  deriving (GetFunctionDefinition -> GetFunctionDefinition -> Bool
(GetFunctionDefinition -> GetFunctionDefinition -> Bool)
-> (GetFunctionDefinition -> GetFunctionDefinition -> Bool)
-> Eq GetFunctionDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFunctionDefinition -> GetFunctionDefinition -> Bool
$c/= :: GetFunctionDefinition -> GetFunctionDefinition -> Bool
== :: GetFunctionDefinition -> GetFunctionDefinition -> Bool
$c== :: GetFunctionDefinition -> GetFunctionDefinition -> Bool
Prelude.Eq, ReadPrec [GetFunctionDefinition]
ReadPrec GetFunctionDefinition
Int -> ReadS GetFunctionDefinition
ReadS [GetFunctionDefinition]
(Int -> ReadS GetFunctionDefinition)
-> ReadS [GetFunctionDefinition]
-> ReadPrec GetFunctionDefinition
-> ReadPrec [GetFunctionDefinition]
-> Read GetFunctionDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFunctionDefinition]
$creadListPrec :: ReadPrec [GetFunctionDefinition]
readPrec :: ReadPrec GetFunctionDefinition
$creadPrec :: ReadPrec GetFunctionDefinition
readList :: ReadS [GetFunctionDefinition]
$creadList :: ReadS [GetFunctionDefinition]
readsPrec :: Int -> ReadS GetFunctionDefinition
$creadsPrec :: Int -> ReadS GetFunctionDefinition
Prelude.Read, Int -> GetFunctionDefinition -> ShowS
[GetFunctionDefinition] -> ShowS
GetFunctionDefinition -> String
(Int -> GetFunctionDefinition -> ShowS)
-> (GetFunctionDefinition -> String)
-> ([GetFunctionDefinition] -> ShowS)
-> Show GetFunctionDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFunctionDefinition] -> ShowS
$cshowList :: [GetFunctionDefinition] -> ShowS
show :: GetFunctionDefinition -> String
$cshow :: GetFunctionDefinition -> String
showsPrec :: Int -> GetFunctionDefinition -> ShowS
$cshowsPrec :: Int -> GetFunctionDefinition -> ShowS
Prelude.Show, (forall x. GetFunctionDefinition -> Rep GetFunctionDefinition x)
-> (forall x. Rep GetFunctionDefinition x -> GetFunctionDefinition)
-> Generic GetFunctionDefinition
forall x. Rep GetFunctionDefinition x -> GetFunctionDefinition
forall x. GetFunctionDefinition -> Rep GetFunctionDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetFunctionDefinition x -> GetFunctionDefinition
$cfrom :: forall x. GetFunctionDefinition -> Rep GetFunctionDefinition x
Prelude.Generic)

-- |
-- Create a value of 'GetFunctionDefinition' 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:
--
-- 'functionDefinitionId', 'getFunctionDefinition_functionDefinitionId' - The ID of the Lambda function definition.
newGetFunctionDefinition ::
  -- | 'functionDefinitionId'
  Prelude.Text ->
  GetFunctionDefinition
newGetFunctionDefinition :: Text -> GetFunctionDefinition
newGetFunctionDefinition Text
pFunctionDefinitionId_ =
  GetFunctionDefinition' :: Text -> GetFunctionDefinition
GetFunctionDefinition'
    { $sel:functionDefinitionId:GetFunctionDefinition' :: Text
functionDefinitionId =
        Text
pFunctionDefinitionId_
    }

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

instance Core.AWSRequest GetFunctionDefinition where
  type
    AWSResponse GetFunctionDefinition =
      GetFunctionDefinitionResponse
  request :: GetFunctionDefinition -> Request GetFunctionDefinition
request = Service -> GetFunctionDefinition -> Request GetFunctionDefinition
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetFunctionDefinition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetFunctionDefinition)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetFunctionDefinition))
-> Logger
-> Service
-> Proxy GetFunctionDefinition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetFunctionDefinition)))
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
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> GetFunctionDefinitionResponse
GetFunctionDefinitionResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> GetFunctionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetFunctionDefinitionResponse)
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
"LatestVersionArn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetFunctionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetFunctionDefinitionResponse)
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
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetFunctionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetFunctionDefinitionResponse)
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
"Name")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetFunctionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetFunctionDefinitionResponse)
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
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetFunctionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetFunctionDefinitionResponse)
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
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetFunctionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetFunctionDefinitionResponse)
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
"LatestVersion")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetFunctionDefinitionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text) -> Int -> GetFunctionDefinitionResponse)
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
"LastUpdatedTimestamp")
            Either
  String
  (Maybe (HashMap Text Text) -> Int -> GetFunctionDefinitionResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> GetFunctionDefinitionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetFunctionDefinitionResponse)
-> Either String Int -> Either String GetFunctionDefinitionResponse
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 GetFunctionDefinition

instance Prelude.NFData GetFunctionDefinition

instance Core.ToHeaders GetFunctionDefinition where
  toHeaders :: GetFunctionDefinition -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetFunctionDefinition -> 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 GetFunctionDefinition where
  toPath :: GetFunctionDefinition -> ByteString
toPath GetFunctionDefinition' {Text
functionDefinitionId :: Text
$sel:functionDefinitionId:GetFunctionDefinition' :: GetFunctionDefinition -> 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
      ]

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

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

-- |
-- Create a value of 'GetFunctionDefinitionResponse' 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:
--
-- 'latestVersionArn', 'getFunctionDefinitionResponse_latestVersionArn' - The ARN of the latest version associated with the definition.
--
-- 'arn', 'getFunctionDefinitionResponse_arn' - The ARN of the definition.
--
-- 'name', 'getFunctionDefinitionResponse_name' - The name of the definition.
--
-- 'creationTimestamp', 'getFunctionDefinitionResponse_creationTimestamp' - The time, in milliseconds since the epoch, when the definition was
-- created.
--
-- 'id', 'getFunctionDefinitionResponse_id' - The ID of the definition.
--
-- 'latestVersion', 'getFunctionDefinitionResponse_latestVersion' - The ID of the latest version associated with the definition.
--
-- 'lastUpdatedTimestamp', 'getFunctionDefinitionResponse_lastUpdatedTimestamp' - The time, in milliseconds since the epoch, when the definition was last
-- updated.
--
-- 'tags', 'getFunctionDefinitionResponse_tags' - Tag(s) attached to the resource arn.
--
-- 'httpStatus', 'getFunctionDefinitionResponse_httpStatus' - The response's http status code.
newGetFunctionDefinitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetFunctionDefinitionResponse
newGetFunctionDefinitionResponse :: Int -> GetFunctionDefinitionResponse
newGetFunctionDefinitionResponse Int
pHttpStatus_ =
  GetFunctionDefinitionResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> GetFunctionDefinitionResponse
GetFunctionDefinitionResponse'
    { $sel:latestVersionArn:GetFunctionDefinitionResponse' :: Maybe Text
latestVersionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GetFunctionDefinitionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetFunctionDefinitionResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetFunctionDefinitionResponse' :: Maybe Text
creationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetFunctionDefinitionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersion:GetFunctionDefinitionResponse' :: Maybe Text
latestVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTimestamp:GetFunctionDefinitionResponse' :: Maybe Text
lastUpdatedTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GetFunctionDefinitionResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetFunctionDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the latest version associated with the definition.
getFunctionDefinitionResponse_latestVersionArn :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_latestVersionArn :: (Maybe Text -> f (Maybe Text))
-> GetFunctionDefinitionResponse -> f GetFunctionDefinitionResponse
getFunctionDefinitionResponse_latestVersionArn = (GetFunctionDefinitionResponse -> Maybe Text)
-> (GetFunctionDefinitionResponse
    -> Maybe Text -> GetFunctionDefinitionResponse)
-> Lens
     GetFunctionDefinitionResponse
     GetFunctionDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionDefinitionResponse' {Maybe Text
latestVersionArn :: Maybe Text
$sel:latestVersionArn:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
latestVersionArn} -> Maybe Text
latestVersionArn) (\s :: GetFunctionDefinitionResponse
s@GetFunctionDefinitionResponse' {} Maybe Text
a -> GetFunctionDefinitionResponse
s {$sel:latestVersionArn:GetFunctionDefinitionResponse' :: Maybe Text
latestVersionArn = Maybe Text
a} :: GetFunctionDefinitionResponse)

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

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

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

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

-- | The ID of the latest version associated with the definition.
getFunctionDefinitionResponse_latestVersion :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_latestVersion :: (Maybe Text -> f (Maybe Text))
-> GetFunctionDefinitionResponse -> f GetFunctionDefinitionResponse
getFunctionDefinitionResponse_latestVersion = (GetFunctionDefinitionResponse -> Maybe Text)
-> (GetFunctionDefinitionResponse
    -> Maybe Text -> GetFunctionDefinitionResponse)
-> Lens
     GetFunctionDefinitionResponse
     GetFunctionDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionDefinitionResponse' {Maybe Text
latestVersion :: Maybe Text
$sel:latestVersion:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
latestVersion} -> Maybe Text
latestVersion) (\s :: GetFunctionDefinitionResponse
s@GetFunctionDefinitionResponse' {} Maybe Text
a -> GetFunctionDefinitionResponse
s {$sel:latestVersion:GetFunctionDefinitionResponse' :: Maybe Text
latestVersion = Maybe Text
a} :: GetFunctionDefinitionResponse)

-- | The time, in milliseconds since the epoch, when the definition was last
-- updated.
getFunctionDefinitionResponse_lastUpdatedTimestamp :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_lastUpdatedTimestamp :: (Maybe Text -> f (Maybe Text))
-> GetFunctionDefinitionResponse -> f GetFunctionDefinitionResponse
getFunctionDefinitionResponse_lastUpdatedTimestamp = (GetFunctionDefinitionResponse -> Maybe Text)
-> (GetFunctionDefinitionResponse
    -> Maybe Text -> GetFunctionDefinitionResponse)
-> Lens
     GetFunctionDefinitionResponse
     GetFunctionDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionDefinitionResponse' {Maybe Text
lastUpdatedTimestamp :: Maybe Text
$sel:lastUpdatedTimestamp:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
lastUpdatedTimestamp} -> Maybe Text
lastUpdatedTimestamp) (\s :: GetFunctionDefinitionResponse
s@GetFunctionDefinitionResponse' {} Maybe Text
a -> GetFunctionDefinitionResponse
s {$sel:lastUpdatedTimestamp:GetFunctionDefinitionResponse' :: Maybe Text
lastUpdatedTimestamp = Maybe Text
a} :: GetFunctionDefinitionResponse)

-- | Tag(s) attached to the resource arn.
getFunctionDefinitionResponse_tags :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getFunctionDefinitionResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetFunctionDefinitionResponse -> f GetFunctionDefinitionResponse
getFunctionDefinitionResponse_tags = (GetFunctionDefinitionResponse -> Maybe (HashMap Text Text))
-> (GetFunctionDefinitionResponse
    -> Maybe (HashMap Text Text) -> GetFunctionDefinitionResponse)
-> Lens
     GetFunctionDefinitionResponse
     GetFunctionDefinitionResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFunctionDefinitionResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetFunctionDefinitionResponse
s@GetFunctionDefinitionResponse' {} Maybe (HashMap Text Text)
a -> GetFunctionDefinitionResponse
s {$sel:tags:GetFunctionDefinitionResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetFunctionDefinitionResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetFunctionDefinitionResponse
 -> f GetFunctionDefinitionResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetFunctionDefinitionResponse
-> f GetFunctionDefinitionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetFunctionDefinitionResponse