{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_arn,
    getFunctionDefinitionResponse_creationTimestamp,
    getFunctionDefinitionResponse_id,
    getFunctionDefinitionResponse_lastUpdatedTimestamp,
    getFunctionDefinitionResponse_latestVersion,
    getFunctionDefinitionResponse_latestVersionArn,
    getFunctionDefinitionResponse_name,
    getFunctionDefinitionResponse_tags,
    getFunctionDefinitionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Greengrass.Types
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
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]
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
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. 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'
    { $sel:functionDefinitionId:GetFunctionDefinition' :: Text
functionDefinitionId =
        Text
pFunctionDefinitionId_
    }

-- | The ID of the Lambda function definition.
getFunctionDefinition_functionDefinitionId :: Lens.Lens' GetFunctionDefinition Prelude.Text
getFunctionDefinition_functionDefinitionId :: Lens' GetFunctionDefinition Text
getFunctionDefinition_functionDefinitionId = 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 :: (Service -> Service)
-> GetFunctionDefinition -> Request GetFunctionDefinition
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetFunctionDefinition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetFunctionDefinition)))
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
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> GetFunctionDefinitionResponse
GetFunctionDefinitionResponse'
            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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe 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 (Maybe a)
Data..?> Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastUpdatedTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LatestVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LatestVersionArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            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))
      )

instance Prelude.Hashable GetFunctionDefinition where
  hashWithSalt :: Int -> GetFunctionDefinition -> Int
hashWithSalt Int
_salt GetFunctionDefinition' {Text
functionDefinitionId :: Text
$sel:functionDefinitionId:GetFunctionDefinition' :: GetFunctionDefinition -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionDefinitionId

instance Prelude.NFData GetFunctionDefinition where
  rnf :: GetFunctionDefinition -> ()
rnf GetFunctionDefinition' {Text
functionDefinitionId :: Text
$sel:functionDefinitionId:GetFunctionDefinition' :: GetFunctionDefinition -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
functionDefinitionId

instance Data.ToHeaders GetFunctionDefinition where
  toHeaders :: GetFunctionDefinition -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath GetFunctionDefinition where
  toPath :: GetFunctionDefinition -> ByteString
toPath GetFunctionDefinition' {Text
functionDefinitionId :: Text
$sel:functionDefinitionId:GetFunctionDefinition' :: GetFunctionDefinition -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/functions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionDefinitionId
      ]

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

-- | /See:/ 'newGetFunctionDefinitionResponse' smart constructor.
data GetFunctionDefinitionResponse = GetFunctionDefinitionResponse'
  { -- | The ARN of the definition.
    GetFunctionDefinitionResponse -> Maybe Text
arn :: 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 time, in milliseconds since the epoch, when the definition was last
    -- updated.
    GetFunctionDefinitionResponse -> Maybe Text
lastUpdatedTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The ID of the latest version associated with the definition.
    GetFunctionDefinitionResponse -> Maybe Text
latestVersion :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the latest version associated with the definition.
    GetFunctionDefinitionResponse -> Maybe Text
latestVersionArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the definition.
    GetFunctionDefinitionResponse -> Maybe Text
name :: 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
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]
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
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.
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:
--
-- 'arn', 'getFunctionDefinitionResponse_arn' - The ARN 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.
--
-- 'lastUpdatedTimestamp', 'getFunctionDefinitionResponse_lastUpdatedTimestamp' - The time, in milliseconds since the epoch, when the definition was last
-- updated.
--
-- 'latestVersion', 'getFunctionDefinitionResponse_latestVersion' - The ID of the latest version associated with the definition.
--
-- 'latestVersionArn', 'getFunctionDefinitionResponse_latestVersionArn' - The ARN of the latest version associated with the definition.
--
-- 'name', 'getFunctionDefinitionResponse_name' - The name of the definition.
--
-- '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'
    { $sel:arn:GetFunctionDefinitionResponse' :: Maybe Text
arn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetFunctionDefinitionResponse' :: Maybe Text
creationTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetFunctionDefinitionResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTimestamp:GetFunctionDefinitionResponse' :: Maybe Text
lastUpdatedTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersion:GetFunctionDefinitionResponse' :: Maybe Text
latestVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersionArn:GetFunctionDefinitionResponse' :: Maybe Text
latestVersionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetFunctionDefinitionResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GetFunctionDefinitionResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetFunctionDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the definition.
getFunctionDefinitionResponse_arn :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_arn :: Lens' GetFunctionDefinitionResponse (Maybe Text)
getFunctionDefinitionResponse_arn = 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 time, in milliseconds since the epoch, when the definition was
-- created.
getFunctionDefinitionResponse_creationTimestamp :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_creationTimestamp :: Lens' GetFunctionDefinitionResponse (Maybe Text)
getFunctionDefinitionResponse_creationTimestamp = 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 :: Lens' GetFunctionDefinitionResponse (Maybe Text)
getFunctionDefinitionResponse_id = 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 time, in milliseconds since the epoch, when the definition was last
-- updated.
getFunctionDefinitionResponse_lastUpdatedTimestamp :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_lastUpdatedTimestamp :: Lens' GetFunctionDefinitionResponse (Maybe Text)
getFunctionDefinitionResponse_lastUpdatedTimestamp = 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)

-- | The ID of the latest version associated with the definition.
getFunctionDefinitionResponse_latestVersion :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_latestVersion :: Lens' GetFunctionDefinitionResponse (Maybe Text)
getFunctionDefinitionResponse_latestVersion = 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 ARN of the latest version associated with the definition.
getFunctionDefinitionResponse_latestVersionArn :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_latestVersionArn :: Lens' GetFunctionDefinitionResponse (Maybe Text)
getFunctionDefinitionResponse_latestVersionArn = 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 name of the definition.
getFunctionDefinitionResponse_name :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe Prelude.Text)
getFunctionDefinitionResponse_name :: Lens' GetFunctionDefinitionResponse (Maybe Text)
getFunctionDefinitionResponse_name = 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)

-- | Tag(s) attached to the resource arn.
getFunctionDefinitionResponse_tags :: Lens.Lens' GetFunctionDefinitionResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getFunctionDefinitionResponse_tags :: Lens' GetFunctionDefinitionResponse (Maybe (HashMap Text Text))
getFunctionDefinitionResponse_tags = 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) 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

-- | The response's http status code.
getFunctionDefinitionResponse_httpStatus :: Lens.Lens' GetFunctionDefinitionResponse Prelude.Int
getFunctionDefinitionResponse_httpStatus :: Lens' GetFunctionDefinitionResponse Int
getFunctionDefinitionResponse_httpStatus = 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 where
  rnf :: GetFunctionDefinitionResponse -> ()
rnf GetFunctionDefinitionResponse' {Int
Maybe Text
Maybe (HashMap Text Text)
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
latestVersionArn :: Maybe Text
latestVersion :: Maybe Text
lastUpdatedTimestamp :: Maybe Text
id :: Maybe Text
creationTimestamp :: Maybe Text
arn :: Maybe Text
$sel:httpStatus:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Int
$sel:tags:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe (HashMap Text Text)
$sel:name:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
$sel:latestVersionArn:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
$sel:latestVersion:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
$sel:lastUpdatedTimestamp:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
$sel:id:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
$sel:creationTimestamp:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> Maybe Text
$sel:arn:GetFunctionDefinitionResponse' :: GetFunctionDefinitionResponse -> 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 Maybe Text
creationTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastUpdatedTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
latestVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
latestVersionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus