{-# 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.UpdateLogPattern
-- 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 a log pattern to a @LogPatternSet@.
module Amazonka.ApplicationInsights.UpdateLogPattern
  ( -- * Creating a Request
    UpdateLogPattern (..),
    newUpdateLogPattern,

    -- * Request Lenses
    updateLogPattern_pattern,
    updateLogPattern_rank,
    updateLogPattern_resourceGroupName,
    updateLogPattern_patternSetName,
    updateLogPattern_patternName,

    -- * Destructuring the Response
    UpdateLogPatternResponse (..),
    newUpdateLogPatternResponse,

    -- * Response Lenses
    updateLogPatternResponse_logPattern,
    updateLogPatternResponse_resourceGroupName,
    updateLogPatternResponse_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:/ 'newUpdateLogPattern' smart constructor.
data UpdateLogPattern = UpdateLogPattern'
  { -- | The log pattern. The pattern must be DFA compatible. Patterns that
    -- utilize forward lookahead or backreference constructions are not
    -- supported.
    UpdateLogPattern -> Maybe Text
pattern' :: Prelude.Maybe 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.
    UpdateLogPattern -> Maybe Int
rank :: Prelude.Maybe Prelude.Int,
    -- | The name of the resource group.
    UpdateLogPattern -> Text
resourceGroupName :: Prelude.Text,
    -- | The name of the log pattern set.
    UpdateLogPattern -> Text
patternSetName :: Prelude.Text,
    -- | The name of the log pattern.
    UpdateLogPattern -> Text
patternName :: Prelude.Text
  }
  deriving (UpdateLogPattern -> UpdateLogPattern -> Bool
(UpdateLogPattern -> UpdateLogPattern -> Bool)
-> (UpdateLogPattern -> UpdateLogPattern -> Bool)
-> Eq UpdateLogPattern
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLogPattern -> UpdateLogPattern -> Bool
$c/= :: UpdateLogPattern -> UpdateLogPattern -> Bool
== :: UpdateLogPattern -> UpdateLogPattern -> Bool
$c== :: UpdateLogPattern -> UpdateLogPattern -> Bool
Prelude.Eq, ReadPrec [UpdateLogPattern]
ReadPrec UpdateLogPattern
Int -> ReadS UpdateLogPattern
ReadS [UpdateLogPattern]
(Int -> ReadS UpdateLogPattern)
-> ReadS [UpdateLogPattern]
-> ReadPrec UpdateLogPattern
-> ReadPrec [UpdateLogPattern]
-> Read UpdateLogPattern
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLogPattern]
$creadListPrec :: ReadPrec [UpdateLogPattern]
readPrec :: ReadPrec UpdateLogPattern
$creadPrec :: ReadPrec UpdateLogPattern
readList :: ReadS [UpdateLogPattern]
$creadList :: ReadS [UpdateLogPattern]
readsPrec :: Int -> ReadS UpdateLogPattern
$creadsPrec :: Int -> ReadS UpdateLogPattern
Prelude.Read, Int -> UpdateLogPattern -> ShowS
[UpdateLogPattern] -> ShowS
UpdateLogPattern -> String
(Int -> UpdateLogPattern -> ShowS)
-> (UpdateLogPattern -> String)
-> ([UpdateLogPattern] -> ShowS)
-> Show UpdateLogPattern
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLogPattern] -> ShowS
$cshowList :: [UpdateLogPattern] -> ShowS
show :: UpdateLogPattern -> String
$cshow :: UpdateLogPattern -> String
showsPrec :: Int -> UpdateLogPattern -> ShowS
$cshowsPrec :: Int -> UpdateLogPattern -> ShowS
Prelude.Show, (forall x. UpdateLogPattern -> Rep UpdateLogPattern x)
-> (forall x. Rep UpdateLogPattern x -> UpdateLogPattern)
-> Generic UpdateLogPattern
forall x. Rep UpdateLogPattern x -> UpdateLogPattern
forall x. UpdateLogPattern -> Rep UpdateLogPattern x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLogPattern x -> UpdateLogPattern
$cfrom :: forall x. UpdateLogPattern -> Rep UpdateLogPattern x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLogPattern' 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:
--
-- 'pattern'', 'updateLogPattern_pattern' - The log pattern. The pattern must be DFA compatible. Patterns that
-- utilize forward lookahead or backreference constructions are not
-- supported.
--
-- 'rank', 'updateLogPattern_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.
--
-- 'resourceGroupName', 'updateLogPattern_resourceGroupName' - The name of the resource group.
--
-- 'patternSetName', 'updateLogPattern_patternSetName' - The name of the log pattern set.
--
-- 'patternName', 'updateLogPattern_patternName' - The name of the log pattern.
newUpdateLogPattern ::
  -- | 'resourceGroupName'
  Prelude.Text ->
  -- | 'patternSetName'
  Prelude.Text ->
  -- | 'patternName'
  Prelude.Text ->
  UpdateLogPattern
newUpdateLogPattern :: Text -> Text -> Text -> UpdateLogPattern
newUpdateLogPattern
  Text
pResourceGroupName_
  Text
pPatternSetName_
  Text
pPatternName_ =
    UpdateLogPattern' :: Maybe Text -> Maybe Int -> Text -> Text -> Text -> UpdateLogPattern
UpdateLogPattern'
      { $sel:pattern':UpdateLogPattern' :: Maybe Text
pattern' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:rank:UpdateLogPattern' :: Maybe Int
rank = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:resourceGroupName:UpdateLogPattern' :: Text
resourceGroupName = Text
pResourceGroupName_,
        $sel:patternSetName:UpdateLogPattern' :: Text
patternSetName = Text
pPatternSetName_,
        $sel:patternName:UpdateLogPattern' :: Text
patternName = Text
pPatternName_
      }

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

-- | 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.
updateLogPattern_rank :: Lens.Lens' UpdateLogPattern (Prelude.Maybe Prelude.Int)
updateLogPattern_rank :: (Maybe Int -> f (Maybe Int))
-> UpdateLogPattern -> f UpdateLogPattern
updateLogPattern_rank = (UpdateLogPattern -> Maybe Int)
-> (UpdateLogPattern -> Maybe Int -> UpdateLogPattern)
-> Lens UpdateLogPattern UpdateLogPattern (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLogPattern' {Maybe Int
rank :: Maybe Int
$sel:rank:UpdateLogPattern' :: UpdateLogPattern -> Maybe Int
rank} -> Maybe Int
rank) (\s :: UpdateLogPattern
s@UpdateLogPattern' {} Maybe Int
a -> UpdateLogPattern
s {$sel:rank:UpdateLogPattern' :: Maybe Int
rank = Maybe Int
a} :: UpdateLogPattern)

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

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

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

instance Core.AWSRequest UpdateLogPattern where
  type
    AWSResponse UpdateLogPattern =
      UpdateLogPatternResponse
  request :: UpdateLogPattern -> Request UpdateLogPattern
request = Service -> UpdateLogPattern -> Request UpdateLogPattern
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateLogPattern
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateLogPattern)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateLogPattern))
-> Logger
-> Service
-> Proxy UpdateLogPattern
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateLogPattern)))
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 -> UpdateLogPatternResponse
UpdateLogPatternResponse'
            (Maybe LogPattern -> Maybe Text -> Int -> UpdateLogPatternResponse)
-> Either String (Maybe LogPattern)
-> Either String (Maybe Text -> Int -> UpdateLogPatternResponse)
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 -> UpdateLogPatternResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateLogPatternResponse)
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 -> UpdateLogPatternResponse)
-> Either String Int -> Either String UpdateLogPatternResponse
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 UpdateLogPattern

instance Prelude.NFData UpdateLogPattern

instance Core.ToHeaders UpdateLogPattern where
  toHeaders :: UpdateLogPattern -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateLogPattern -> 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.UpdateLogPattern" ::
                          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 UpdateLogPattern where
  toJSON :: UpdateLogPattern -> Value
toJSON UpdateLogPattern' {Maybe Int
Maybe Text
Text
patternName :: Text
patternSetName :: Text
resourceGroupName :: Text
rank :: Maybe Int
pattern' :: Maybe Text
$sel:patternName:UpdateLogPattern' :: UpdateLogPattern -> Text
$sel:patternSetName:UpdateLogPattern' :: UpdateLogPattern -> Text
$sel:resourceGroupName:UpdateLogPattern' :: UpdateLogPattern -> Text
$sel:rank:UpdateLogPattern' :: UpdateLogPattern -> Maybe Int
$sel:pattern':UpdateLogPattern' :: UpdateLogPattern -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Pattern" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pattern',
            (Text
"Rank" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
rank,
            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)
          ]
      )

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

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

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

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

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

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

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

instance Prelude.NFData UpdateLogPatternResponse