{-# 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.CreateFunctionUrlConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a Lambda function URL with the specified configuration
-- parameters. A function URL is a dedicated HTTP(S) endpoint that you can
-- use to invoke your function.
module Amazonka.Lambda.CreateFunctionUrlConfig
  ( -- * Creating a Request
    CreateFunctionUrlConfig (..),
    newCreateFunctionUrlConfig,

    -- * Request Lenses
    createFunctionUrlConfig_cors,
    createFunctionUrlConfig_qualifier,
    createFunctionUrlConfig_functionName,
    createFunctionUrlConfig_authType,

    -- * Destructuring the Response
    CreateFunctionUrlConfigResponse (..),
    newCreateFunctionUrlConfigResponse,

    -- * Response Lenses
    createFunctionUrlConfigResponse_cors,
    createFunctionUrlConfigResponse_httpStatus,
    createFunctionUrlConfigResponse_functionUrl,
    createFunctionUrlConfigResponse_functionArn,
    createFunctionUrlConfigResponse_authType,
    createFunctionUrlConfigResponse_creationTime,
  )
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:/ 'newCreateFunctionUrlConfig' smart constructor.
data CreateFunctionUrlConfig = CreateFunctionUrlConfig'
  { -- | The
    -- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
    -- settings for your function URL.
    CreateFunctionUrlConfig -> Maybe Cors
cors :: Prelude.Maybe Cors,
    -- | The alias name.
    CreateFunctionUrlConfig -> 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.
    CreateFunctionUrlConfig -> Text
functionName :: 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>.
    CreateFunctionUrlConfig -> FunctionUrlAuthType
authType :: FunctionUrlAuthType
  }
  deriving (CreateFunctionUrlConfig -> CreateFunctionUrlConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFunctionUrlConfig -> CreateFunctionUrlConfig -> Bool
$c/= :: CreateFunctionUrlConfig -> CreateFunctionUrlConfig -> Bool
== :: CreateFunctionUrlConfig -> CreateFunctionUrlConfig -> Bool
$c== :: CreateFunctionUrlConfig -> CreateFunctionUrlConfig -> Bool
Prelude.Eq, ReadPrec [CreateFunctionUrlConfig]
ReadPrec CreateFunctionUrlConfig
Int -> ReadS CreateFunctionUrlConfig
ReadS [CreateFunctionUrlConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFunctionUrlConfig]
$creadListPrec :: ReadPrec [CreateFunctionUrlConfig]
readPrec :: ReadPrec CreateFunctionUrlConfig
$creadPrec :: ReadPrec CreateFunctionUrlConfig
readList :: ReadS [CreateFunctionUrlConfig]
$creadList :: ReadS [CreateFunctionUrlConfig]
readsPrec :: Int -> ReadS CreateFunctionUrlConfig
$creadsPrec :: Int -> ReadS CreateFunctionUrlConfig
Prelude.Read, Int -> CreateFunctionUrlConfig -> ShowS
[CreateFunctionUrlConfig] -> ShowS
CreateFunctionUrlConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFunctionUrlConfig] -> ShowS
$cshowList :: [CreateFunctionUrlConfig] -> ShowS
show :: CreateFunctionUrlConfig -> String
$cshow :: CreateFunctionUrlConfig -> String
showsPrec :: Int -> CreateFunctionUrlConfig -> ShowS
$cshowsPrec :: Int -> CreateFunctionUrlConfig -> ShowS
Prelude.Show, forall x. Rep CreateFunctionUrlConfig x -> CreateFunctionUrlConfig
forall x. CreateFunctionUrlConfig -> Rep CreateFunctionUrlConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFunctionUrlConfig x -> CreateFunctionUrlConfig
$cfrom :: forall x. CreateFunctionUrlConfig -> Rep CreateFunctionUrlConfig x
Prelude.Generic)

-- |
-- Create a value of 'CreateFunctionUrlConfig' 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', 'createFunctionUrlConfig_cors' - The
-- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
-- settings for your function URL.
--
-- 'qualifier', 'createFunctionUrlConfig_qualifier' - The alias name.
--
-- 'functionName', 'createFunctionUrlConfig_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.
--
-- 'authType', 'createFunctionUrlConfig_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>.
newCreateFunctionUrlConfig ::
  -- | 'functionName'
  Prelude.Text ->
  -- | 'authType'
  FunctionUrlAuthType ->
  CreateFunctionUrlConfig
newCreateFunctionUrlConfig :: Text -> FunctionUrlAuthType -> CreateFunctionUrlConfig
newCreateFunctionUrlConfig Text
pFunctionName_ FunctionUrlAuthType
pAuthType_ =
  CreateFunctionUrlConfig'
    { $sel:cors:CreateFunctionUrlConfig' :: Maybe Cors
cors = forall a. Maybe a
Prelude.Nothing,
      $sel:qualifier:CreateFunctionUrlConfig' :: Maybe Text
qualifier = forall a. Maybe a
Prelude.Nothing,
      $sel:functionName:CreateFunctionUrlConfig' :: Text
functionName = Text
pFunctionName_,
      $sel:authType:CreateFunctionUrlConfig' :: FunctionUrlAuthType
authType = FunctionUrlAuthType
pAuthType_
    }

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

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

-- | 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.
createFunctionUrlConfig_functionName :: Lens.Lens' CreateFunctionUrlConfig Prelude.Text
createFunctionUrlConfig_functionName :: Lens' CreateFunctionUrlConfig Text
createFunctionUrlConfig_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFunctionUrlConfig' {Text
functionName :: Text
$sel:functionName:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Text
functionName} -> Text
functionName) (\s :: CreateFunctionUrlConfig
s@CreateFunctionUrlConfig' {} Text
a -> CreateFunctionUrlConfig
s {$sel:functionName:CreateFunctionUrlConfig' :: Text
functionName = Text
a} :: CreateFunctionUrlConfig)

-- | 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>.
createFunctionUrlConfig_authType :: Lens.Lens' CreateFunctionUrlConfig FunctionUrlAuthType
createFunctionUrlConfig_authType :: Lens' CreateFunctionUrlConfig FunctionUrlAuthType
createFunctionUrlConfig_authType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFunctionUrlConfig' {FunctionUrlAuthType
authType :: FunctionUrlAuthType
$sel:authType:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> FunctionUrlAuthType
authType} -> FunctionUrlAuthType
authType) (\s :: CreateFunctionUrlConfig
s@CreateFunctionUrlConfig' {} FunctionUrlAuthType
a -> CreateFunctionUrlConfig
s {$sel:authType:CreateFunctionUrlConfig' :: FunctionUrlAuthType
authType = FunctionUrlAuthType
a} :: CreateFunctionUrlConfig)

instance Core.AWSRequest CreateFunctionUrlConfig where
  type
    AWSResponse CreateFunctionUrlConfig =
      CreateFunctionUrlConfigResponse
  request :: (Service -> Service)
-> CreateFunctionUrlConfig -> Request CreateFunctionUrlConfig
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateFunctionUrlConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateFunctionUrlConfig)))
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
-> CreateFunctionUrlConfigResponse
CreateFunctionUrlConfigResponse'
            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")
      )

instance Prelude.Hashable CreateFunctionUrlConfig where
  hashWithSalt :: Int -> CreateFunctionUrlConfig -> Int
hashWithSalt Int
_salt CreateFunctionUrlConfig' {Maybe Text
Maybe Cors
Text
FunctionUrlAuthType
authType :: FunctionUrlAuthType
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
$sel:authType:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> FunctionUrlAuthType
$sel:functionName:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Text
$sel:qualifier:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Text
$sel:cors:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Cors
..} =
    Int
_salt
      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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FunctionUrlAuthType
authType

instance Prelude.NFData CreateFunctionUrlConfig where
  rnf :: CreateFunctionUrlConfig -> ()
rnf CreateFunctionUrlConfig' {Maybe Text
Maybe Cors
Text
FunctionUrlAuthType
authType :: FunctionUrlAuthType
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
$sel:authType:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> FunctionUrlAuthType
$sel:functionName:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Text
$sel:qualifier:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Text
$sel:cors:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> 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 Maybe Text
qualifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FunctionUrlAuthType
authType

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

instance Data.ToJSON CreateFunctionUrlConfig where
  toJSON :: CreateFunctionUrlConfig -> Value
toJSON CreateFunctionUrlConfig' {Maybe Text
Maybe Cors
Text
FunctionUrlAuthType
authType :: FunctionUrlAuthType
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
$sel:authType:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> FunctionUrlAuthType
$sel:functionName:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Text
$sel:qualifier:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Text
$sel:cors:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Cors
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            forall a. a -> Maybe a
Prelude.Just (Key
"AuthType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FunctionUrlAuthType
authType)
          ]
      )

instance Data.ToPath CreateFunctionUrlConfig where
  toPath :: CreateFunctionUrlConfig -> ByteString
toPath CreateFunctionUrlConfig' {Maybe Text
Maybe Cors
Text
FunctionUrlAuthType
authType :: FunctionUrlAuthType
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
$sel:authType:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> FunctionUrlAuthType
$sel:functionName:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Text
$sel:qualifier:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Text
$sel:cors:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Cors
..} =
    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 CreateFunctionUrlConfig where
  toQuery :: CreateFunctionUrlConfig -> QueryString
toQuery CreateFunctionUrlConfig' {Maybe Text
Maybe Cors
Text
FunctionUrlAuthType
authType :: FunctionUrlAuthType
functionName :: Text
qualifier :: Maybe Text
cors :: Maybe Cors
$sel:authType:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> FunctionUrlAuthType
$sel:functionName:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Text
$sel:qualifier:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Text
$sel:cors:CreateFunctionUrlConfig' :: CreateFunctionUrlConfig -> Maybe Cors
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
qualifier]

-- | /See:/ 'newCreateFunctionUrlConfigResponse' smart constructor.
data CreateFunctionUrlConfigResponse = CreateFunctionUrlConfigResponse'
  { -- | The
    -- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
    -- settings for your function URL.
    CreateFunctionUrlConfigResponse -> Maybe Cors
cors :: Prelude.Maybe Cors,
    -- | The response's http status code.
    CreateFunctionUrlConfigResponse -> Int
httpStatus :: Prelude.Int,
    -- | The HTTP URL endpoint for your function.
    CreateFunctionUrlConfigResponse -> Text
functionUrl :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of your function.
    CreateFunctionUrlConfigResponse -> 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>.
    CreateFunctionUrlConfigResponse -> 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).
    CreateFunctionUrlConfigResponse -> Text
creationTime :: Prelude.Text
  }
  deriving (CreateFunctionUrlConfigResponse
-> CreateFunctionUrlConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFunctionUrlConfigResponse
-> CreateFunctionUrlConfigResponse -> Bool
$c/= :: CreateFunctionUrlConfigResponse
-> CreateFunctionUrlConfigResponse -> Bool
== :: CreateFunctionUrlConfigResponse
-> CreateFunctionUrlConfigResponse -> Bool
$c== :: CreateFunctionUrlConfigResponse
-> CreateFunctionUrlConfigResponse -> Bool
Prelude.Eq, ReadPrec [CreateFunctionUrlConfigResponse]
ReadPrec CreateFunctionUrlConfigResponse
Int -> ReadS CreateFunctionUrlConfigResponse
ReadS [CreateFunctionUrlConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFunctionUrlConfigResponse]
$creadListPrec :: ReadPrec [CreateFunctionUrlConfigResponse]
readPrec :: ReadPrec CreateFunctionUrlConfigResponse
$creadPrec :: ReadPrec CreateFunctionUrlConfigResponse
readList :: ReadS [CreateFunctionUrlConfigResponse]
$creadList :: ReadS [CreateFunctionUrlConfigResponse]
readsPrec :: Int -> ReadS CreateFunctionUrlConfigResponse
$creadsPrec :: Int -> ReadS CreateFunctionUrlConfigResponse
Prelude.Read, Int -> CreateFunctionUrlConfigResponse -> ShowS
[CreateFunctionUrlConfigResponse] -> ShowS
CreateFunctionUrlConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFunctionUrlConfigResponse] -> ShowS
$cshowList :: [CreateFunctionUrlConfigResponse] -> ShowS
show :: CreateFunctionUrlConfigResponse -> String
$cshow :: CreateFunctionUrlConfigResponse -> String
showsPrec :: Int -> CreateFunctionUrlConfigResponse -> ShowS
$cshowsPrec :: Int -> CreateFunctionUrlConfigResponse -> ShowS
Prelude.Show, forall x.
Rep CreateFunctionUrlConfigResponse x
-> CreateFunctionUrlConfigResponse
forall x.
CreateFunctionUrlConfigResponse
-> Rep CreateFunctionUrlConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateFunctionUrlConfigResponse x
-> CreateFunctionUrlConfigResponse
$cfrom :: forall x.
CreateFunctionUrlConfigResponse
-> Rep CreateFunctionUrlConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateFunctionUrlConfigResponse' 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', 'createFunctionUrlConfigResponse_cors' - The
-- <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS cross-origin resource sharing (CORS)>
-- settings for your function URL.
--
-- 'httpStatus', 'createFunctionUrlConfigResponse_httpStatus' - The response's http status code.
--
-- 'functionUrl', 'createFunctionUrlConfigResponse_functionUrl' - The HTTP URL endpoint for your function.
--
-- 'functionArn', 'createFunctionUrlConfigResponse_functionArn' - The Amazon Resource Name (ARN) of your function.
--
-- 'authType', 'createFunctionUrlConfigResponse_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', 'createFunctionUrlConfigResponse_creationTime' - When the function URL was created, in
-- <https://www.w3.org/TR/NOTE-datetime ISO-8601 format>
-- (YYYY-MM-DDThh:mm:ss.sTZD).
newCreateFunctionUrlConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'functionUrl'
  Prelude.Text ->
  -- | 'functionArn'
  Prelude.Text ->
  -- | 'authType'
  FunctionUrlAuthType ->
  -- | 'creationTime'
  Prelude.Text ->
  CreateFunctionUrlConfigResponse
newCreateFunctionUrlConfigResponse :: Int
-> Text
-> Text
-> FunctionUrlAuthType
-> Text
-> CreateFunctionUrlConfigResponse
newCreateFunctionUrlConfigResponse
  Int
pHttpStatus_
  Text
pFunctionUrl_
  Text
pFunctionArn_
  FunctionUrlAuthType
pAuthType_
  Text
pCreationTime_ =
    CreateFunctionUrlConfigResponse'
      { $sel:cors:CreateFunctionUrlConfigResponse' :: Maybe Cors
cors =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateFunctionUrlConfigResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:functionUrl:CreateFunctionUrlConfigResponse' :: Text
functionUrl = Text
pFunctionUrl_,
        $sel:functionArn:CreateFunctionUrlConfigResponse' :: Text
functionArn = Text
pFunctionArn_,
        $sel:authType:CreateFunctionUrlConfigResponse' :: FunctionUrlAuthType
authType = FunctionUrlAuthType
pAuthType_,
        $sel:creationTime:CreateFunctionUrlConfigResponse' :: Text
creationTime = Text
pCreationTime_
      }

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

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

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

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

-- | 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>.
createFunctionUrlConfigResponse_authType :: Lens.Lens' CreateFunctionUrlConfigResponse FunctionUrlAuthType
createFunctionUrlConfigResponse_authType :: Lens' CreateFunctionUrlConfigResponse FunctionUrlAuthType
createFunctionUrlConfigResponse_authType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFunctionUrlConfigResponse' {FunctionUrlAuthType
authType :: FunctionUrlAuthType
$sel:authType:CreateFunctionUrlConfigResponse' :: CreateFunctionUrlConfigResponse -> FunctionUrlAuthType
authType} -> FunctionUrlAuthType
authType) (\s :: CreateFunctionUrlConfigResponse
s@CreateFunctionUrlConfigResponse' {} FunctionUrlAuthType
a -> CreateFunctionUrlConfigResponse
s {$sel:authType:CreateFunctionUrlConfigResponse' :: FunctionUrlAuthType
authType = FunctionUrlAuthType
a} :: CreateFunctionUrlConfigResponse)

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

instance
  Prelude.NFData
    CreateFunctionUrlConfigResponse
  where
  rnf :: CreateFunctionUrlConfigResponse -> ()
rnf CreateFunctionUrlConfigResponse' {Int
Maybe Cors
Text
FunctionUrlAuthType
creationTime :: Text
authType :: FunctionUrlAuthType
functionArn :: Text
functionUrl :: Text
httpStatus :: Int
cors :: Maybe Cors
$sel:creationTime:CreateFunctionUrlConfigResponse' :: CreateFunctionUrlConfigResponse -> Text
$sel:authType:CreateFunctionUrlConfigResponse' :: CreateFunctionUrlConfigResponse -> FunctionUrlAuthType
$sel:functionArn:CreateFunctionUrlConfigResponse' :: CreateFunctionUrlConfigResponse -> Text
$sel:functionUrl:CreateFunctionUrlConfigResponse' :: CreateFunctionUrlConfigResponse -> Text
$sel:httpStatus:CreateFunctionUrlConfigResponse' :: CreateFunctionUrlConfigResponse -> Int
$sel:cors:CreateFunctionUrlConfigResponse' :: CreateFunctionUrlConfigResponse -> 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