{-# 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.ApplicationInsights.CreateLogPattern
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Adds an log pattern to a @LogPatternSet@.
module Amazonka.ApplicationInsights.CreateLogPattern
  ( -- * Creating a Request
    CreateLogPattern (..),
    newCreateLogPattern,

    -- * Request Lenses
    createLogPattern_resourceGroupName,
    createLogPattern_patternSetName,
    createLogPattern_patternName,
    createLogPattern_pattern,
    createLogPattern_rank,

    -- * Destructuring the Response
    CreateLogPatternResponse (..),
    newCreateLogPatternResponse,

    -- * Response Lenses
    createLogPatternResponse_logPattern,
    createLogPatternResponse_resourceGroupName,
    createLogPatternResponse_httpStatus,
  )
where

import Amazonka.ApplicationInsights.Types
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

-- | /See:/ 'newCreateLogPattern' smart constructor.
data CreateLogPattern = CreateLogPattern'
  { -- | The name of the resource group.
    CreateLogPattern -> Text
resourceGroupName :: Prelude.Text,
    -- | The name of the log pattern set.
    CreateLogPattern -> Text
patternSetName :: Prelude.Text,
    -- | The name of the log pattern.
    CreateLogPattern -> Text
patternName :: Prelude.Text,
    -- | The log pattern. The pattern must be DFA compatible. Patterns that
    -- utilize forward lookahead or backreference constructions are not
    -- supported.
    CreateLogPattern -> Text
pattern' :: Prelude.Text,
    -- | Rank of the log pattern. Must be a value between @1@ and @1,000,000@.
    -- The patterns are sorted by rank, so we recommend that you set your
    -- highest priority patterns with the lowest rank. A pattern of rank @1@
    -- will be the first to get matched to a log line. A pattern of rank
    -- @1,000,000@ will be last to get matched. When you configure custom log
    -- patterns from the console, a @Low@ severity pattern translates to a
    -- @750,000@ rank. A @Medium@ severity pattern translates to a @500,000@
    -- rank. And a @High@ severity pattern translates to a @250,000@ rank. Rank
    -- values less than @1@ or greater than @1,000,000@ are reserved for
    -- AWS-provided patterns.
    CreateLogPattern -> Int
rank :: Prelude.Int
  }
  deriving (CreateLogPattern -> CreateLogPattern -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLogPattern -> CreateLogPattern -> Bool
$c/= :: CreateLogPattern -> CreateLogPattern -> Bool
== :: CreateLogPattern -> CreateLogPattern -> Bool
$c== :: CreateLogPattern -> CreateLogPattern -> Bool
Prelude.Eq, ReadPrec [CreateLogPattern]
ReadPrec CreateLogPattern
Int -> ReadS CreateLogPattern
ReadS [CreateLogPattern]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLogPattern]
$creadListPrec :: ReadPrec [CreateLogPattern]
readPrec :: ReadPrec CreateLogPattern
$creadPrec :: ReadPrec CreateLogPattern
readList :: ReadS [CreateLogPattern]
$creadList :: ReadS [CreateLogPattern]
readsPrec :: Int -> ReadS CreateLogPattern
$creadsPrec :: Int -> ReadS CreateLogPattern
Prelude.Read, Int -> CreateLogPattern -> ShowS
[CreateLogPattern] -> ShowS
CreateLogPattern -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLogPattern] -> ShowS
$cshowList :: [CreateLogPattern] -> ShowS
show :: CreateLogPattern -> String
$cshow :: CreateLogPattern -> String
showsPrec :: Int -> CreateLogPattern -> ShowS
$cshowsPrec :: Int -> CreateLogPattern -> ShowS
Prelude.Show, forall x. Rep CreateLogPattern x -> CreateLogPattern
forall x. CreateLogPattern -> Rep CreateLogPattern x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLogPattern x -> CreateLogPattern
$cfrom :: forall x. CreateLogPattern -> Rep CreateLogPattern x
Prelude.Generic)

-- |
-- Create a value of 'CreateLogPattern' 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:
--
-- 'resourceGroupName', 'createLogPattern_resourceGroupName' - The name of the resource group.
--
-- 'patternSetName', 'createLogPattern_patternSetName' - The name of the log pattern set.
--
-- 'patternName', 'createLogPattern_patternName' - The name of the log pattern.
--
-- 'pattern'', 'createLogPattern_pattern' - The log pattern. The pattern must be DFA compatible. Patterns that
-- utilize forward lookahead or backreference constructions are not
-- supported.
--
-- 'rank', 'createLogPattern_rank' - Rank of the log pattern. Must be a value between @1@ and @1,000,000@.
-- The patterns are sorted by rank, so we recommend that you set your
-- highest priority patterns with the lowest rank. A pattern of rank @1@
-- will be the first to get matched to a log line. A pattern of rank
-- @1,000,000@ will be last to get matched. When you configure custom log
-- patterns from the console, a @Low@ severity pattern translates to a
-- @750,000@ rank. A @Medium@ severity pattern translates to a @500,000@
-- rank. And a @High@ severity pattern translates to a @250,000@ rank. Rank
-- values less than @1@ or greater than @1,000,000@ are reserved for
-- AWS-provided patterns.
newCreateLogPattern ::
  -- | 'resourceGroupName'
  Prelude.Text ->
  -- | 'patternSetName'
  Prelude.Text ->
  -- | 'patternName'
  Prelude.Text ->
  -- | 'pattern''
  Prelude.Text ->
  -- | 'rank'
  Prelude.Int ->
  CreateLogPattern
newCreateLogPattern :: Text -> Text -> Text -> Text -> Int -> CreateLogPattern
newCreateLogPattern
  Text
pResourceGroupName_
  Text
pPatternSetName_
  Text
pPatternName_
  Text
pPattern_
  Int
pRank_ =
    CreateLogPattern'
      { $sel:resourceGroupName:CreateLogPattern' :: Text
resourceGroupName =
          Text
pResourceGroupName_,
        $sel:patternSetName:CreateLogPattern' :: Text
patternSetName = Text
pPatternSetName_,
        $sel:patternName:CreateLogPattern' :: Text
patternName = Text
pPatternName_,
        $sel:pattern':CreateLogPattern' :: Text
pattern' = Text
pPattern_,
        $sel:rank:CreateLogPattern' :: Int
rank = Int
pRank_
      }

-- | The name of the resource group.
createLogPattern_resourceGroupName :: Lens.Lens' CreateLogPattern Prelude.Text
createLogPattern_resourceGroupName :: Lens' CreateLogPattern Text
createLogPattern_resourceGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLogPattern' {Text
resourceGroupName :: Text
$sel:resourceGroupName:CreateLogPattern' :: CreateLogPattern -> Text
resourceGroupName} -> Text
resourceGroupName) (\s :: CreateLogPattern
s@CreateLogPattern' {} Text
a -> CreateLogPattern
s {$sel:resourceGroupName:CreateLogPattern' :: Text
resourceGroupName = Text
a} :: CreateLogPattern)

-- | The name of the log pattern set.
createLogPattern_patternSetName :: Lens.Lens' CreateLogPattern Prelude.Text
createLogPattern_patternSetName :: Lens' CreateLogPattern Text
createLogPattern_patternSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLogPattern' {Text
patternSetName :: Text
$sel:patternSetName:CreateLogPattern' :: CreateLogPattern -> Text
patternSetName} -> Text
patternSetName) (\s :: CreateLogPattern
s@CreateLogPattern' {} Text
a -> CreateLogPattern
s {$sel:patternSetName:CreateLogPattern' :: Text
patternSetName = Text
a} :: CreateLogPattern)

-- | The name of the log pattern.
createLogPattern_patternName :: Lens.Lens' CreateLogPattern Prelude.Text
createLogPattern_patternName :: Lens' CreateLogPattern Text
createLogPattern_patternName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLogPattern' {Text
patternName :: Text
$sel:patternName:CreateLogPattern' :: CreateLogPattern -> Text
patternName} -> Text
patternName) (\s :: CreateLogPattern
s@CreateLogPattern' {} Text
a -> CreateLogPattern
s {$sel:patternName:CreateLogPattern' :: Text
patternName = Text
a} :: CreateLogPattern)

-- | The log pattern. The pattern must be DFA compatible. Patterns that
-- utilize forward lookahead or backreference constructions are not
-- supported.
createLogPattern_pattern :: Lens.Lens' CreateLogPattern Prelude.Text
createLogPattern_pattern :: Lens' CreateLogPattern Text
createLogPattern_pattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLogPattern' {Text
pattern' :: Text
$sel:pattern':CreateLogPattern' :: CreateLogPattern -> Text
pattern'} -> Text
pattern') (\s :: CreateLogPattern
s@CreateLogPattern' {} Text
a -> CreateLogPattern
s {$sel:pattern':CreateLogPattern' :: Text
pattern' = Text
a} :: CreateLogPattern)

-- | Rank of the log pattern. Must be a value between @1@ and @1,000,000@.
-- The patterns are sorted by rank, so we recommend that you set your
-- highest priority patterns with the lowest rank. A pattern of rank @1@
-- will be the first to get matched to a log line. A pattern of rank
-- @1,000,000@ will be last to get matched. When you configure custom log
-- patterns from the console, a @Low@ severity pattern translates to a
-- @750,000@ rank. A @Medium@ severity pattern translates to a @500,000@
-- rank. And a @High@ severity pattern translates to a @250,000@ rank. Rank
-- values less than @1@ or greater than @1,000,000@ are reserved for
-- AWS-provided patterns.
createLogPattern_rank :: Lens.Lens' CreateLogPattern Prelude.Int
createLogPattern_rank :: Lens' CreateLogPattern Int
createLogPattern_rank = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLogPattern' {Int
rank :: Int
$sel:rank:CreateLogPattern' :: CreateLogPattern -> Int
rank} -> Int
rank) (\s :: CreateLogPattern
s@CreateLogPattern' {} Int
a -> CreateLogPattern
s {$sel:rank:CreateLogPattern' :: Int
rank = Int
a} :: CreateLogPattern)

instance Core.AWSRequest CreateLogPattern where
  type
    AWSResponse CreateLogPattern =
      CreateLogPatternResponse
  request :: (Service -> Service)
-> CreateLogPattern -> Request CreateLogPattern
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 CreateLogPattern
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateLogPattern)))
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 LogPattern -> Maybe Text -> Int -> CreateLogPatternResponse
CreateLogPatternResponse'
            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
"LogPattern")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ResourceGroupName")
            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 CreateLogPattern where
  hashWithSalt :: Int -> CreateLogPattern -> Int
hashWithSalt Int
_salt CreateLogPattern' {Int
Text
rank :: Int
pattern' :: Text
patternName :: Text
patternSetName :: Text
resourceGroupName :: Text
$sel:rank:CreateLogPattern' :: CreateLogPattern -> Int
$sel:pattern':CreateLogPattern' :: CreateLogPattern -> Text
$sel:patternName:CreateLogPattern' :: CreateLogPattern -> Text
$sel:patternSetName:CreateLogPattern' :: CreateLogPattern -> Text
$sel:resourceGroupName:CreateLogPattern' :: CreateLogPattern -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
patternSetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
patternName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pattern'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
rank

instance Prelude.NFData CreateLogPattern where
  rnf :: CreateLogPattern -> ()
rnf CreateLogPattern' {Int
Text
rank :: Int
pattern' :: Text
patternName :: Text
patternSetName :: Text
resourceGroupName :: Text
$sel:rank:CreateLogPattern' :: CreateLogPattern -> Int
$sel:pattern':CreateLogPattern' :: CreateLogPattern -> Text
$sel:patternName:CreateLogPattern' :: CreateLogPattern -> Text
$sel:patternSetName:CreateLogPattern' :: CreateLogPattern -> Text
$sel:resourceGroupName:CreateLogPattern' :: CreateLogPattern -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
resourceGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
patternSetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
patternName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
pattern'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
rank

instance Data.ToHeaders CreateLogPattern where
  toHeaders :: CreateLogPattern -> 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
"EC2WindowsBarleyService.CreateLogPattern" ::
                          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 CreateLogPattern where
  toJSON :: CreateLogPattern -> Value
toJSON CreateLogPattern' {Int
Text
rank :: Int
pattern' :: Text
patternName :: Text
patternSetName :: Text
resourceGroupName :: Text
$sel:rank:CreateLogPattern' :: CreateLogPattern -> Int
$sel:pattern':CreateLogPattern' :: CreateLogPattern -> Text
$sel:patternName:CreateLogPattern' :: CreateLogPattern -> Text
$sel:patternSetName:CreateLogPattern' :: CreateLogPattern -> Text
$sel:resourceGroupName:CreateLogPattern' :: CreateLogPattern -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"ResourceGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceGroupName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"PatternSetName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
patternSetName),
            forall a. a -> Maybe a
Prelude.Just (Key
"PatternName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
patternName),
            forall a. a -> Maybe a
Prelude.Just (Key
"Pattern" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
pattern'),
            forall a. a -> Maybe a
Prelude.Just (Key
"Rank" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
rank)
          ]
      )

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

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

-- | /See:/ 'newCreateLogPatternResponse' smart constructor.
data CreateLogPatternResponse = CreateLogPatternResponse'
  { -- | The successfully created log pattern.
    CreateLogPatternResponse -> Maybe LogPattern
logPattern :: Prelude.Maybe LogPattern,
    -- | The name of the resource group.
    CreateLogPatternResponse -> Maybe Text
resourceGroupName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateLogPatternResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLogPatternResponse -> CreateLogPatternResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLogPatternResponse -> CreateLogPatternResponse -> Bool
$c/= :: CreateLogPatternResponse -> CreateLogPatternResponse -> Bool
== :: CreateLogPatternResponse -> CreateLogPatternResponse -> Bool
$c== :: CreateLogPatternResponse -> CreateLogPatternResponse -> Bool
Prelude.Eq, ReadPrec [CreateLogPatternResponse]
ReadPrec CreateLogPatternResponse
Int -> ReadS CreateLogPatternResponse
ReadS [CreateLogPatternResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLogPatternResponse]
$creadListPrec :: ReadPrec [CreateLogPatternResponse]
readPrec :: ReadPrec CreateLogPatternResponse
$creadPrec :: ReadPrec CreateLogPatternResponse
readList :: ReadS [CreateLogPatternResponse]
$creadList :: ReadS [CreateLogPatternResponse]
readsPrec :: Int -> ReadS CreateLogPatternResponse
$creadsPrec :: Int -> ReadS CreateLogPatternResponse
Prelude.Read, Int -> CreateLogPatternResponse -> ShowS
[CreateLogPatternResponse] -> ShowS
CreateLogPatternResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLogPatternResponse] -> ShowS
$cshowList :: [CreateLogPatternResponse] -> ShowS
show :: CreateLogPatternResponse -> String
$cshow :: CreateLogPatternResponse -> String
showsPrec :: Int -> CreateLogPatternResponse -> ShowS
$cshowsPrec :: Int -> CreateLogPatternResponse -> ShowS
Prelude.Show, forall x.
Rep CreateLogPatternResponse x -> CreateLogPatternResponse
forall x.
CreateLogPatternResponse -> Rep CreateLogPatternResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLogPatternResponse x -> CreateLogPatternResponse
$cfrom :: forall x.
CreateLogPatternResponse -> Rep CreateLogPatternResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLogPatternResponse' 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:
--
-- 'logPattern', 'createLogPatternResponse_logPattern' - The successfully created log pattern.
--
-- 'resourceGroupName', 'createLogPatternResponse_resourceGroupName' - The name of the resource group.
--
-- 'httpStatus', 'createLogPatternResponse_httpStatus' - The response's http status code.
newCreateLogPatternResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLogPatternResponse
newCreateLogPatternResponse :: Int -> CreateLogPatternResponse
newCreateLogPatternResponse Int
pHttpStatus_ =
  CreateLogPatternResponse'
    { $sel:logPattern:CreateLogPatternResponse' :: Maybe LogPattern
logPattern =
        forall a. Maybe a
Prelude.Nothing,
      $sel:resourceGroupName:CreateLogPatternResponse' :: Maybe Text
resourceGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLogPatternResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The successfully created log pattern.
createLogPatternResponse_logPattern :: Lens.Lens' CreateLogPatternResponse (Prelude.Maybe LogPattern)
createLogPatternResponse_logPattern :: Lens' CreateLogPatternResponse (Maybe LogPattern)
createLogPatternResponse_logPattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLogPatternResponse' {Maybe LogPattern
logPattern :: Maybe LogPattern
$sel:logPattern:CreateLogPatternResponse' :: CreateLogPatternResponse -> Maybe LogPattern
logPattern} -> Maybe LogPattern
logPattern) (\s :: CreateLogPatternResponse
s@CreateLogPatternResponse' {} Maybe LogPattern
a -> CreateLogPatternResponse
s {$sel:logPattern:CreateLogPatternResponse' :: Maybe LogPattern
logPattern = Maybe LogPattern
a} :: CreateLogPatternResponse)

-- | The name of the resource group.
createLogPatternResponse_resourceGroupName :: Lens.Lens' CreateLogPatternResponse (Prelude.Maybe Prelude.Text)
createLogPatternResponse_resourceGroupName :: Lens' CreateLogPatternResponse (Maybe Text)
createLogPatternResponse_resourceGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLogPatternResponse' {Maybe Text
resourceGroupName :: Maybe Text
$sel:resourceGroupName:CreateLogPatternResponse' :: CreateLogPatternResponse -> Maybe Text
resourceGroupName} -> Maybe Text
resourceGroupName) (\s :: CreateLogPatternResponse
s@CreateLogPatternResponse' {} Maybe Text
a -> CreateLogPatternResponse
s {$sel:resourceGroupName:CreateLogPatternResponse' :: Maybe Text
resourceGroupName = Maybe Text
a} :: CreateLogPatternResponse)

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

instance Prelude.NFData CreateLogPatternResponse where
  rnf :: CreateLogPatternResponse -> ()
rnf CreateLogPatternResponse' {Int
Maybe Text
Maybe LogPattern
httpStatus :: Int
resourceGroupName :: Maybe Text
logPattern :: Maybe LogPattern
$sel:httpStatus:CreateLogPatternResponse' :: CreateLogPatternResponse -> Int
$sel:resourceGroupName:CreateLogPatternResponse' :: CreateLogPatternResponse -> Maybe Text
$sel:logPattern:CreateLogPatternResponse' :: CreateLogPatternResponse -> Maybe LogPattern
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LogPattern
logPattern
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus