{-# 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.Lambda.PublishLayerVersion
-- 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)
--
-- Creates an
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html Lambda layer>
-- from a ZIP archive. Each time you call @PublishLayerVersion@ with the
-- same layer name, a new version is created.
--
-- Add layers to your function with CreateFunction or
-- UpdateFunctionConfiguration.
module Amazonka.Lambda.PublishLayerVersion
  ( -- * Creating a Request
    PublishLayerVersion (..),
    newPublishLayerVersion,

    -- * Request Lenses
    publishLayerVersion_licenseInfo,
    publishLayerVersion_compatibleArchitectures,
    publishLayerVersion_description,
    publishLayerVersion_compatibleRuntimes,
    publishLayerVersion_layerName,
    publishLayerVersion_content,

    -- * Destructuring the Response
    PublishLayerVersionResponse (..),
    newPublishLayerVersionResponse,

    -- * Response Lenses
    publishLayerVersionResponse_layerVersionArn,
    publishLayerVersionResponse_content,
    publishLayerVersionResponse_createdDate,
    publishLayerVersionResponse_version,
    publishLayerVersionResponse_licenseInfo,
    publishLayerVersionResponse_compatibleArchitectures,
    publishLayerVersionResponse_layerArn,
    publishLayerVersionResponse_description,
    publishLayerVersionResponse_compatibleRuntimes,
    publishLayerVersionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Lambda.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:/ 'newPublishLayerVersion' smart constructor.
data PublishLayerVersion = PublishLayerVersion'
  { -- | The layer\'s software license. It can be any of the following:
    --
    -- -   An <https://spdx.org/licenses/ SPDX license identifier>. For
    --     example, @MIT@.
    --
    -- -   The URL of a license hosted on the internet. For example,
    --     @https:\/\/opensource.org\/licenses\/MIT@.
    --
    -- -   The full text of the license.
    PublishLayerVersion -> Maybe Text
licenseInfo :: Prelude.Maybe Prelude.Text,
    -- | A list of compatible
    -- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architectures>.
    PublishLayerVersion -> Maybe [Architecture]
compatibleArchitectures :: Prelude.Maybe [Architecture],
    -- | The description of the version.
    PublishLayerVersion -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A list of compatible
    -- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html function runtimes>.
    -- Used for filtering with ListLayers and ListLayerVersions.
    PublishLayerVersion -> Maybe [Runtime]
compatibleRuntimes :: Prelude.Maybe [Runtime],
    -- | The name or Amazon Resource Name (ARN) of the layer.
    PublishLayerVersion -> Text
layerName :: Prelude.Text,
    -- | The function layer archive.
    PublishLayerVersion -> LayerVersionContentInput
content :: LayerVersionContentInput
  }
  deriving (PublishLayerVersion -> PublishLayerVersion -> Bool
(PublishLayerVersion -> PublishLayerVersion -> Bool)
-> (PublishLayerVersion -> PublishLayerVersion -> Bool)
-> Eq PublishLayerVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublishLayerVersion -> PublishLayerVersion -> Bool
$c/= :: PublishLayerVersion -> PublishLayerVersion -> Bool
== :: PublishLayerVersion -> PublishLayerVersion -> Bool
$c== :: PublishLayerVersion -> PublishLayerVersion -> Bool
Prelude.Eq, Int -> PublishLayerVersion -> ShowS
[PublishLayerVersion] -> ShowS
PublishLayerVersion -> String
(Int -> PublishLayerVersion -> ShowS)
-> (PublishLayerVersion -> String)
-> ([PublishLayerVersion] -> ShowS)
-> Show PublishLayerVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublishLayerVersion] -> ShowS
$cshowList :: [PublishLayerVersion] -> ShowS
show :: PublishLayerVersion -> String
$cshow :: PublishLayerVersion -> String
showsPrec :: Int -> PublishLayerVersion -> ShowS
$cshowsPrec :: Int -> PublishLayerVersion -> ShowS
Prelude.Show, (forall x. PublishLayerVersion -> Rep PublishLayerVersion x)
-> (forall x. Rep PublishLayerVersion x -> PublishLayerVersion)
-> Generic PublishLayerVersion
forall x. Rep PublishLayerVersion x -> PublishLayerVersion
forall x. PublishLayerVersion -> Rep PublishLayerVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PublishLayerVersion x -> PublishLayerVersion
$cfrom :: forall x. PublishLayerVersion -> Rep PublishLayerVersion x
Prelude.Generic)

-- |
-- Create a value of 'PublishLayerVersion' 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:
--
-- 'licenseInfo', 'publishLayerVersion_licenseInfo' - The layer\'s software license. It can be any of the following:
--
-- -   An <https://spdx.org/licenses/ SPDX license identifier>. For
--     example, @MIT@.
--
-- -   The URL of a license hosted on the internet. For example,
--     @https:\/\/opensource.org\/licenses\/MIT@.
--
-- -   The full text of the license.
--
-- 'compatibleArchitectures', 'publishLayerVersion_compatibleArchitectures' - A list of compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architectures>.
--
-- 'description', 'publishLayerVersion_description' - The description of the version.
--
-- 'compatibleRuntimes', 'publishLayerVersion_compatibleRuntimes' - A list of compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html function runtimes>.
-- Used for filtering with ListLayers and ListLayerVersions.
--
-- 'layerName', 'publishLayerVersion_layerName' - The name or Amazon Resource Name (ARN) of the layer.
--
-- 'content', 'publishLayerVersion_content' - The function layer archive.
newPublishLayerVersion ::
  -- | 'layerName'
  Prelude.Text ->
  -- | 'content'
  LayerVersionContentInput ->
  PublishLayerVersion
newPublishLayerVersion :: Text -> LayerVersionContentInput -> PublishLayerVersion
newPublishLayerVersion Text
pLayerName_ LayerVersionContentInput
pContent_ =
  PublishLayerVersion' :: Maybe Text
-> Maybe [Architecture]
-> Maybe Text
-> Maybe [Runtime]
-> Text
-> LayerVersionContentInput
-> PublishLayerVersion
PublishLayerVersion'
    { $sel:licenseInfo:PublishLayerVersion' :: Maybe Text
licenseInfo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleArchitectures:PublishLayerVersion' :: Maybe [Architecture]
compatibleArchitectures = Maybe [Architecture]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:PublishLayerVersion' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleRuntimes:PublishLayerVersion' :: Maybe [Runtime]
compatibleRuntimes = Maybe [Runtime]
forall a. Maybe a
Prelude.Nothing,
      $sel:layerName:PublishLayerVersion' :: Text
layerName = Text
pLayerName_,
      $sel:content:PublishLayerVersion' :: LayerVersionContentInput
content = LayerVersionContentInput
pContent_
    }

-- | The layer\'s software license. It can be any of the following:
--
-- -   An <https://spdx.org/licenses/ SPDX license identifier>. For
--     example, @MIT@.
--
-- -   The URL of a license hosted on the internet. For example,
--     @https:\/\/opensource.org\/licenses\/MIT@.
--
-- -   The full text of the license.
publishLayerVersion_licenseInfo :: Lens.Lens' PublishLayerVersion (Prelude.Maybe Prelude.Text)
publishLayerVersion_licenseInfo :: (Maybe Text -> f (Maybe Text))
-> PublishLayerVersion -> f PublishLayerVersion
publishLayerVersion_licenseInfo = (PublishLayerVersion -> Maybe Text)
-> (PublishLayerVersion -> Maybe Text -> PublishLayerVersion)
-> Lens
     PublishLayerVersion PublishLayerVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersion' {Maybe Text
licenseInfo :: Maybe Text
$sel:licenseInfo:PublishLayerVersion' :: PublishLayerVersion -> Maybe Text
licenseInfo} -> Maybe Text
licenseInfo) (\s :: PublishLayerVersion
s@PublishLayerVersion' {} Maybe Text
a -> PublishLayerVersion
s {$sel:licenseInfo:PublishLayerVersion' :: Maybe Text
licenseInfo = Maybe Text
a} :: PublishLayerVersion)

-- | A list of compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architectures>.
publishLayerVersion_compatibleArchitectures :: Lens.Lens' PublishLayerVersion (Prelude.Maybe [Architecture])
publishLayerVersion_compatibleArchitectures :: (Maybe [Architecture] -> f (Maybe [Architecture]))
-> PublishLayerVersion -> f PublishLayerVersion
publishLayerVersion_compatibleArchitectures = (PublishLayerVersion -> Maybe [Architecture])
-> (PublishLayerVersion
    -> Maybe [Architecture] -> PublishLayerVersion)
-> Lens
     PublishLayerVersion
     PublishLayerVersion
     (Maybe [Architecture])
     (Maybe [Architecture])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersion' {Maybe [Architecture]
compatibleArchitectures :: Maybe [Architecture]
$sel:compatibleArchitectures:PublishLayerVersion' :: PublishLayerVersion -> Maybe [Architecture]
compatibleArchitectures} -> Maybe [Architecture]
compatibleArchitectures) (\s :: PublishLayerVersion
s@PublishLayerVersion' {} Maybe [Architecture]
a -> PublishLayerVersion
s {$sel:compatibleArchitectures:PublishLayerVersion' :: Maybe [Architecture]
compatibleArchitectures = Maybe [Architecture]
a} :: PublishLayerVersion) ((Maybe [Architecture] -> f (Maybe [Architecture]))
 -> PublishLayerVersion -> f PublishLayerVersion)
-> ((Maybe [Architecture] -> f (Maybe [Architecture]))
    -> Maybe [Architecture] -> f (Maybe [Architecture]))
-> (Maybe [Architecture] -> f (Maybe [Architecture]))
-> PublishLayerVersion
-> f PublishLayerVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Architecture] [Architecture] [Architecture] [Architecture]
-> Iso
     (Maybe [Architecture])
     (Maybe [Architecture])
     (Maybe [Architecture])
     (Maybe [Architecture])
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 [Architecture] [Architecture] [Architecture] [Architecture]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | A list of compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html function runtimes>.
-- Used for filtering with ListLayers and ListLayerVersions.
publishLayerVersion_compatibleRuntimes :: Lens.Lens' PublishLayerVersion (Prelude.Maybe [Runtime])
publishLayerVersion_compatibleRuntimes :: (Maybe [Runtime] -> f (Maybe [Runtime]))
-> PublishLayerVersion -> f PublishLayerVersion
publishLayerVersion_compatibleRuntimes = (PublishLayerVersion -> Maybe [Runtime])
-> (PublishLayerVersion -> Maybe [Runtime] -> PublishLayerVersion)
-> Lens
     PublishLayerVersion
     PublishLayerVersion
     (Maybe [Runtime])
     (Maybe [Runtime])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersion' {Maybe [Runtime]
compatibleRuntimes :: Maybe [Runtime]
$sel:compatibleRuntimes:PublishLayerVersion' :: PublishLayerVersion -> Maybe [Runtime]
compatibleRuntimes} -> Maybe [Runtime]
compatibleRuntimes) (\s :: PublishLayerVersion
s@PublishLayerVersion' {} Maybe [Runtime]
a -> PublishLayerVersion
s {$sel:compatibleRuntimes:PublishLayerVersion' :: Maybe [Runtime]
compatibleRuntimes = Maybe [Runtime]
a} :: PublishLayerVersion) ((Maybe [Runtime] -> f (Maybe [Runtime]))
 -> PublishLayerVersion -> f PublishLayerVersion)
-> ((Maybe [Runtime] -> f (Maybe [Runtime]))
    -> Maybe [Runtime] -> f (Maybe [Runtime]))
-> (Maybe [Runtime] -> f (Maybe [Runtime]))
-> PublishLayerVersion
-> f PublishLayerVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Runtime] [Runtime] [Runtime] [Runtime]
-> Iso
     (Maybe [Runtime])
     (Maybe [Runtime])
     (Maybe [Runtime])
     (Maybe [Runtime])
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 [Runtime] [Runtime] [Runtime] [Runtime]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name or Amazon Resource Name (ARN) of the layer.
publishLayerVersion_layerName :: Lens.Lens' PublishLayerVersion Prelude.Text
publishLayerVersion_layerName :: (Text -> f Text) -> PublishLayerVersion -> f PublishLayerVersion
publishLayerVersion_layerName = (PublishLayerVersion -> Text)
-> (PublishLayerVersion -> Text -> PublishLayerVersion)
-> Lens PublishLayerVersion PublishLayerVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersion' {Text
layerName :: Text
$sel:layerName:PublishLayerVersion' :: PublishLayerVersion -> Text
layerName} -> Text
layerName) (\s :: PublishLayerVersion
s@PublishLayerVersion' {} Text
a -> PublishLayerVersion
s {$sel:layerName:PublishLayerVersion' :: Text
layerName = Text
a} :: PublishLayerVersion)

-- | The function layer archive.
publishLayerVersion_content :: Lens.Lens' PublishLayerVersion LayerVersionContentInput
publishLayerVersion_content :: (LayerVersionContentInput -> f LayerVersionContentInput)
-> PublishLayerVersion -> f PublishLayerVersion
publishLayerVersion_content = (PublishLayerVersion -> LayerVersionContentInput)
-> (PublishLayerVersion
    -> LayerVersionContentInput -> PublishLayerVersion)
-> Lens
     PublishLayerVersion
     PublishLayerVersion
     LayerVersionContentInput
     LayerVersionContentInput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersion' {LayerVersionContentInput
content :: LayerVersionContentInput
$sel:content:PublishLayerVersion' :: PublishLayerVersion -> LayerVersionContentInput
content} -> LayerVersionContentInput
content) (\s :: PublishLayerVersion
s@PublishLayerVersion' {} LayerVersionContentInput
a -> PublishLayerVersion
s {$sel:content:PublishLayerVersion' :: LayerVersionContentInput
content = LayerVersionContentInput
a} :: PublishLayerVersion)

instance Core.AWSRequest PublishLayerVersion where
  type
    AWSResponse PublishLayerVersion =
      PublishLayerVersionResponse
  request :: PublishLayerVersion -> Request PublishLayerVersion
request = Service -> PublishLayerVersion -> Request PublishLayerVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PublishLayerVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PublishLayerVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PublishLayerVersion))
-> Logger
-> Service
-> Proxy PublishLayerVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PublishLayerVersion)))
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 LayerVersionContentOutput
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe [Architecture]
-> Maybe Text
-> Maybe Text
-> Maybe [Runtime]
-> Int
-> PublishLayerVersionResponse
PublishLayerVersionResponse'
            (Maybe Text
 -> Maybe LayerVersionContentOutput
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Text
 -> Maybe [Architecture]
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Runtime]
 -> Int
 -> PublishLayerVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe LayerVersionContentOutput
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe [Architecture]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Runtime]
      -> Int
      -> PublishLayerVersionResponse)
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
"LayerVersionArn")
            Either
  String
  (Maybe LayerVersionContentOutput
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe [Architecture]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Runtime]
   -> Int
   -> PublishLayerVersionResponse)
-> Either String (Maybe LayerVersionContentOutput)
-> Either
     String
     (Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe [Architecture]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Runtime]
      -> Int
      -> PublishLayerVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe LayerVersionContentOutput)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Content")
            Either
  String
  (Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe [Architecture]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Runtime]
   -> Int
   -> PublishLayerVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Maybe Text
      -> Maybe [Architecture]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Runtime]
      -> Int
      -> PublishLayerVersionResponse)
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
"CreatedDate")
            Either
  String
  (Maybe Integer
   -> Maybe Text
   -> Maybe [Architecture]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Runtime]
   -> Int
   -> PublishLayerVersionResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Text
      -> Maybe [Architecture]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Runtime]
      -> Int
      -> PublishLayerVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Version")
            Either
  String
  (Maybe Text
   -> Maybe [Architecture]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Runtime]
   -> Int
   -> PublishLayerVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Architecture]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Runtime]
      -> Int
      -> PublishLayerVersionResponse)
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
"LicenseInfo")
            Either
  String
  (Maybe [Architecture]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Runtime]
   -> Int
   -> PublishLayerVersionResponse)
-> Either String (Maybe [Architecture])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [Runtime]
      -> Int
      -> PublishLayerVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Architecture]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CompatibleArchitectures"
                            Either String (Maybe (Maybe [Architecture]))
-> Maybe [Architecture] -> Either String (Maybe [Architecture])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Architecture]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [Runtime]
   -> Int
   -> PublishLayerVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Runtime] -> Int -> PublishLayerVersionResponse)
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
"LayerArn")
            Either
  String
  (Maybe Text
   -> Maybe [Runtime] -> Int -> PublishLayerVersionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Runtime] -> Int -> PublishLayerVersionResponse)
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
"Description")
            Either
  String (Maybe [Runtime] -> Int -> PublishLayerVersionResponse)
-> Either String (Maybe [Runtime])
-> Either String (Int -> PublishLayerVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Runtime]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CompatibleRuntimes"
                            Either String (Maybe (Maybe [Runtime]))
-> Maybe [Runtime] -> Either String (Maybe [Runtime])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Runtime]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> PublishLayerVersionResponse)
-> Either String Int -> Either String PublishLayerVersionResponse
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 PublishLayerVersion

instance Prelude.NFData PublishLayerVersion

instance Core.ToHeaders PublishLayerVersion where
  toHeaders :: PublishLayerVersion -> ResponseHeaders
toHeaders = ResponseHeaders -> PublishLayerVersion -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON PublishLayerVersion where
  toJSON :: PublishLayerVersion -> Value
toJSON PublishLayerVersion' {Maybe [Architecture]
Maybe [Runtime]
Maybe Text
Text
LayerVersionContentInput
content :: LayerVersionContentInput
layerName :: Text
compatibleRuntimes :: Maybe [Runtime]
description :: Maybe Text
compatibleArchitectures :: Maybe [Architecture]
licenseInfo :: Maybe Text
$sel:content:PublishLayerVersion' :: PublishLayerVersion -> LayerVersionContentInput
$sel:layerName:PublishLayerVersion' :: PublishLayerVersion -> Text
$sel:compatibleRuntimes:PublishLayerVersion' :: PublishLayerVersion -> Maybe [Runtime]
$sel:description:PublishLayerVersion' :: PublishLayerVersion -> Maybe Text
$sel:compatibleArchitectures:PublishLayerVersion' :: PublishLayerVersion -> Maybe [Architecture]
$sel:licenseInfo:PublishLayerVersion' :: PublishLayerVersion -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LicenseInfo" 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
licenseInfo,
            (Text
"CompatibleArchitectures" Text -> [Architecture] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Architecture] -> Pair) -> Maybe [Architecture] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Architecture]
compatibleArchitectures,
            (Text
"Description" 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
description,
            (Text
"CompatibleRuntimes" Text -> [Runtime] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Runtime] -> Pair) -> Maybe [Runtime] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Runtime]
compatibleRuntimes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> LayerVersionContentInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LayerVersionContentInput
content)
          ]
      )

instance Core.ToPath PublishLayerVersion where
  toPath :: PublishLayerVersion -> ByteString
toPath PublishLayerVersion' {Maybe [Architecture]
Maybe [Runtime]
Maybe Text
Text
LayerVersionContentInput
content :: LayerVersionContentInput
layerName :: Text
compatibleRuntimes :: Maybe [Runtime]
description :: Maybe Text
compatibleArchitectures :: Maybe [Architecture]
licenseInfo :: Maybe Text
$sel:content:PublishLayerVersion' :: PublishLayerVersion -> LayerVersionContentInput
$sel:layerName:PublishLayerVersion' :: PublishLayerVersion -> Text
$sel:compatibleRuntimes:PublishLayerVersion' :: PublishLayerVersion -> Maybe [Runtime]
$sel:description:PublishLayerVersion' :: PublishLayerVersion -> Maybe Text
$sel:compatibleArchitectures:PublishLayerVersion' :: PublishLayerVersion -> Maybe [Architecture]
$sel:licenseInfo:PublishLayerVersion' :: PublishLayerVersion -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2018-10-31/layers/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
layerName,
        ByteString
"/versions"
      ]

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

-- | /See:/ 'newPublishLayerVersionResponse' smart constructor.
data PublishLayerVersionResponse = PublishLayerVersionResponse'
  { -- | The ARN of the layer version.
    PublishLayerVersionResponse -> Maybe Text
layerVersionArn :: Prelude.Maybe Prelude.Text,
    -- | Details about the layer version.
    PublishLayerVersionResponse -> Maybe LayerVersionContentOutput
content :: Prelude.Maybe LayerVersionContentOutput,
    -- | The date that the layer version was created, in
    -- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
    -- (YYYY-MM-DDThh:mm:ss.sTZD).
    PublishLayerVersionResponse -> Maybe Text
createdDate :: Prelude.Maybe Prelude.Text,
    -- | The version number.
    PublishLayerVersionResponse -> Maybe Integer
version :: Prelude.Maybe Prelude.Integer,
    -- | The layer\'s software license.
    PublishLayerVersionResponse -> Maybe Text
licenseInfo :: Prelude.Maybe Prelude.Text,
    -- | A list of compatible
    -- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architectures>.
    PublishLayerVersionResponse -> Maybe [Architecture]
compatibleArchitectures :: Prelude.Maybe [Architecture],
    -- | The ARN of the layer.
    PublishLayerVersionResponse -> Maybe Text
layerArn :: Prelude.Maybe Prelude.Text,
    -- | The description of the version.
    PublishLayerVersionResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The layer\'s compatible runtimes.
    PublishLayerVersionResponse -> Maybe [Runtime]
compatibleRuntimes :: Prelude.Maybe [Runtime],
    -- | The response's http status code.
    PublishLayerVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PublishLayerVersionResponse -> PublishLayerVersionResponse -> Bool
(PublishLayerVersionResponse
 -> PublishLayerVersionResponse -> Bool)
-> (PublishLayerVersionResponse
    -> PublishLayerVersionResponse -> Bool)
-> Eq PublishLayerVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublishLayerVersionResponse -> PublishLayerVersionResponse -> Bool
$c/= :: PublishLayerVersionResponse -> PublishLayerVersionResponse -> Bool
== :: PublishLayerVersionResponse -> PublishLayerVersionResponse -> Bool
$c== :: PublishLayerVersionResponse -> PublishLayerVersionResponse -> Bool
Prelude.Eq, ReadPrec [PublishLayerVersionResponse]
ReadPrec PublishLayerVersionResponse
Int -> ReadS PublishLayerVersionResponse
ReadS [PublishLayerVersionResponse]
(Int -> ReadS PublishLayerVersionResponse)
-> ReadS [PublishLayerVersionResponse]
-> ReadPrec PublishLayerVersionResponse
-> ReadPrec [PublishLayerVersionResponse]
-> Read PublishLayerVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublishLayerVersionResponse]
$creadListPrec :: ReadPrec [PublishLayerVersionResponse]
readPrec :: ReadPrec PublishLayerVersionResponse
$creadPrec :: ReadPrec PublishLayerVersionResponse
readList :: ReadS [PublishLayerVersionResponse]
$creadList :: ReadS [PublishLayerVersionResponse]
readsPrec :: Int -> ReadS PublishLayerVersionResponse
$creadsPrec :: Int -> ReadS PublishLayerVersionResponse
Prelude.Read, Int -> PublishLayerVersionResponse -> ShowS
[PublishLayerVersionResponse] -> ShowS
PublishLayerVersionResponse -> String
(Int -> PublishLayerVersionResponse -> ShowS)
-> (PublishLayerVersionResponse -> String)
-> ([PublishLayerVersionResponse] -> ShowS)
-> Show PublishLayerVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublishLayerVersionResponse] -> ShowS
$cshowList :: [PublishLayerVersionResponse] -> ShowS
show :: PublishLayerVersionResponse -> String
$cshow :: PublishLayerVersionResponse -> String
showsPrec :: Int -> PublishLayerVersionResponse -> ShowS
$cshowsPrec :: Int -> PublishLayerVersionResponse -> ShowS
Prelude.Show, (forall x.
 PublishLayerVersionResponse -> Rep PublishLayerVersionResponse x)
-> (forall x.
    Rep PublishLayerVersionResponse x -> PublishLayerVersionResponse)
-> Generic PublishLayerVersionResponse
forall x.
Rep PublishLayerVersionResponse x -> PublishLayerVersionResponse
forall x.
PublishLayerVersionResponse -> Rep PublishLayerVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PublishLayerVersionResponse x -> PublishLayerVersionResponse
$cfrom :: forall x.
PublishLayerVersionResponse -> Rep PublishLayerVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'PublishLayerVersionResponse' 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:
--
-- 'layerVersionArn', 'publishLayerVersionResponse_layerVersionArn' - The ARN of the layer version.
--
-- 'content', 'publishLayerVersionResponse_content' - Details about the layer version.
--
-- 'createdDate', 'publishLayerVersionResponse_createdDate' - The date that the layer version was created, in
-- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
-- (YYYY-MM-DDThh:mm:ss.sTZD).
--
-- 'version', 'publishLayerVersionResponse_version' - The version number.
--
-- 'licenseInfo', 'publishLayerVersionResponse_licenseInfo' - The layer\'s software license.
--
-- 'compatibleArchitectures', 'publishLayerVersionResponse_compatibleArchitectures' - A list of compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architectures>.
--
-- 'layerArn', 'publishLayerVersionResponse_layerArn' - The ARN of the layer.
--
-- 'description', 'publishLayerVersionResponse_description' - The description of the version.
--
-- 'compatibleRuntimes', 'publishLayerVersionResponse_compatibleRuntimes' - The layer\'s compatible runtimes.
--
-- 'httpStatus', 'publishLayerVersionResponse_httpStatus' - The response's http status code.
newPublishLayerVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PublishLayerVersionResponse
newPublishLayerVersionResponse :: Int -> PublishLayerVersionResponse
newPublishLayerVersionResponse Int
pHttpStatus_ =
  PublishLayerVersionResponse' :: Maybe Text
-> Maybe LayerVersionContentOutput
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe [Architecture]
-> Maybe Text
-> Maybe Text
-> Maybe [Runtime]
-> Int
-> PublishLayerVersionResponse
PublishLayerVersionResponse'
    { $sel:layerVersionArn:PublishLayerVersionResponse' :: Maybe Text
layerVersionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:content:PublishLayerVersionResponse' :: Maybe LayerVersionContentOutput
content = Maybe LayerVersionContentOutput
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:PublishLayerVersionResponse' :: Maybe Text
createdDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:PublishLayerVersionResponse' :: Maybe Integer
version = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:licenseInfo:PublishLayerVersionResponse' :: Maybe Text
licenseInfo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleArchitectures:PublishLayerVersionResponse' :: Maybe [Architecture]
compatibleArchitectures = Maybe [Architecture]
forall a. Maybe a
Prelude.Nothing,
      $sel:layerArn:PublishLayerVersionResponse' :: Maybe Text
layerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:PublishLayerVersionResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleRuntimes:PublishLayerVersionResponse' :: Maybe [Runtime]
compatibleRuntimes = Maybe [Runtime]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PublishLayerVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the layer version.
publishLayerVersionResponse_layerVersionArn :: Lens.Lens' PublishLayerVersionResponse (Prelude.Maybe Prelude.Text)
publishLayerVersionResponse_layerVersionArn :: (Maybe Text -> f (Maybe Text))
-> PublishLayerVersionResponse -> f PublishLayerVersionResponse
publishLayerVersionResponse_layerVersionArn = (PublishLayerVersionResponse -> Maybe Text)
-> (PublishLayerVersionResponse
    -> Maybe Text -> PublishLayerVersionResponse)
-> Lens
     PublishLayerVersionResponse
     PublishLayerVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersionResponse' {Maybe Text
layerVersionArn :: Maybe Text
$sel:layerVersionArn:PublishLayerVersionResponse' :: PublishLayerVersionResponse -> Maybe Text
layerVersionArn} -> Maybe Text
layerVersionArn) (\s :: PublishLayerVersionResponse
s@PublishLayerVersionResponse' {} Maybe Text
a -> PublishLayerVersionResponse
s {$sel:layerVersionArn:PublishLayerVersionResponse' :: Maybe Text
layerVersionArn = Maybe Text
a} :: PublishLayerVersionResponse)

-- | Details about the layer version.
publishLayerVersionResponse_content :: Lens.Lens' PublishLayerVersionResponse (Prelude.Maybe LayerVersionContentOutput)
publishLayerVersionResponse_content :: (Maybe LayerVersionContentOutput
 -> f (Maybe LayerVersionContentOutput))
-> PublishLayerVersionResponse -> f PublishLayerVersionResponse
publishLayerVersionResponse_content = (PublishLayerVersionResponse -> Maybe LayerVersionContentOutput)
-> (PublishLayerVersionResponse
    -> Maybe LayerVersionContentOutput -> PublishLayerVersionResponse)
-> Lens
     PublishLayerVersionResponse
     PublishLayerVersionResponse
     (Maybe LayerVersionContentOutput)
     (Maybe LayerVersionContentOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersionResponse' {Maybe LayerVersionContentOutput
content :: Maybe LayerVersionContentOutput
$sel:content:PublishLayerVersionResponse' :: PublishLayerVersionResponse -> Maybe LayerVersionContentOutput
content} -> Maybe LayerVersionContentOutput
content) (\s :: PublishLayerVersionResponse
s@PublishLayerVersionResponse' {} Maybe LayerVersionContentOutput
a -> PublishLayerVersionResponse
s {$sel:content:PublishLayerVersionResponse' :: Maybe LayerVersionContentOutput
content = Maybe LayerVersionContentOutput
a} :: PublishLayerVersionResponse)

-- | The date that the layer version was created, in
-- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
-- (YYYY-MM-DDThh:mm:ss.sTZD).
publishLayerVersionResponse_createdDate :: Lens.Lens' PublishLayerVersionResponse (Prelude.Maybe Prelude.Text)
publishLayerVersionResponse_createdDate :: (Maybe Text -> f (Maybe Text))
-> PublishLayerVersionResponse -> f PublishLayerVersionResponse
publishLayerVersionResponse_createdDate = (PublishLayerVersionResponse -> Maybe Text)
-> (PublishLayerVersionResponse
    -> Maybe Text -> PublishLayerVersionResponse)
-> Lens
     PublishLayerVersionResponse
     PublishLayerVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersionResponse' {Maybe Text
createdDate :: Maybe Text
$sel:createdDate:PublishLayerVersionResponse' :: PublishLayerVersionResponse -> Maybe Text
createdDate} -> Maybe Text
createdDate) (\s :: PublishLayerVersionResponse
s@PublishLayerVersionResponse' {} Maybe Text
a -> PublishLayerVersionResponse
s {$sel:createdDate:PublishLayerVersionResponse' :: Maybe Text
createdDate = Maybe Text
a} :: PublishLayerVersionResponse)

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

-- | The layer\'s software license.
publishLayerVersionResponse_licenseInfo :: Lens.Lens' PublishLayerVersionResponse (Prelude.Maybe Prelude.Text)
publishLayerVersionResponse_licenseInfo :: (Maybe Text -> f (Maybe Text))
-> PublishLayerVersionResponse -> f PublishLayerVersionResponse
publishLayerVersionResponse_licenseInfo = (PublishLayerVersionResponse -> Maybe Text)
-> (PublishLayerVersionResponse
    -> Maybe Text -> PublishLayerVersionResponse)
-> Lens
     PublishLayerVersionResponse
     PublishLayerVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersionResponse' {Maybe Text
licenseInfo :: Maybe Text
$sel:licenseInfo:PublishLayerVersionResponse' :: PublishLayerVersionResponse -> Maybe Text
licenseInfo} -> Maybe Text
licenseInfo) (\s :: PublishLayerVersionResponse
s@PublishLayerVersionResponse' {} Maybe Text
a -> PublishLayerVersionResponse
s {$sel:licenseInfo:PublishLayerVersionResponse' :: Maybe Text
licenseInfo = Maybe Text
a} :: PublishLayerVersionResponse)

-- | A list of compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architectures>.
publishLayerVersionResponse_compatibleArchitectures :: Lens.Lens' PublishLayerVersionResponse (Prelude.Maybe [Architecture])
publishLayerVersionResponse_compatibleArchitectures :: (Maybe [Architecture] -> f (Maybe [Architecture]))
-> PublishLayerVersionResponse -> f PublishLayerVersionResponse
publishLayerVersionResponse_compatibleArchitectures = (PublishLayerVersionResponse -> Maybe [Architecture])
-> (PublishLayerVersionResponse
    -> Maybe [Architecture] -> PublishLayerVersionResponse)
-> Lens
     PublishLayerVersionResponse
     PublishLayerVersionResponse
     (Maybe [Architecture])
     (Maybe [Architecture])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersionResponse' {Maybe [Architecture]
compatibleArchitectures :: Maybe [Architecture]
$sel:compatibleArchitectures:PublishLayerVersionResponse' :: PublishLayerVersionResponse -> Maybe [Architecture]
compatibleArchitectures} -> Maybe [Architecture]
compatibleArchitectures) (\s :: PublishLayerVersionResponse
s@PublishLayerVersionResponse' {} Maybe [Architecture]
a -> PublishLayerVersionResponse
s {$sel:compatibleArchitectures:PublishLayerVersionResponse' :: Maybe [Architecture]
compatibleArchitectures = Maybe [Architecture]
a} :: PublishLayerVersionResponse) ((Maybe [Architecture] -> f (Maybe [Architecture]))
 -> PublishLayerVersionResponse -> f PublishLayerVersionResponse)
-> ((Maybe [Architecture] -> f (Maybe [Architecture]))
    -> Maybe [Architecture] -> f (Maybe [Architecture]))
-> (Maybe [Architecture] -> f (Maybe [Architecture]))
-> PublishLayerVersionResponse
-> f PublishLayerVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Architecture] [Architecture] [Architecture] [Architecture]
-> Iso
     (Maybe [Architecture])
     (Maybe [Architecture])
     (Maybe [Architecture])
     (Maybe [Architecture])
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 [Architecture] [Architecture] [Architecture] [Architecture]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the layer.
publishLayerVersionResponse_layerArn :: Lens.Lens' PublishLayerVersionResponse (Prelude.Maybe Prelude.Text)
publishLayerVersionResponse_layerArn :: (Maybe Text -> f (Maybe Text))
-> PublishLayerVersionResponse -> f PublishLayerVersionResponse
publishLayerVersionResponse_layerArn = (PublishLayerVersionResponse -> Maybe Text)
-> (PublishLayerVersionResponse
    -> Maybe Text -> PublishLayerVersionResponse)
-> Lens
     PublishLayerVersionResponse
     PublishLayerVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersionResponse' {Maybe Text
layerArn :: Maybe Text
$sel:layerArn:PublishLayerVersionResponse' :: PublishLayerVersionResponse -> Maybe Text
layerArn} -> Maybe Text
layerArn) (\s :: PublishLayerVersionResponse
s@PublishLayerVersionResponse' {} Maybe Text
a -> PublishLayerVersionResponse
s {$sel:layerArn:PublishLayerVersionResponse' :: Maybe Text
layerArn = Maybe Text
a} :: PublishLayerVersionResponse)

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

-- | The layer\'s compatible runtimes.
publishLayerVersionResponse_compatibleRuntimes :: Lens.Lens' PublishLayerVersionResponse (Prelude.Maybe [Runtime])
publishLayerVersionResponse_compatibleRuntimes :: (Maybe [Runtime] -> f (Maybe [Runtime]))
-> PublishLayerVersionResponse -> f PublishLayerVersionResponse
publishLayerVersionResponse_compatibleRuntimes = (PublishLayerVersionResponse -> Maybe [Runtime])
-> (PublishLayerVersionResponse
    -> Maybe [Runtime] -> PublishLayerVersionResponse)
-> Lens
     PublishLayerVersionResponse
     PublishLayerVersionResponse
     (Maybe [Runtime])
     (Maybe [Runtime])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishLayerVersionResponse' {Maybe [Runtime]
compatibleRuntimes :: Maybe [Runtime]
$sel:compatibleRuntimes:PublishLayerVersionResponse' :: PublishLayerVersionResponse -> Maybe [Runtime]
compatibleRuntimes} -> Maybe [Runtime]
compatibleRuntimes) (\s :: PublishLayerVersionResponse
s@PublishLayerVersionResponse' {} Maybe [Runtime]
a -> PublishLayerVersionResponse
s {$sel:compatibleRuntimes:PublishLayerVersionResponse' :: Maybe [Runtime]
compatibleRuntimes = Maybe [Runtime]
a} :: PublishLayerVersionResponse) ((Maybe [Runtime] -> f (Maybe [Runtime]))
 -> PublishLayerVersionResponse -> f PublishLayerVersionResponse)
-> ((Maybe [Runtime] -> f (Maybe [Runtime]))
    -> Maybe [Runtime] -> f (Maybe [Runtime]))
-> (Maybe [Runtime] -> f (Maybe [Runtime]))
-> PublishLayerVersionResponse
-> f PublishLayerVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Runtime] [Runtime] [Runtime] [Runtime]
-> Iso
     (Maybe [Runtime])
     (Maybe [Runtime])
     (Maybe [Runtime])
     (Maybe [Runtime])
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 [Runtime] [Runtime] [Runtime] [Runtime]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData PublishLayerVersionResponse