{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- 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.Lens as Lens
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
(CreateLogPattern -> CreateLogPattern -> Bool)
-> (CreateLogPattern -> CreateLogPattern -> Bool)
-> Eq CreateLogPattern
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]
(Int -> ReadS CreateLogPattern)
-> ReadS [CreateLogPattern]
-> ReadPrec CreateLogPattern
-> ReadPrec [CreateLogPattern]
-> Read 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
(Int -> CreateLogPattern -> ShowS)
-> (CreateLogPattern -> String)
-> ([CreateLogPattern] -> ShowS)
-> Show CreateLogPattern
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. CreateLogPattern -> Rep CreateLogPattern x)
-> (forall x. Rep CreateLogPattern x -> CreateLogPattern)
-> Generic CreateLogPattern
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' :: Text -> Text -> Text -> Text -> Int -> CreateLogPattern
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 :: (Text -> f Text) -> CreateLogPattern -> f CreateLogPattern
createLogPattern_resourceGroupName = (CreateLogPattern -> Text)
-> (CreateLogPattern -> Text -> CreateLogPattern)
-> Lens CreateLogPattern CreateLogPattern Text Text
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 :: (Text -> f Text) -> CreateLogPattern -> f CreateLogPattern
createLogPattern_patternSetName = (CreateLogPattern -> Text)
-> (CreateLogPattern -> Text -> CreateLogPattern)
-> Lens CreateLogPattern CreateLogPattern Text Text
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 :: (Text -> f Text) -> CreateLogPattern -> f CreateLogPattern
createLogPattern_patternName = (CreateLogPattern -> Text)
-> (CreateLogPattern -> Text -> CreateLogPattern)
-> Lens CreateLogPattern CreateLogPattern Text Text
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 :: (Text -> f Text) -> CreateLogPattern -> f CreateLogPattern
createLogPattern_pattern = (CreateLogPattern -> Text)
-> (CreateLogPattern -> Text -> CreateLogPattern)
-> Lens CreateLogPattern CreateLogPattern Text Text
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 :: (Int -> f Int) -> CreateLogPattern -> f CreateLogPattern
createLogPattern_rank = (CreateLogPattern -> Int)
-> (CreateLogPattern -> Int -> CreateLogPattern)
-> Lens CreateLogPattern CreateLogPattern Int Int
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 :: CreateLogPattern -> Request CreateLogPattern
request = Service -> CreateLogPattern -> Request CreateLogPattern
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateLogPattern
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateLogPattern)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateLogPattern))
-> Logger
-> Service
-> Proxy CreateLogPattern
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateLogPattern)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe LogPattern -> Maybe Text -> Int -> CreateLogPatternResponse
CreateLogPatternResponse'
            (Maybe LogPattern -> Maybe Text -> Int -> CreateLogPatternResponse)
-> Either String (Maybe LogPattern)
-> Either String (Maybe Text -> Int -> CreateLogPatternResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe LogPattern)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LogPattern")
            Either String (Maybe Text -> Int -> CreateLogPatternResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateLogPatternResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResourceGroupName")
            Either String (Int -> CreateLogPatternResponse)
-> Either String Int -> Either String CreateLogPatternResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateLogPattern

instance Prelude.NFData CreateLogPattern

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

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ResourceGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceGroupName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PatternSetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
patternSetName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PatternName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
patternName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Pattern" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pattern'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Rank" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
rank)
          ]
      )

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

instance Core.ToQuery CreateLogPattern where
  toQuery :: CreateLogPattern -> QueryString
toQuery = QueryString -> CreateLogPattern -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateLogPatternResponse -> CreateLogPatternResponse -> Bool)
-> (CreateLogPatternResponse -> CreateLogPatternResponse -> Bool)
-> Eq CreateLogPatternResponse
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]
(Int -> ReadS CreateLogPatternResponse)
-> ReadS [CreateLogPatternResponse]
-> ReadPrec CreateLogPatternResponse
-> ReadPrec [CreateLogPatternResponse]
-> Read 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
(Int -> CreateLogPatternResponse -> ShowS)
-> (CreateLogPatternResponse -> String)
-> ([CreateLogPatternResponse] -> ShowS)
-> Show CreateLogPatternResponse
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.
 CreateLogPatternResponse -> Rep CreateLogPatternResponse x)
-> (forall x.
    Rep CreateLogPatternResponse x -> CreateLogPatternResponse)
-> Generic CreateLogPatternResponse
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' :: Maybe LogPattern -> Maybe Text -> Int -> CreateLogPatternResponse
CreateLogPatternResponse'
    { $sel:logPattern:CreateLogPatternResponse' :: Maybe LogPattern
logPattern =
        Maybe LogPattern
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceGroupName:CreateLogPatternResponse' :: Maybe Text
resourceGroupName = Maybe Text
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 :: (Maybe LogPattern -> f (Maybe LogPattern))
-> CreateLogPatternResponse -> f CreateLogPatternResponse
createLogPatternResponse_logPattern = (CreateLogPatternResponse -> Maybe LogPattern)
-> (CreateLogPatternResponse
    -> Maybe LogPattern -> CreateLogPatternResponse)
-> Lens
     CreateLogPatternResponse
     CreateLogPatternResponse
     (Maybe LogPattern)
     (Maybe 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 :: (Maybe Text -> f (Maybe Text))
-> CreateLogPatternResponse -> f CreateLogPatternResponse
createLogPatternResponse_resourceGroupName = (CreateLogPatternResponse -> Maybe Text)
-> (CreateLogPatternResponse
    -> Maybe Text -> CreateLogPatternResponse)
-> Lens
     CreateLogPatternResponse
     CreateLogPatternResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Int -> f Int)
-> CreateLogPatternResponse -> f CreateLogPatternResponse
createLogPatternResponse_httpStatus = (CreateLogPatternResponse -> Int)
-> (CreateLogPatternResponse -> Int -> CreateLogPatternResponse)
-> Lens CreateLogPatternResponse CreateLogPatternResponse Int Int
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