{-# 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.WAFV2.CreateRegexPatternSet
-- 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 RegexPatternSet, which you reference in a
-- RegexPatternSetReferenceStatement, to have WAF inspect a web request
-- component for the specified patterns.
module Amazonka.WAFV2.CreateRegexPatternSet
  ( -- * Creating a Request
    CreateRegexPatternSet (..),
    newCreateRegexPatternSet,

    -- * Request Lenses
    createRegexPatternSet_description,
    createRegexPatternSet_tags,
    createRegexPatternSet_name,
    createRegexPatternSet_scope,
    createRegexPatternSet_regularExpressionList,

    -- * Destructuring the Response
    CreateRegexPatternSetResponse (..),
    newCreateRegexPatternSetResponse,

    -- * Response Lenses
    createRegexPatternSetResponse_summary,
    createRegexPatternSetResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateRegexPatternSet' smart constructor.
data CreateRegexPatternSet = CreateRegexPatternSet'
  { -- | A description of the set that helps with identification.
    CreateRegexPatternSet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | An array of key:value pairs to associate with the resource.
    CreateRegexPatternSet -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The name of the set. You cannot change the name after you create the
    -- set.
    CreateRegexPatternSet -> Text
name :: Prelude.Text,
    -- | Specifies whether this is for an Amazon CloudFront distribution or for a
    -- regional application. A regional application can be an Application Load
    -- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
    -- or an Amazon Cognito user pool.
    --
    -- To work with CloudFront, you must also specify the Region US East (N.
    -- Virginia) as follows:
    --
    -- -   CLI - Specify the Region when you use the CloudFront scope:
    --     @--scope=CLOUDFRONT --region=us-east-1@.
    --
    -- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
    CreateRegexPatternSet -> Scope
scope :: Scope,
    -- | Array of regular expression strings.
    CreateRegexPatternSet -> [Regex]
regularExpressionList :: [Regex]
  }
  deriving (CreateRegexPatternSet -> CreateRegexPatternSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRegexPatternSet -> CreateRegexPatternSet -> Bool
$c/= :: CreateRegexPatternSet -> CreateRegexPatternSet -> Bool
== :: CreateRegexPatternSet -> CreateRegexPatternSet -> Bool
$c== :: CreateRegexPatternSet -> CreateRegexPatternSet -> Bool
Prelude.Eq, ReadPrec [CreateRegexPatternSet]
ReadPrec CreateRegexPatternSet
Int -> ReadS CreateRegexPatternSet
ReadS [CreateRegexPatternSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRegexPatternSet]
$creadListPrec :: ReadPrec [CreateRegexPatternSet]
readPrec :: ReadPrec CreateRegexPatternSet
$creadPrec :: ReadPrec CreateRegexPatternSet
readList :: ReadS [CreateRegexPatternSet]
$creadList :: ReadS [CreateRegexPatternSet]
readsPrec :: Int -> ReadS CreateRegexPatternSet
$creadsPrec :: Int -> ReadS CreateRegexPatternSet
Prelude.Read, Int -> CreateRegexPatternSet -> ShowS
[CreateRegexPatternSet] -> ShowS
CreateRegexPatternSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRegexPatternSet] -> ShowS
$cshowList :: [CreateRegexPatternSet] -> ShowS
show :: CreateRegexPatternSet -> String
$cshow :: CreateRegexPatternSet -> String
showsPrec :: Int -> CreateRegexPatternSet -> ShowS
$cshowsPrec :: Int -> CreateRegexPatternSet -> ShowS
Prelude.Show, forall x. Rep CreateRegexPatternSet x -> CreateRegexPatternSet
forall x. CreateRegexPatternSet -> Rep CreateRegexPatternSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRegexPatternSet x -> CreateRegexPatternSet
$cfrom :: forall x. CreateRegexPatternSet -> Rep CreateRegexPatternSet x
Prelude.Generic)

-- |
-- Create a value of 'CreateRegexPatternSet' 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:
--
-- 'description', 'createRegexPatternSet_description' - A description of the set that helps with identification.
--
-- 'tags', 'createRegexPatternSet_tags' - An array of key:value pairs to associate with the resource.
--
-- 'name', 'createRegexPatternSet_name' - The name of the set. You cannot change the name after you create the
-- set.
--
-- 'scope', 'createRegexPatternSet_scope' - Specifies whether this is for an Amazon CloudFront distribution or for a
-- regional application. A regional application can be an Application Load
-- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
-- or an Amazon Cognito user pool.
--
-- To work with CloudFront, you must also specify the Region US East (N.
-- Virginia) as follows:
--
-- -   CLI - Specify the Region when you use the CloudFront scope:
--     @--scope=CLOUDFRONT --region=us-east-1@.
--
-- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
--
-- 'regularExpressionList', 'createRegexPatternSet_regularExpressionList' - Array of regular expression strings.
newCreateRegexPatternSet ::
  -- | 'name'
  Prelude.Text ->
  -- | 'scope'
  Scope ->
  CreateRegexPatternSet
newCreateRegexPatternSet :: Text -> Scope -> CreateRegexPatternSet
newCreateRegexPatternSet Text
pName_ Scope
pScope_ =
  CreateRegexPatternSet'
    { $sel:description:CreateRegexPatternSet' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateRegexPatternSet' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateRegexPatternSet' :: Text
name = Text
pName_,
      $sel:scope:CreateRegexPatternSet' :: Scope
scope = Scope
pScope_,
      $sel:regularExpressionList:CreateRegexPatternSet' :: [Regex]
regularExpressionList = forall a. Monoid a => a
Prelude.mempty
    }

-- | A description of the set that helps with identification.
createRegexPatternSet_description :: Lens.Lens' CreateRegexPatternSet (Prelude.Maybe Prelude.Text)
createRegexPatternSet_description :: Lens' CreateRegexPatternSet (Maybe Text)
createRegexPatternSet_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRegexPatternSet' {Maybe Text
description :: Maybe Text
$sel:description:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateRegexPatternSet
s@CreateRegexPatternSet' {} Maybe Text
a -> CreateRegexPatternSet
s {$sel:description:CreateRegexPatternSet' :: Maybe Text
description = Maybe Text
a} :: CreateRegexPatternSet)

-- | An array of key:value pairs to associate with the resource.
createRegexPatternSet_tags :: Lens.Lens' CreateRegexPatternSet (Prelude.Maybe (Prelude.NonEmpty Tag))
createRegexPatternSet_tags :: Lens' CreateRegexPatternSet (Maybe (NonEmpty Tag))
createRegexPatternSet_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRegexPatternSet' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateRegexPatternSet
s@CreateRegexPatternSet' {} Maybe (NonEmpty Tag)
a -> CreateRegexPatternSet
s {$sel:tags:CreateRegexPatternSet' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateRegexPatternSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the set. You cannot change the name after you create the
-- set.
createRegexPatternSet_name :: Lens.Lens' CreateRegexPatternSet Prelude.Text
createRegexPatternSet_name :: Lens' CreateRegexPatternSet Text
createRegexPatternSet_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRegexPatternSet' {Text
name :: Text
$sel:name:CreateRegexPatternSet' :: CreateRegexPatternSet -> Text
name} -> Text
name) (\s :: CreateRegexPatternSet
s@CreateRegexPatternSet' {} Text
a -> CreateRegexPatternSet
s {$sel:name:CreateRegexPatternSet' :: Text
name = Text
a} :: CreateRegexPatternSet)

-- | Specifies whether this is for an Amazon CloudFront distribution or for a
-- regional application. A regional application can be an Application Load
-- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
-- or an Amazon Cognito user pool.
--
-- To work with CloudFront, you must also specify the Region US East (N.
-- Virginia) as follows:
--
-- -   CLI - Specify the Region when you use the CloudFront scope:
--     @--scope=CLOUDFRONT --region=us-east-1@.
--
-- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
createRegexPatternSet_scope :: Lens.Lens' CreateRegexPatternSet Scope
createRegexPatternSet_scope :: Lens' CreateRegexPatternSet Scope
createRegexPatternSet_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRegexPatternSet' {Scope
scope :: Scope
$sel:scope:CreateRegexPatternSet' :: CreateRegexPatternSet -> Scope
scope} -> Scope
scope) (\s :: CreateRegexPatternSet
s@CreateRegexPatternSet' {} Scope
a -> CreateRegexPatternSet
s {$sel:scope:CreateRegexPatternSet' :: Scope
scope = Scope
a} :: CreateRegexPatternSet)

-- | Array of regular expression strings.
createRegexPatternSet_regularExpressionList :: Lens.Lens' CreateRegexPatternSet [Regex]
createRegexPatternSet_regularExpressionList :: Lens' CreateRegexPatternSet [Regex]
createRegexPatternSet_regularExpressionList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRegexPatternSet' {[Regex]
regularExpressionList :: [Regex]
$sel:regularExpressionList:CreateRegexPatternSet' :: CreateRegexPatternSet -> [Regex]
regularExpressionList} -> [Regex]
regularExpressionList) (\s :: CreateRegexPatternSet
s@CreateRegexPatternSet' {} [Regex]
a -> CreateRegexPatternSet
s {$sel:regularExpressionList:CreateRegexPatternSet' :: [Regex]
regularExpressionList = [Regex]
a} :: CreateRegexPatternSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateRegexPatternSet where
  type
    AWSResponse CreateRegexPatternSet =
      CreateRegexPatternSetResponse
  request :: (Service -> Service)
-> CreateRegexPatternSet -> Request CreateRegexPatternSet
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 CreateRegexPatternSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateRegexPatternSet)))
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 RegexPatternSetSummary
-> Int -> CreateRegexPatternSetResponse
CreateRegexPatternSetResponse'
            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
"Summary")
            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))
      )

instance Prelude.Hashable CreateRegexPatternSet where
  hashWithSalt :: Int -> CreateRegexPatternSet -> Int
hashWithSalt Int
_salt CreateRegexPatternSet' {[Regex]
Maybe (NonEmpty Tag)
Maybe Text
Text
Scope
regularExpressionList :: [Regex]
scope :: Scope
name :: Text
tags :: Maybe (NonEmpty Tag)
description :: Maybe Text
$sel:regularExpressionList:CreateRegexPatternSet' :: CreateRegexPatternSet -> [Regex]
$sel:scope:CreateRegexPatternSet' :: CreateRegexPatternSet -> Scope
$sel:name:CreateRegexPatternSet' :: CreateRegexPatternSet -> Text
$sel:tags:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe (NonEmpty Tag)
$sel:description:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Scope
scope
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Regex]
regularExpressionList

instance Prelude.NFData CreateRegexPatternSet where
  rnf :: CreateRegexPatternSet -> ()
rnf CreateRegexPatternSet' {[Regex]
Maybe (NonEmpty Tag)
Maybe Text
Text
Scope
regularExpressionList :: [Regex]
scope :: Scope
name :: Text
tags :: Maybe (NonEmpty Tag)
description :: Maybe Text
$sel:regularExpressionList:CreateRegexPatternSet' :: CreateRegexPatternSet -> [Regex]
$sel:scope:CreateRegexPatternSet' :: CreateRegexPatternSet -> Scope
$sel:name:CreateRegexPatternSet' :: CreateRegexPatternSet -> Text
$sel:tags:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe (NonEmpty Tag)
$sel:description:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Scope
scope
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Regex]
regularExpressionList

instance Data.ToHeaders CreateRegexPatternSet where
  toHeaders :: CreateRegexPatternSet -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSWAF_20190729.CreateRegexPatternSet" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateRegexPatternSet where
  toJSON :: CreateRegexPatternSet -> Value
toJSON CreateRegexPatternSet' {[Regex]
Maybe (NonEmpty Tag)
Maybe Text
Text
Scope
regularExpressionList :: [Regex]
scope :: Scope
name :: Text
tags :: Maybe (NonEmpty Tag)
description :: Maybe Text
$sel:regularExpressionList:CreateRegexPatternSet' :: CreateRegexPatternSet -> [Regex]
$sel:scope:CreateRegexPatternSet' :: CreateRegexPatternSet -> Scope
$sel:name:CreateRegexPatternSet' :: CreateRegexPatternSet -> Text
$sel:tags:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe (NonEmpty Tag)
$sel:description:CreateRegexPatternSet' :: CreateRegexPatternSet -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Description" 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 Text
description,
            (Key
"Tags" 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 (NonEmpty Tag)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"Scope" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Scope
scope),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"RegularExpressionList"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Regex]
regularExpressionList
              )
          ]
      )

instance Data.ToPath CreateRegexPatternSet where
  toPath :: CreateRegexPatternSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newCreateRegexPatternSetResponse' smart constructor.
data CreateRegexPatternSetResponse = CreateRegexPatternSetResponse'
  { -- | High-level information about a RegexPatternSet, returned by operations
    -- like create and list. This provides information like the ID, that you
    -- can use to retrieve and manage a @RegexPatternSet@, and the ARN, that
    -- you provide to the RegexPatternSetReferenceStatement to use the pattern
    -- set in a Rule.
    CreateRegexPatternSetResponse -> Maybe RegexPatternSetSummary
summary :: Prelude.Maybe RegexPatternSetSummary,
    -- | The response's http status code.
    CreateRegexPatternSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateRegexPatternSetResponse
-> CreateRegexPatternSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRegexPatternSetResponse
-> CreateRegexPatternSetResponse -> Bool
$c/= :: CreateRegexPatternSetResponse
-> CreateRegexPatternSetResponse -> Bool
== :: CreateRegexPatternSetResponse
-> CreateRegexPatternSetResponse -> Bool
$c== :: CreateRegexPatternSetResponse
-> CreateRegexPatternSetResponse -> Bool
Prelude.Eq, ReadPrec [CreateRegexPatternSetResponse]
ReadPrec CreateRegexPatternSetResponse
Int -> ReadS CreateRegexPatternSetResponse
ReadS [CreateRegexPatternSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRegexPatternSetResponse]
$creadListPrec :: ReadPrec [CreateRegexPatternSetResponse]
readPrec :: ReadPrec CreateRegexPatternSetResponse
$creadPrec :: ReadPrec CreateRegexPatternSetResponse
readList :: ReadS [CreateRegexPatternSetResponse]
$creadList :: ReadS [CreateRegexPatternSetResponse]
readsPrec :: Int -> ReadS CreateRegexPatternSetResponse
$creadsPrec :: Int -> ReadS CreateRegexPatternSetResponse
Prelude.Read, Int -> CreateRegexPatternSetResponse -> ShowS
[CreateRegexPatternSetResponse] -> ShowS
CreateRegexPatternSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRegexPatternSetResponse] -> ShowS
$cshowList :: [CreateRegexPatternSetResponse] -> ShowS
show :: CreateRegexPatternSetResponse -> String
$cshow :: CreateRegexPatternSetResponse -> String
showsPrec :: Int -> CreateRegexPatternSetResponse -> ShowS
$cshowsPrec :: Int -> CreateRegexPatternSetResponse -> ShowS
Prelude.Show, forall x.
Rep CreateRegexPatternSetResponse x
-> CreateRegexPatternSetResponse
forall x.
CreateRegexPatternSetResponse
-> Rep CreateRegexPatternSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRegexPatternSetResponse x
-> CreateRegexPatternSetResponse
$cfrom :: forall x.
CreateRegexPatternSetResponse
-> Rep CreateRegexPatternSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateRegexPatternSetResponse' 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:
--
-- 'summary', 'createRegexPatternSetResponse_summary' - High-level information about a RegexPatternSet, returned by operations
-- like create and list. This provides information like the ID, that you
-- can use to retrieve and manage a @RegexPatternSet@, and the ARN, that
-- you provide to the RegexPatternSetReferenceStatement to use the pattern
-- set in a Rule.
--
-- 'httpStatus', 'createRegexPatternSetResponse_httpStatus' - The response's http status code.
newCreateRegexPatternSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRegexPatternSetResponse
newCreateRegexPatternSetResponse :: Int -> CreateRegexPatternSetResponse
newCreateRegexPatternSetResponse Int
pHttpStatus_ =
  CreateRegexPatternSetResponse'
    { $sel:summary:CreateRegexPatternSetResponse' :: Maybe RegexPatternSetSummary
summary =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateRegexPatternSetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | High-level information about a RegexPatternSet, returned by operations
-- like create and list. This provides information like the ID, that you
-- can use to retrieve and manage a @RegexPatternSet@, and the ARN, that
-- you provide to the RegexPatternSetReferenceStatement to use the pattern
-- set in a Rule.
createRegexPatternSetResponse_summary :: Lens.Lens' CreateRegexPatternSetResponse (Prelude.Maybe RegexPatternSetSummary)
createRegexPatternSetResponse_summary :: Lens' CreateRegexPatternSetResponse (Maybe RegexPatternSetSummary)
createRegexPatternSetResponse_summary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRegexPatternSetResponse' {Maybe RegexPatternSetSummary
summary :: Maybe RegexPatternSetSummary
$sel:summary:CreateRegexPatternSetResponse' :: CreateRegexPatternSetResponse -> Maybe RegexPatternSetSummary
summary} -> Maybe RegexPatternSetSummary
summary) (\s :: CreateRegexPatternSetResponse
s@CreateRegexPatternSetResponse' {} Maybe RegexPatternSetSummary
a -> CreateRegexPatternSetResponse
s {$sel:summary:CreateRegexPatternSetResponse' :: Maybe RegexPatternSetSummary
summary = Maybe RegexPatternSetSummary
a} :: CreateRegexPatternSetResponse)

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

instance Prelude.NFData CreateRegexPatternSetResponse where
  rnf :: CreateRegexPatternSetResponse -> ()
rnf CreateRegexPatternSetResponse' {Int
Maybe RegexPatternSetSummary
httpStatus :: Int
summary :: Maybe RegexPatternSetSummary
$sel:httpStatus:CreateRegexPatternSetResponse' :: CreateRegexPatternSetResponse -> Int
$sel:summary:CreateRegexPatternSetResponse' :: CreateRegexPatternSetResponse -> Maybe RegexPatternSetSummary
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RegexPatternSetSummary
summary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus