{-# 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.UpdateFunctionUrlConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the configuration for a Lambda function URL.
module Amazonka.Lambda.UpdateFunctionUrlConfig
  ( -- * Creating a Request
    UpdateFunctionUrlConfig (..),
    newUpdateFunctionUrlConfig,

    -- * Request Lenses
    updateFunctionUrlConfig_authType,
    updateFunctionUrlConfig_cors,
    updateFunctionUrlConfig_qualifier,
    updateFunctionUrlConfig_functionName,

    -- * Destructuring the Response
    UpdateFunctionUrlConfigResponse (..),
    newUpdateFunctionUrlConfigResponse,

    -- * Response Lenses
    updateFunctionUrlConfigResponse_cors,
    updateFunctionUrlConfigResponse_httpStatus,
    updateFunctionUrlConfigResponse_functionUrl,
    updateFunctionUrlConfigResponse_functionArn,
    updateFunctionUrlConfigResponse_authType,
    updateFunctionUrlConfigResponse_creationTime,
    updateFunctionUrlConfigResponse_lastModifiedTime,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateFunctionUrlConfig' smart constructor.
data UpdateFunctionUrlConfig = UpdateFunctionUrlConfig'
  { -- | The type of authentication that your function URL uses. Set to @AWS_IAM@
    -- if you want to restrict access to authenticated IAM users only. Set to
    -- @NONE@ if you want to bypass IAM authentication to create a public
    -- endpoint. For more information, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html Security and auth model for Lambda function URLs>.
    UpdateFunctionUrlConfig -> Maybe FunctionUrlAuthType
authType :: Prelude.Maybe FunctionUrlAuthType,
    -- | The
    -- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
    -- settings for your function URL.
    UpdateFunctionUrlConfig -> Maybe Cors
cors :: Prelude.Maybe Cors,
    -- | The alias name.
    UpdateFunctionUrlConfig -> Maybe Text
qualifier :: Prelude.Maybe Prelude.Text,
    -- | The name of the Lambda function.
    --
    -- __Name formats__
    --
    -- -   __Function name__ – @my-function@.
    --
    -- -   __Function ARN__ –
    --     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
    --
    -- -   __Partial ARN__ – @123456789012:function:my-function@.
    --
    -- The length constraint applies only to the full ARN. If you specify only
    -- the function name, it is limited to 64 characters in length.
    UpdateFunctionUrlConfig -> Text
functionName :: Prelude.Text
  }
  deriving (UpdateFunctionUrlConfig -> UpdateFunctionUrlConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFunctionUrlConfig -> UpdateFunctionUrlConfig -> Bool
$c/= :: UpdateFunctionUrlConfig -> UpdateFunctionUrlConfig -> Bool
== :: UpdateFunctionUrlConfig -> UpdateFunctionUrlConfig -> Bool
$c== :: UpdateFunctionUrlConfig -> UpdateFunctionUrlConfig -> Bool
Prelude.Eq, ReadPrec [UpdateFunctionUrlConfig]
ReadPrec UpdateFunctionUrlConfig
Int -> ReadS UpdateFunctionUrlConfig
ReadS [UpdateFunctionUrlConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFunctionUrlConfig]
$creadListPrec :: ReadPrec [UpdateFunctionUrlConfig]
readPrec :: ReadPrec UpdateFunctionUrlConfig
$creadPrec :: ReadPrec UpdateFunctionUrlConfig
readList :: ReadS [UpdateFunctionUrlConfig]
$creadList :: ReadS [UpdateFunctionUrlConfig]
readsPrec :: Int -> ReadS UpdateFunctionUrlConfig
$creadsPrec :: Int -> ReadS UpdateFunctionUrlConfig
Prelude.Read, Int -> UpdateFunctionUrlConfig -> ShowS
[UpdateFunctionUrlConfig] -> ShowS
UpdateFunctionUrlConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFunctionUrlConfig] -> ShowS
$cshowList :: [UpdateFunctionUrlConfig] -> ShowS
show :: UpdateFunctionUrlConfig -> String
$cshow :: UpdateFunctionUrlConfig -> String
showsPrec :: Int -> UpdateFunctionUrlConfig -> ShowS
$cshowsPrec :: Int -> UpdateFunctionUrlConfig -> ShowS
Prelude.Show, forall x. Rep UpdateFunctionUrlConfig x -> UpdateFunctionUrlConfig
forall x. UpdateFunctionUrlConfig -> Rep UpdateFunctionUrlConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFunctionUrlConfig x -> UpdateFunctionUrlConfig
$cfrom :: forall x. UpdateFunctionUrlConfig -> Rep UpdateFunctionUrlConfig x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFunctionUrlConfig' 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:
--
-- 'authType', 'updateFunctionUrlConfig_authType' - The type of authentication that your function URL uses. Set to @AWS_IAM@
-- if you want to restrict access to authenticated IAM users only. Set to
-- @NONE@ if you want to bypass IAM authentication to create a public
-- endpoint. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html Security and auth model for Lambda function URLs>.
--
-- 'cors', 'updateFunctionUrlConfig_cors' - The
-- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
-- settings for your function URL.
--
-- 'qualifier', 'updateFunctionUrlConfig_qualifier' - The alias name.
--
-- 'functionName', 'updateFunctionUrlConfig_functionName' - The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ – @my-function@.
--
-- -   __Function ARN__ –
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ – @123456789012:function:my-function@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
newUpdateFunctionUrlConfig ::
  -- | 'functionName'
  Prelude.Text ->
  UpdateFunctionUrlConfig
newUpdateFunctionUrlConfig :: Text -> UpdateFunctionUrlConfig
newUpdateFunctionUrlConfig Text
pFunctionName_ =
  UpdateFunctionUrlConfig'
    { $sel:authType:UpdateFunctionUrlConfig' :: Maybe FunctionUrlAuthType
authType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cors:UpdateFunctionUrlConfig' :: Maybe Cors
cors = forall a. Maybe a
Prelude.Nothing,
      $sel:qualifier:UpdateFunctionUrlConfig' :: Maybe Text
qualifier = forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:UpdateFunctionUrlConfig' :: Text
functionName = Text
pFunctionName_
    }

-- | The type of authentication that your function URL uses. Set to @AWS_IAM@
-- if you want to restrict access to authenticated IAM users only. Set to
-- @NONE@ if you want to bypass IAM authentication to create a public
-- endpoint. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html Security and auth model for Lambda function URLs>.
updateFunctionUrlConfig_authType :: Lens.Lens' UpdateFunctionUrlConfig (Prelude.Maybe FunctionUrlAuthType)
updateFunctionUrlConfig_authType :: Lens' UpdateFunctionUrlConfig (Maybe FunctionUrlAuthType)
updateFunctionUrlConfig_authType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfig' {Maybe FunctionUrlAuthType
authType :: Maybe FunctionUrlAuthType
$sel:authType:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe FunctionUrlAuthType
authType} -> Maybe FunctionUrlAuthType
authType) (\s :: UpdateFunctionUrlConfig
s@UpdateFunctionUrlConfig' {} Maybe FunctionUrlAuthType
a -> UpdateFunctionUrlConfig
s {$sel:authType:UpdateFunctionUrlConfig' :: Maybe FunctionUrlAuthType
authType = Maybe FunctionUrlAuthType
a} :: UpdateFunctionUrlConfig)

-- | The
-- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
-- settings for your function URL.
updateFunctionUrlConfig_cors :: Lens.Lens' UpdateFunctionUrlConfig (Prelude.Maybe Cors)
updateFunctionUrlConfig_cors :: Lens' UpdateFunctionUrlConfig (Maybe Cors)
updateFunctionUrlConfig_cors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfig' {Maybe Cors
cors :: Maybe Cors
$sel:cors:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Cors
cors} -> Maybe Cors
cors) (\s :: UpdateFunctionUrlConfig
s@UpdateFunctionUrlConfig' {} Maybe Cors
a -> UpdateFunctionUrlConfig
s {$sel:cors:UpdateFunctionUrlConfig' :: Maybe Cors
cors = Maybe Cors
a} :: UpdateFunctionUrlConfig)

-- | The alias name.
updateFunctionUrlConfig_qualifier :: Lens.Lens' UpdateFunctionUrlConfig (Prelude.Maybe Prelude.Text)
updateFunctionUrlConfig_qualifier :: Lens' UpdateFunctionUrlConfig (Maybe Text)
updateFunctionUrlConfig_qualifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfig' {Maybe Text
qualifier :: Maybe Text
$sel:qualifier:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Text
qualifier} -> Maybe Text
qualifier) (\s :: UpdateFunctionUrlConfig
s@UpdateFunctionUrlConfig' {} Maybe Text
a -> UpdateFunctionUrlConfig
s {$sel:qualifier:UpdateFunctionUrlConfig' :: Maybe Text
qualifier = Maybe Text
a} :: UpdateFunctionUrlConfig)

-- | The name of the Lambda function.
--
-- __Name formats__
--
-- -   __Function name__ – @my-function@.
--
-- -   __Function ARN__ –
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ – @123456789012:function:my-function@.
--
-- The length constraint applies only to the full ARN. If you specify only
-- the function name, it is limited to 64 characters in length.
updateFunctionUrlConfig_functionName :: Lens.Lens' UpdateFunctionUrlConfig Prelude.Text
updateFunctionUrlConfig_functionName :: Lens' UpdateFunctionUrlConfig Text
updateFunctionUrlConfig_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfig' {Text
functionName :: Text
$sel:functionName:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Text
functionName} -> Text
functionName) (\s :: UpdateFunctionUrlConfig
s@UpdateFunctionUrlConfig' {} Text
a -> UpdateFunctionUrlConfig
s {$sel:functionName:UpdateFunctionUrlConfig' :: Text
functionName = Text
a} :: UpdateFunctionUrlConfig)

instance Core.AWSRequest UpdateFunctionUrlConfig where
  type
    AWSResponse UpdateFunctionUrlConfig =
      UpdateFunctionUrlConfigResponse
  request :: (Service -> Service)
-> UpdateFunctionUrlConfig -> Request UpdateFunctionUrlConfig
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateFunctionUrlConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFunctionUrlConfig)))
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 Cors
-> Int
-> Text
-> Text
-> FunctionUrlAuthType
-> Text
-> Text
-> UpdateFunctionUrlConfigResponse
UpdateFunctionUrlConfigResponse'
            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
"Cors")
            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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"FunctionUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"FunctionArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"AuthType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"LastModifiedTime")
      )

instance Prelude.Hashable UpdateFunctionUrlConfig where
  hashWithSalt :: Int -> UpdateFunctionUrlConfig -> Int
hashWithSalt Int
_salt UpdateFunctionUrlConfig' {Maybe Text
Maybe Cors
Maybe FunctionUrlAuthType
Text
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
authType :: Maybe FunctionUrlAuthType
$sel:functionName:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Text
$sel:qualifier:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Text
$sel:cors:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Cors
$sel:authType:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe FunctionUrlAuthType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FunctionUrlAuthType
authType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Cors
cors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
qualifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName

instance Prelude.NFData UpdateFunctionUrlConfig where
  rnf :: UpdateFunctionUrlConfig -> ()
rnf UpdateFunctionUrlConfig' {Maybe Text
Maybe Cors
Maybe FunctionUrlAuthType
Text
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
authType :: Maybe FunctionUrlAuthType
$sel:functionName:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Text
$sel:qualifier:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Text
$sel:cors:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Cors
$sel:authType:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe FunctionUrlAuthType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FunctionUrlAuthType
authType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Cors
cors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
qualifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName

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

instance Data.ToJSON UpdateFunctionUrlConfig where
  toJSON :: UpdateFunctionUrlConfig -> Value
toJSON UpdateFunctionUrlConfig' {Maybe Text
Maybe Cors
Maybe FunctionUrlAuthType
Text
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
authType :: Maybe FunctionUrlAuthType
$sel:functionName:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Text
$sel:qualifier:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Text
$sel:cors:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Cors
$sel:authType:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe FunctionUrlAuthType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AuthType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FunctionUrlAuthType
authType,
            (Key
"Cors" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Cors
cors
          ]
      )

instance Data.ToPath UpdateFunctionUrlConfig where
  toPath :: UpdateFunctionUrlConfig -> ByteString
toPath UpdateFunctionUrlConfig' {Maybe Text
Maybe Cors
Maybe FunctionUrlAuthType
Text
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
authType :: Maybe FunctionUrlAuthType
$sel:functionName:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Text
$sel:qualifier:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Text
$sel:cors:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Cors
$sel:authType:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe FunctionUrlAuthType
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2021-10-31/functions/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
        ByteString
"/url"
      ]

instance Data.ToQuery UpdateFunctionUrlConfig where
  toQuery :: UpdateFunctionUrlConfig -> QueryString
toQuery UpdateFunctionUrlConfig' {Maybe Text
Maybe Cors
Maybe FunctionUrlAuthType
Text
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
authType :: Maybe FunctionUrlAuthType
$sel:functionName:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Text
$sel:qualifier:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Text
$sel:cors:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe Cors
$sel:authType:UpdateFunctionUrlConfig' :: UpdateFunctionUrlConfig -> Maybe FunctionUrlAuthType
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
qualifier]

-- | /See:/ 'newUpdateFunctionUrlConfigResponse' smart constructor.
data UpdateFunctionUrlConfigResponse = UpdateFunctionUrlConfigResponse'
  { -- | The
    -- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
    -- settings for your function URL.
    UpdateFunctionUrlConfigResponse -> Maybe Cors
cors :: Prelude.Maybe Cors,
    -- | The response's http status code.
    UpdateFunctionUrlConfigResponse -> Int
httpStatus :: Prelude.Int,
    -- | The HTTP URL endpoint for your function.
    UpdateFunctionUrlConfigResponse -> Text
functionUrl :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of your function.
    UpdateFunctionUrlConfigResponse -> Text
functionArn :: Prelude.Text,
    -- | The type of authentication that your function URL uses. Set to @AWS_IAM@
    -- if you want to restrict access to authenticated IAM users only. Set to
    -- @NONE@ if you want to bypass IAM authentication to create a public
    -- endpoint. For more information, see
    -- <https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html Security and auth model for Lambda function URLs>.
    UpdateFunctionUrlConfigResponse -> FunctionUrlAuthType
authType :: FunctionUrlAuthType,
    -- | When the function URL was created, in
    -- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
    -- (YYYY-MM-DDThh:mm:ss.sTZD).
    UpdateFunctionUrlConfigResponse -> Text
creationTime :: Prelude.Text,
    -- | When the function URL configuration was last updated, in
    -- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
    -- (YYYY-MM-DDThh:mm:ss.sTZD).
    UpdateFunctionUrlConfigResponse -> Text
lastModifiedTime :: Prelude.Text
  }
  deriving (UpdateFunctionUrlConfigResponse
-> UpdateFunctionUrlConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFunctionUrlConfigResponse
-> UpdateFunctionUrlConfigResponse -> Bool
$c/= :: UpdateFunctionUrlConfigResponse
-> UpdateFunctionUrlConfigResponse -> Bool
== :: UpdateFunctionUrlConfigResponse
-> UpdateFunctionUrlConfigResponse -> Bool
$c== :: UpdateFunctionUrlConfigResponse
-> UpdateFunctionUrlConfigResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFunctionUrlConfigResponse]
ReadPrec UpdateFunctionUrlConfigResponse
Int -> ReadS UpdateFunctionUrlConfigResponse
ReadS [UpdateFunctionUrlConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFunctionUrlConfigResponse]
$creadListPrec :: ReadPrec [UpdateFunctionUrlConfigResponse]
readPrec :: ReadPrec UpdateFunctionUrlConfigResponse
$creadPrec :: ReadPrec UpdateFunctionUrlConfigResponse
readList :: ReadS [UpdateFunctionUrlConfigResponse]
$creadList :: ReadS [UpdateFunctionUrlConfigResponse]
readsPrec :: Int -> ReadS UpdateFunctionUrlConfigResponse
$creadsPrec :: Int -> ReadS UpdateFunctionUrlConfigResponse
Prelude.Read, Int -> UpdateFunctionUrlConfigResponse -> ShowS
[UpdateFunctionUrlConfigResponse] -> ShowS
UpdateFunctionUrlConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFunctionUrlConfigResponse] -> ShowS
$cshowList :: [UpdateFunctionUrlConfigResponse] -> ShowS
show :: UpdateFunctionUrlConfigResponse -> String
$cshow :: UpdateFunctionUrlConfigResponse -> String
showsPrec :: Int -> UpdateFunctionUrlConfigResponse -> ShowS
$cshowsPrec :: Int -> UpdateFunctionUrlConfigResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateFunctionUrlConfigResponse x
-> UpdateFunctionUrlConfigResponse
forall x.
UpdateFunctionUrlConfigResponse
-> Rep UpdateFunctionUrlConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFunctionUrlConfigResponse x
-> UpdateFunctionUrlConfigResponse
$cfrom :: forall x.
UpdateFunctionUrlConfigResponse
-> Rep UpdateFunctionUrlConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFunctionUrlConfigResponse' 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:
--
-- 'cors', 'updateFunctionUrlConfigResponse_cors' - The
-- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
-- settings for your function URL.
--
-- 'httpStatus', 'updateFunctionUrlConfigResponse_httpStatus' - The response's http status code.
--
-- 'functionUrl', 'updateFunctionUrlConfigResponse_functionUrl' - The HTTP URL endpoint for your function.
--
-- 'functionArn', 'updateFunctionUrlConfigResponse_functionArn' - The Amazon Resource Name (ARN) of your function.
--
-- 'authType', 'updateFunctionUrlConfigResponse_authType' - The type of authentication that your function URL uses. Set to @AWS_IAM@
-- if you want to restrict access to authenticated IAM users only. Set to
-- @NONE@ if you want to bypass IAM authentication to create a public
-- endpoint. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html Security and auth model for Lambda function URLs>.
--
-- 'creationTime', 'updateFunctionUrlConfigResponse_creationTime' - When the function URL was created, in
-- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
-- (YYYY-MM-DDThh:mm:ss.sTZD).
--
-- 'lastModifiedTime', 'updateFunctionUrlConfigResponse_lastModifiedTime' - When the function URL configuration was last updated, in
-- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
-- (YYYY-MM-DDThh:mm:ss.sTZD).
newUpdateFunctionUrlConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'functionUrl'
  Prelude.Text ->
  -- | 'functionArn'
  Prelude.Text ->
  -- | 'authType'
  FunctionUrlAuthType ->
  -- | 'creationTime'
  Prelude.Text ->
  -- | 'lastModifiedTime'
  Prelude.Text ->
  UpdateFunctionUrlConfigResponse
newUpdateFunctionUrlConfigResponse :: Int
-> Text
-> Text
-> FunctionUrlAuthType
-> Text
-> Text
-> UpdateFunctionUrlConfigResponse
newUpdateFunctionUrlConfigResponse
  Int
pHttpStatus_
  Text
pFunctionUrl_
  Text
pFunctionArn_
  FunctionUrlAuthType
pAuthType_
  Text
pCreationTime_
  Text
pLastModifiedTime_ =
    UpdateFunctionUrlConfigResponse'
      { $sel:cors:UpdateFunctionUrlConfigResponse' :: Maybe Cors
cors =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateFunctionUrlConfigResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:functionUrl:UpdateFunctionUrlConfigResponse' :: Text
functionUrl = Text
pFunctionUrl_,
        $sel:functionArn:UpdateFunctionUrlConfigResponse' :: Text
functionArn = Text
pFunctionArn_,
        $sel:authType:UpdateFunctionUrlConfigResponse' :: FunctionUrlAuthType
authType = FunctionUrlAuthType
pAuthType_,
        $sel:creationTime:UpdateFunctionUrlConfigResponse' :: Text
creationTime = Text
pCreationTime_,
        $sel:lastModifiedTime:UpdateFunctionUrlConfigResponse' :: Text
lastModifiedTime = Text
pLastModifiedTime_
      }

-- | The
-- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
-- settings for your function URL.
updateFunctionUrlConfigResponse_cors :: Lens.Lens' UpdateFunctionUrlConfigResponse (Prelude.Maybe Cors)
updateFunctionUrlConfigResponse_cors :: Lens' UpdateFunctionUrlConfigResponse (Maybe Cors)
updateFunctionUrlConfigResponse_cors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfigResponse' {Maybe Cors
cors :: Maybe Cors
$sel:cors:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Maybe Cors
cors} -> Maybe Cors
cors) (\s :: UpdateFunctionUrlConfigResponse
s@UpdateFunctionUrlConfigResponse' {} Maybe Cors
a -> UpdateFunctionUrlConfigResponse
s {$sel:cors:UpdateFunctionUrlConfigResponse' :: Maybe Cors
cors = Maybe Cors
a} :: UpdateFunctionUrlConfigResponse)

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

-- | The HTTP URL endpoint for your function.
updateFunctionUrlConfigResponse_functionUrl :: Lens.Lens' UpdateFunctionUrlConfigResponse Prelude.Text
updateFunctionUrlConfigResponse_functionUrl :: Lens' UpdateFunctionUrlConfigResponse Text
updateFunctionUrlConfigResponse_functionUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfigResponse' {Text
functionUrl :: Text
$sel:functionUrl:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
functionUrl} -> Text
functionUrl) (\s :: UpdateFunctionUrlConfigResponse
s@UpdateFunctionUrlConfigResponse' {} Text
a -> UpdateFunctionUrlConfigResponse
s {$sel:functionUrl:UpdateFunctionUrlConfigResponse' :: Text
functionUrl = Text
a} :: UpdateFunctionUrlConfigResponse)

-- | The Amazon Resource Name (ARN) of your function.
updateFunctionUrlConfigResponse_functionArn :: Lens.Lens' UpdateFunctionUrlConfigResponse Prelude.Text
updateFunctionUrlConfigResponse_functionArn :: Lens' UpdateFunctionUrlConfigResponse Text
updateFunctionUrlConfigResponse_functionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfigResponse' {Text
functionArn :: Text
$sel:functionArn:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
functionArn} -> Text
functionArn) (\s :: UpdateFunctionUrlConfigResponse
s@UpdateFunctionUrlConfigResponse' {} Text
a -> UpdateFunctionUrlConfigResponse
s {$sel:functionArn:UpdateFunctionUrlConfigResponse' :: Text
functionArn = Text
a} :: UpdateFunctionUrlConfigResponse)

-- | The type of authentication that your function URL uses. Set to @AWS_IAM@
-- if you want to restrict access to authenticated IAM users only. Set to
-- @NONE@ if you want to bypass IAM authentication to create a public
-- endpoint. For more information, see
-- <https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html Security and auth model for Lambda function URLs>.
updateFunctionUrlConfigResponse_authType :: Lens.Lens' UpdateFunctionUrlConfigResponse FunctionUrlAuthType
updateFunctionUrlConfigResponse_authType :: Lens' UpdateFunctionUrlConfigResponse FunctionUrlAuthType
updateFunctionUrlConfigResponse_authType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfigResponse' {FunctionUrlAuthType
authType :: FunctionUrlAuthType
$sel:authType:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> FunctionUrlAuthType
authType} -> FunctionUrlAuthType
authType) (\s :: UpdateFunctionUrlConfigResponse
s@UpdateFunctionUrlConfigResponse' {} FunctionUrlAuthType
a -> UpdateFunctionUrlConfigResponse
s {$sel:authType:UpdateFunctionUrlConfigResponse' :: FunctionUrlAuthType
authType = FunctionUrlAuthType
a} :: UpdateFunctionUrlConfigResponse)

-- | When the function URL was created, in
-- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
-- (YYYY-MM-DDThh:mm:ss.sTZD).
updateFunctionUrlConfigResponse_creationTime :: Lens.Lens' UpdateFunctionUrlConfigResponse Prelude.Text
updateFunctionUrlConfigResponse_creationTime :: Lens' UpdateFunctionUrlConfigResponse Text
updateFunctionUrlConfigResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfigResponse' {Text
creationTime :: Text
$sel:creationTime:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
creationTime} -> Text
creationTime) (\s :: UpdateFunctionUrlConfigResponse
s@UpdateFunctionUrlConfigResponse' {} Text
a -> UpdateFunctionUrlConfigResponse
s {$sel:creationTime:UpdateFunctionUrlConfigResponse' :: Text
creationTime = Text
a} :: UpdateFunctionUrlConfigResponse)

-- | When the function URL configuration was last updated, in
-- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
-- (YYYY-MM-DDThh:mm:ss.sTZD).
updateFunctionUrlConfigResponse_lastModifiedTime :: Lens.Lens' UpdateFunctionUrlConfigResponse Prelude.Text
updateFunctionUrlConfigResponse_lastModifiedTime :: Lens' UpdateFunctionUrlConfigResponse Text
updateFunctionUrlConfigResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionUrlConfigResponse' {Text
lastModifiedTime :: Text
$sel:lastModifiedTime:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
lastModifiedTime} -> Text
lastModifiedTime) (\s :: UpdateFunctionUrlConfigResponse
s@UpdateFunctionUrlConfigResponse' {} Text
a -> UpdateFunctionUrlConfigResponse
s {$sel:lastModifiedTime:UpdateFunctionUrlConfigResponse' :: Text
lastModifiedTime = Text
a} :: UpdateFunctionUrlConfigResponse)

instance
  Prelude.NFData
    UpdateFunctionUrlConfigResponse
  where
  rnf :: UpdateFunctionUrlConfigResponse -> ()
rnf UpdateFunctionUrlConfigResponse' {Int
Maybe Cors
Text
FunctionUrlAuthType
lastModifiedTime :: Text
creationTime :: Text
authType :: FunctionUrlAuthType
functionArn :: Text
functionUrl :: Text
httpStatus :: Int
cors :: Maybe Cors
$sel:lastModifiedTime:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
$sel:creationTime:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
$sel:authType:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> FunctionUrlAuthType
$sel:functionArn:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
$sel:functionUrl:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Text
$sel:httpStatus:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Int
$sel:cors:UpdateFunctionUrlConfigResponse' :: UpdateFunctionUrlConfigResponse -> Maybe Cors
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Cors
cors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FunctionUrlAuthType
authType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lastModifiedTime