{-# 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.Lambda.Types.LayerVersionContentOutput
-- 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.Lambda.Types.LayerVersionContentOutput where

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

-- | Details about a version of an
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html Lambda layer>.
--
-- /See:/ 'newLayerVersionContentOutput' smart constructor.
data LayerVersionContentOutput = LayerVersionContentOutput'
  { -- | The Amazon Resource Name (ARN) for a signing profile version.
    LayerVersionContentOutput -> Maybe Text
signingProfileVersionArn :: Prelude.Maybe Prelude.Text,
    -- | A link to the layer archive in Amazon S3 that is valid for 10 minutes.
    LayerVersionContentOutput -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of a signing job.
    LayerVersionContentOutput -> Maybe Text
signingJobArn :: Prelude.Maybe Prelude.Text,
    -- | The size of the layer archive in bytes.
    LayerVersionContentOutput -> Maybe Integer
codeSize :: Prelude.Maybe Prelude.Integer,
    -- | The SHA-256 hash of the layer archive.
    LayerVersionContentOutput -> Maybe Text
codeSha256 :: Prelude.Maybe Prelude.Text
  }
  deriving (LayerVersionContentOutput -> LayerVersionContentOutput -> Bool
(LayerVersionContentOutput -> LayerVersionContentOutput -> Bool)
-> (LayerVersionContentOutput -> LayerVersionContentOutput -> Bool)
-> Eq LayerVersionContentOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LayerVersionContentOutput -> LayerVersionContentOutput -> Bool
$c/= :: LayerVersionContentOutput -> LayerVersionContentOutput -> Bool
== :: LayerVersionContentOutput -> LayerVersionContentOutput -> Bool
$c== :: LayerVersionContentOutput -> LayerVersionContentOutput -> Bool
Prelude.Eq, ReadPrec [LayerVersionContentOutput]
ReadPrec LayerVersionContentOutput
Int -> ReadS LayerVersionContentOutput
ReadS [LayerVersionContentOutput]
(Int -> ReadS LayerVersionContentOutput)
-> ReadS [LayerVersionContentOutput]
-> ReadPrec LayerVersionContentOutput
-> ReadPrec [LayerVersionContentOutput]
-> Read LayerVersionContentOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LayerVersionContentOutput]
$creadListPrec :: ReadPrec [LayerVersionContentOutput]
readPrec :: ReadPrec LayerVersionContentOutput
$creadPrec :: ReadPrec LayerVersionContentOutput
readList :: ReadS [LayerVersionContentOutput]
$creadList :: ReadS [LayerVersionContentOutput]
readsPrec :: Int -> ReadS LayerVersionContentOutput
$creadsPrec :: Int -> ReadS LayerVersionContentOutput
Prelude.Read, Int -> LayerVersionContentOutput -> ShowS
[LayerVersionContentOutput] -> ShowS
LayerVersionContentOutput -> String
(Int -> LayerVersionContentOutput -> ShowS)
-> (LayerVersionContentOutput -> String)
-> ([LayerVersionContentOutput] -> ShowS)
-> Show LayerVersionContentOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LayerVersionContentOutput] -> ShowS
$cshowList :: [LayerVersionContentOutput] -> ShowS
show :: LayerVersionContentOutput -> String
$cshow :: LayerVersionContentOutput -> String
showsPrec :: Int -> LayerVersionContentOutput -> ShowS
$cshowsPrec :: Int -> LayerVersionContentOutput -> ShowS
Prelude.Show, (forall x.
 LayerVersionContentOutput -> Rep LayerVersionContentOutput x)
-> (forall x.
    Rep LayerVersionContentOutput x -> LayerVersionContentOutput)
-> Generic LayerVersionContentOutput
forall x.
Rep LayerVersionContentOutput x -> LayerVersionContentOutput
forall x.
LayerVersionContentOutput -> Rep LayerVersionContentOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LayerVersionContentOutput x -> LayerVersionContentOutput
$cfrom :: forall x.
LayerVersionContentOutput -> Rep LayerVersionContentOutput x
Prelude.Generic)

-- |
-- Create a value of 'LayerVersionContentOutput' 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:
--
-- 'signingProfileVersionArn', 'layerVersionContentOutput_signingProfileVersionArn' - The Amazon Resource Name (ARN) for a signing profile version.
--
-- 'location', 'layerVersionContentOutput_location' - A link to the layer archive in Amazon S3 that is valid for 10 minutes.
--
-- 'signingJobArn', 'layerVersionContentOutput_signingJobArn' - The Amazon Resource Name (ARN) of a signing job.
--
-- 'codeSize', 'layerVersionContentOutput_codeSize' - The size of the layer archive in bytes.
--
-- 'codeSha256', 'layerVersionContentOutput_codeSha256' - The SHA-256 hash of the layer archive.
newLayerVersionContentOutput ::
  LayerVersionContentOutput
newLayerVersionContentOutput :: LayerVersionContentOutput
newLayerVersionContentOutput =
  LayerVersionContentOutput' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LayerVersionContentOutput
LayerVersionContentOutput'
    { $sel:signingProfileVersionArn:LayerVersionContentOutput' :: Maybe Text
signingProfileVersionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:LayerVersionContentOutput' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:signingJobArn:LayerVersionContentOutput' :: Maybe Text
signingJobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:codeSize:LayerVersionContentOutput' :: Maybe Integer
codeSize = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:codeSha256:LayerVersionContentOutput' :: Maybe Text
codeSha256 = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) for a signing profile version.
layerVersionContentOutput_signingProfileVersionArn :: Lens.Lens' LayerVersionContentOutput (Prelude.Maybe Prelude.Text)
layerVersionContentOutput_signingProfileVersionArn :: (Maybe Text -> f (Maybe Text))
-> LayerVersionContentOutput -> f LayerVersionContentOutput
layerVersionContentOutput_signingProfileVersionArn = (LayerVersionContentOutput -> Maybe Text)
-> (LayerVersionContentOutput
    -> Maybe Text -> LayerVersionContentOutput)
-> Lens
     LayerVersionContentOutput
     LayerVersionContentOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LayerVersionContentOutput' {Maybe Text
signingProfileVersionArn :: Maybe Text
$sel:signingProfileVersionArn:LayerVersionContentOutput' :: LayerVersionContentOutput -> Maybe Text
signingProfileVersionArn} -> Maybe Text
signingProfileVersionArn) (\s :: LayerVersionContentOutput
s@LayerVersionContentOutput' {} Maybe Text
a -> LayerVersionContentOutput
s {$sel:signingProfileVersionArn:LayerVersionContentOutput' :: Maybe Text
signingProfileVersionArn = Maybe Text
a} :: LayerVersionContentOutput)

-- | A link to the layer archive in Amazon S3 that is valid for 10 minutes.
layerVersionContentOutput_location :: Lens.Lens' LayerVersionContentOutput (Prelude.Maybe Prelude.Text)
layerVersionContentOutput_location :: (Maybe Text -> f (Maybe Text))
-> LayerVersionContentOutput -> f LayerVersionContentOutput
layerVersionContentOutput_location = (LayerVersionContentOutput -> Maybe Text)
-> (LayerVersionContentOutput
    -> Maybe Text -> LayerVersionContentOutput)
-> Lens
     LayerVersionContentOutput
     LayerVersionContentOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LayerVersionContentOutput' {Maybe Text
location :: Maybe Text
$sel:location:LayerVersionContentOutput' :: LayerVersionContentOutput -> Maybe Text
location} -> Maybe Text
location) (\s :: LayerVersionContentOutput
s@LayerVersionContentOutput' {} Maybe Text
a -> LayerVersionContentOutput
s {$sel:location:LayerVersionContentOutput' :: Maybe Text
location = Maybe Text
a} :: LayerVersionContentOutput)

-- | The Amazon Resource Name (ARN) of a signing job.
layerVersionContentOutput_signingJobArn :: Lens.Lens' LayerVersionContentOutput (Prelude.Maybe Prelude.Text)
layerVersionContentOutput_signingJobArn :: (Maybe Text -> f (Maybe Text))
-> LayerVersionContentOutput -> f LayerVersionContentOutput
layerVersionContentOutput_signingJobArn = (LayerVersionContentOutput -> Maybe Text)
-> (LayerVersionContentOutput
    -> Maybe Text -> LayerVersionContentOutput)
-> Lens
     LayerVersionContentOutput
     LayerVersionContentOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LayerVersionContentOutput' {Maybe Text
signingJobArn :: Maybe Text
$sel:signingJobArn:LayerVersionContentOutput' :: LayerVersionContentOutput -> Maybe Text
signingJobArn} -> Maybe Text
signingJobArn) (\s :: LayerVersionContentOutput
s@LayerVersionContentOutput' {} Maybe Text
a -> LayerVersionContentOutput
s {$sel:signingJobArn:LayerVersionContentOutput' :: Maybe Text
signingJobArn = Maybe Text
a} :: LayerVersionContentOutput)

-- | The size of the layer archive in bytes.
layerVersionContentOutput_codeSize :: Lens.Lens' LayerVersionContentOutput (Prelude.Maybe Prelude.Integer)
layerVersionContentOutput_codeSize :: (Maybe Integer -> f (Maybe Integer))
-> LayerVersionContentOutput -> f LayerVersionContentOutput
layerVersionContentOutput_codeSize = (LayerVersionContentOutput -> Maybe Integer)
-> (LayerVersionContentOutput
    -> Maybe Integer -> LayerVersionContentOutput)
-> Lens
     LayerVersionContentOutput
     LayerVersionContentOutput
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LayerVersionContentOutput' {Maybe Integer
codeSize :: Maybe Integer
$sel:codeSize:LayerVersionContentOutput' :: LayerVersionContentOutput -> Maybe Integer
codeSize} -> Maybe Integer
codeSize) (\s :: LayerVersionContentOutput
s@LayerVersionContentOutput' {} Maybe Integer
a -> LayerVersionContentOutput
s {$sel:codeSize:LayerVersionContentOutput' :: Maybe Integer
codeSize = Maybe Integer
a} :: LayerVersionContentOutput)

-- | The SHA-256 hash of the layer archive.
layerVersionContentOutput_codeSha256 :: Lens.Lens' LayerVersionContentOutput (Prelude.Maybe Prelude.Text)
layerVersionContentOutput_codeSha256 :: (Maybe Text -> f (Maybe Text))
-> LayerVersionContentOutput -> f LayerVersionContentOutput
layerVersionContentOutput_codeSha256 = (LayerVersionContentOutput -> Maybe Text)
-> (LayerVersionContentOutput
    -> Maybe Text -> LayerVersionContentOutput)
-> Lens
     LayerVersionContentOutput
     LayerVersionContentOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LayerVersionContentOutput' {Maybe Text
codeSha256 :: Maybe Text
$sel:codeSha256:LayerVersionContentOutput' :: LayerVersionContentOutput -> Maybe Text
codeSha256} -> Maybe Text
codeSha256) (\s :: LayerVersionContentOutput
s@LayerVersionContentOutput' {} Maybe Text
a -> LayerVersionContentOutput
s {$sel:codeSha256:LayerVersionContentOutput' :: Maybe Text
codeSha256 = Maybe Text
a} :: LayerVersionContentOutput)

instance Core.FromJSON LayerVersionContentOutput where
  parseJSON :: Value -> Parser LayerVersionContentOutput
parseJSON =
    String
-> (Object -> Parser LayerVersionContentOutput)
-> Value
-> Parser LayerVersionContentOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LayerVersionContentOutput"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LayerVersionContentOutput
LayerVersionContentOutput'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Text
 -> LayerVersionContentOutput)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> LayerVersionContentOutput)
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
"SigningProfileVersionArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> LayerVersionContentOutput)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Integer -> Maybe Text -> LayerVersionContentOutput)
forall (f :: * -> *) a b. Applicative f => 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
"Location")
            Parser
  (Maybe Text
   -> Maybe Integer -> Maybe Text -> LayerVersionContentOutput)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer -> Maybe Text -> LayerVersionContentOutput)
forall (f :: * -> *) a b. Applicative f => 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
"SigningJobArn")
            Parser (Maybe Integer -> Maybe Text -> LayerVersionContentOutput)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> LayerVersionContentOutput)
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
"CodeSize")
            Parser (Maybe Text -> LayerVersionContentOutput)
-> Parser (Maybe Text) -> Parser LayerVersionContentOutput
forall (f :: * -> *) a b. Applicative f => 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
"CodeSha256")
      )

instance Prelude.Hashable LayerVersionContentOutput

instance Prelude.NFData LayerVersionContentOutput