{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SecurityHub.Types.AwsLambdaLayerVersionDetails
-- 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)
module Amazonka.SecurityHub.Types.AwsLambdaLayerVersionDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details about a Lambda layer version.
--
-- /See:/ 'newAwsLambdaLayerVersionDetails' smart constructor.
data AwsLambdaLayerVersionDetails = AwsLambdaLayerVersionDetails'
  { -- | Indicates when the version was created.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsLambdaLayerVersionDetails -> Maybe Text
createdDate :: Prelude.Maybe Prelude.Text,
    -- | The version number.
    AwsLambdaLayerVersionDetails -> Maybe Integer
version :: Prelude.Maybe Prelude.Integer,
    -- | The layer\'s compatible runtimes. Maximum number of five items.
    --
    -- Valid values: @nodejs10.x@ | @nodejs12.x@ | @java8@ | @java11@ |
    -- @python2.7@ | @python3.6@ | @python3.7@ | @python3.8@ | @dotnetcore1.0@
    -- | @dotnetcore2.1@ | @go1.x@ | @ruby2.5@ | @provided@
    AwsLambdaLayerVersionDetails -> Maybe [Text]
compatibleRuntimes :: Prelude.Maybe [Prelude.Text]
  }
  deriving (AwsLambdaLayerVersionDetails
-> AwsLambdaLayerVersionDetails -> Bool
(AwsLambdaLayerVersionDetails
 -> AwsLambdaLayerVersionDetails -> Bool)
-> (AwsLambdaLayerVersionDetails
    -> AwsLambdaLayerVersionDetails -> Bool)
-> Eq AwsLambdaLayerVersionDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsLambdaLayerVersionDetails
-> AwsLambdaLayerVersionDetails -> Bool
$c/= :: AwsLambdaLayerVersionDetails
-> AwsLambdaLayerVersionDetails -> Bool
== :: AwsLambdaLayerVersionDetails
-> AwsLambdaLayerVersionDetails -> Bool
$c== :: AwsLambdaLayerVersionDetails
-> AwsLambdaLayerVersionDetails -> Bool
Prelude.Eq, ReadPrec [AwsLambdaLayerVersionDetails]
ReadPrec AwsLambdaLayerVersionDetails
Int -> ReadS AwsLambdaLayerVersionDetails
ReadS [AwsLambdaLayerVersionDetails]
(Int -> ReadS AwsLambdaLayerVersionDetails)
-> ReadS [AwsLambdaLayerVersionDetails]
-> ReadPrec AwsLambdaLayerVersionDetails
-> ReadPrec [AwsLambdaLayerVersionDetails]
-> Read AwsLambdaLayerVersionDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsLambdaLayerVersionDetails]
$creadListPrec :: ReadPrec [AwsLambdaLayerVersionDetails]
readPrec :: ReadPrec AwsLambdaLayerVersionDetails
$creadPrec :: ReadPrec AwsLambdaLayerVersionDetails
readList :: ReadS [AwsLambdaLayerVersionDetails]
$creadList :: ReadS [AwsLambdaLayerVersionDetails]
readsPrec :: Int -> ReadS AwsLambdaLayerVersionDetails
$creadsPrec :: Int -> ReadS AwsLambdaLayerVersionDetails
Prelude.Read, Int -> AwsLambdaLayerVersionDetails -> ShowS
[AwsLambdaLayerVersionDetails] -> ShowS
AwsLambdaLayerVersionDetails -> String
(Int -> AwsLambdaLayerVersionDetails -> ShowS)
-> (AwsLambdaLayerVersionDetails -> String)
-> ([AwsLambdaLayerVersionDetails] -> ShowS)
-> Show AwsLambdaLayerVersionDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsLambdaLayerVersionDetails] -> ShowS
$cshowList :: [AwsLambdaLayerVersionDetails] -> ShowS
show :: AwsLambdaLayerVersionDetails -> String
$cshow :: AwsLambdaLayerVersionDetails -> String
showsPrec :: Int -> AwsLambdaLayerVersionDetails -> ShowS
$cshowsPrec :: Int -> AwsLambdaLayerVersionDetails -> ShowS
Prelude.Show, (forall x.
 AwsLambdaLayerVersionDetails -> Rep AwsLambdaLayerVersionDetails x)
-> (forall x.
    Rep AwsLambdaLayerVersionDetails x -> AwsLambdaLayerVersionDetails)
-> Generic AwsLambdaLayerVersionDetails
forall x.
Rep AwsLambdaLayerVersionDetails x -> AwsLambdaLayerVersionDetails
forall x.
AwsLambdaLayerVersionDetails -> Rep AwsLambdaLayerVersionDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsLambdaLayerVersionDetails x -> AwsLambdaLayerVersionDetails
$cfrom :: forall x.
AwsLambdaLayerVersionDetails -> Rep AwsLambdaLayerVersionDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsLambdaLayerVersionDetails' 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:
--
-- 'createdDate', 'awsLambdaLayerVersionDetails_createdDate' - Indicates when the version was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'version', 'awsLambdaLayerVersionDetails_version' - The version number.
--
-- 'compatibleRuntimes', 'awsLambdaLayerVersionDetails_compatibleRuntimes' - The layer\'s compatible runtimes. Maximum number of five items.
--
-- Valid values: @nodejs10.x@ | @nodejs12.x@ | @java8@ | @java11@ |
-- @python2.7@ | @python3.6@ | @python3.7@ | @python3.8@ | @dotnetcore1.0@
-- | @dotnetcore2.1@ | @go1.x@ | @ruby2.5@ | @provided@
newAwsLambdaLayerVersionDetails ::
  AwsLambdaLayerVersionDetails
newAwsLambdaLayerVersionDetails :: AwsLambdaLayerVersionDetails
newAwsLambdaLayerVersionDetails =
  AwsLambdaLayerVersionDetails' :: Maybe Text
-> Maybe Integer -> Maybe [Text] -> AwsLambdaLayerVersionDetails
AwsLambdaLayerVersionDetails'
    { $sel:createdDate:AwsLambdaLayerVersionDetails' :: Maybe Text
createdDate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:AwsLambdaLayerVersionDetails' :: Maybe Integer
version = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleRuntimes:AwsLambdaLayerVersionDetails' :: Maybe [Text]
compatibleRuntimes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates when the version was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsLambdaLayerVersionDetails_createdDate :: Lens.Lens' AwsLambdaLayerVersionDetails (Prelude.Maybe Prelude.Text)
awsLambdaLayerVersionDetails_createdDate :: (Maybe Text -> f (Maybe Text))
-> AwsLambdaLayerVersionDetails -> f AwsLambdaLayerVersionDetails
awsLambdaLayerVersionDetails_createdDate = (AwsLambdaLayerVersionDetails -> Maybe Text)
-> (AwsLambdaLayerVersionDetails
    -> Maybe Text -> AwsLambdaLayerVersionDetails)
-> Lens
     AwsLambdaLayerVersionDetails
     AwsLambdaLayerVersionDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsLambdaLayerVersionDetails' {Maybe Text
createdDate :: Maybe Text
$sel:createdDate:AwsLambdaLayerVersionDetails' :: AwsLambdaLayerVersionDetails -> Maybe Text
createdDate} -> Maybe Text
createdDate) (\s :: AwsLambdaLayerVersionDetails
s@AwsLambdaLayerVersionDetails' {} Maybe Text
a -> AwsLambdaLayerVersionDetails
s {$sel:createdDate:AwsLambdaLayerVersionDetails' :: Maybe Text
createdDate = Maybe Text
a} :: AwsLambdaLayerVersionDetails)

-- | The version number.
awsLambdaLayerVersionDetails_version :: Lens.Lens' AwsLambdaLayerVersionDetails (Prelude.Maybe Prelude.Integer)
awsLambdaLayerVersionDetails_version :: (Maybe Integer -> f (Maybe Integer))
-> AwsLambdaLayerVersionDetails -> f AwsLambdaLayerVersionDetails
awsLambdaLayerVersionDetails_version = (AwsLambdaLayerVersionDetails -> Maybe Integer)
-> (AwsLambdaLayerVersionDetails
    -> Maybe Integer -> AwsLambdaLayerVersionDetails)
-> Lens
     AwsLambdaLayerVersionDetails
     AwsLambdaLayerVersionDetails
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsLambdaLayerVersionDetails' {Maybe Integer
version :: Maybe Integer
$sel:version:AwsLambdaLayerVersionDetails' :: AwsLambdaLayerVersionDetails -> Maybe Integer
version} -> Maybe Integer
version) (\s :: AwsLambdaLayerVersionDetails
s@AwsLambdaLayerVersionDetails' {} Maybe Integer
a -> AwsLambdaLayerVersionDetails
s {$sel:version:AwsLambdaLayerVersionDetails' :: Maybe Integer
version = Maybe Integer
a} :: AwsLambdaLayerVersionDetails)

-- | The layer\'s compatible runtimes. Maximum number of five items.
--
-- Valid values: @nodejs10.x@ | @nodejs12.x@ | @java8@ | @java11@ |
-- @python2.7@ | @python3.6@ | @python3.7@ | @python3.8@ | @dotnetcore1.0@
-- | @dotnetcore2.1@ | @go1.x@ | @ruby2.5@ | @provided@
awsLambdaLayerVersionDetails_compatibleRuntimes :: Lens.Lens' AwsLambdaLayerVersionDetails (Prelude.Maybe [Prelude.Text])
awsLambdaLayerVersionDetails_compatibleRuntimes :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsLambdaLayerVersionDetails -> f AwsLambdaLayerVersionDetails
awsLambdaLayerVersionDetails_compatibleRuntimes = (AwsLambdaLayerVersionDetails -> Maybe [Text])
-> (AwsLambdaLayerVersionDetails
    -> Maybe [Text] -> AwsLambdaLayerVersionDetails)
-> Lens
     AwsLambdaLayerVersionDetails
     AwsLambdaLayerVersionDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsLambdaLayerVersionDetails' {Maybe [Text]
compatibleRuntimes :: Maybe [Text]
$sel:compatibleRuntimes:AwsLambdaLayerVersionDetails' :: AwsLambdaLayerVersionDetails -> Maybe [Text]
compatibleRuntimes} -> Maybe [Text]
compatibleRuntimes) (\s :: AwsLambdaLayerVersionDetails
s@AwsLambdaLayerVersionDetails' {} Maybe [Text]
a -> AwsLambdaLayerVersionDetails
s {$sel:compatibleRuntimes:AwsLambdaLayerVersionDetails' :: Maybe [Text]
compatibleRuntimes = Maybe [Text]
a} :: AwsLambdaLayerVersionDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsLambdaLayerVersionDetails -> f AwsLambdaLayerVersionDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsLambdaLayerVersionDetails
-> f AwsLambdaLayerVersionDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON AwsLambdaLayerVersionDetails where
  parseJSON :: Value -> Parser AwsLambdaLayerVersionDetails
parseJSON =
    String
-> (Object -> Parser AwsLambdaLayerVersionDetails)
-> Value
-> Parser AwsLambdaLayerVersionDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsLambdaLayerVersionDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Integer -> Maybe [Text] -> AwsLambdaLayerVersionDetails
AwsLambdaLayerVersionDetails'
            (Maybe Text
 -> Maybe Integer -> Maybe [Text] -> AwsLambdaLayerVersionDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer -> Maybe [Text] -> AwsLambdaLayerVersionDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedDate")
            Parser
  (Maybe Integer -> Maybe [Text] -> AwsLambdaLayerVersionDetails)
-> Parser (Maybe Integer)
-> Parser (Maybe [Text] -> AwsLambdaLayerVersionDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser (Maybe [Text] -> AwsLambdaLayerVersionDetails)
-> Parser (Maybe [Text]) -> Parser AwsLambdaLayerVersionDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CompatibleRuntimes"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    AwsLambdaLayerVersionDetails

instance Prelude.NFData AwsLambdaLayerVersionDetails

instance Core.ToJSON AwsLambdaLayerVersionDetails where
  toJSON :: AwsLambdaLayerVersionDetails -> Value
toJSON AwsLambdaLayerVersionDetails' {Maybe Integer
Maybe [Text]
Maybe Text
compatibleRuntimes :: Maybe [Text]
version :: Maybe Integer
createdDate :: Maybe Text
$sel:compatibleRuntimes:AwsLambdaLayerVersionDetails' :: AwsLambdaLayerVersionDetails -> Maybe [Text]
$sel:version:AwsLambdaLayerVersionDetails' :: AwsLambdaLayerVersionDetails -> Maybe Integer
$sel:createdDate:AwsLambdaLayerVersionDetails' :: AwsLambdaLayerVersionDetails -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CreatedDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
createdDate,
            (Text
"Version" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
version,
            (Text
"CompatibleRuntimes" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
compatibleRuntimes
          ]
      )