{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.OpenSearch.Types.LogType
-- 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)
module Amazonka.OpenSearch.Types.LogType
  ( LogType
      ( ..,
        LogType_AUDIT_LOGS,
        LogType_ES_APPLICATION_LOGS,
        LogType_INDEX_SLOW_LOGS,
        LogType_SEARCH_SLOW_LOGS
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude

-- | Type of log file. Can be one of the following:
--
-- -   INDEX_SLOW_LOGS: Index slow logs contain insert requests that took
--     more time than configured index query log threshold to execute.
-- -   SEARCH_SLOW_LOGS: Search slow logs contain search queries that took
--     more time than configured search query log threshold to execute.
-- -   ES_APPLICATION_LOGS: OpenSearch application logs contain information
--     about errors and warnings raised during the operation of the service
--     and can be useful for troubleshooting.
-- -   AUDIT_LOGS: Audit logs contain records of user requests for access
--     from the domain.
newtype LogType = LogType' {LogType -> Text
fromLogType :: Core.Text}
  deriving stock
    ( Int -> LogType -> ShowS
[LogType] -> ShowS
LogType -> String
(Int -> LogType -> ShowS)
-> (LogType -> String) -> ([LogType] -> ShowS) -> Show LogType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogType] -> ShowS
$cshowList :: [LogType] -> ShowS
show :: LogType -> String
$cshow :: LogType -> String
showsPrec :: Int -> LogType -> ShowS
$cshowsPrec :: Int -> LogType -> ShowS
Prelude.Show,
      ReadPrec [LogType]
ReadPrec LogType
Int -> ReadS LogType
ReadS [LogType]
(Int -> ReadS LogType)
-> ReadS [LogType]
-> ReadPrec LogType
-> ReadPrec [LogType]
-> Read LogType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogType]
$creadListPrec :: ReadPrec [LogType]
readPrec :: ReadPrec LogType
$creadPrec :: ReadPrec LogType
readList :: ReadS [LogType]
$creadList :: ReadS [LogType]
readsPrec :: Int -> ReadS LogType
$creadsPrec :: Int -> ReadS LogType
Prelude.Read,
      LogType -> LogType -> Bool
(LogType -> LogType -> Bool)
-> (LogType -> LogType -> Bool) -> Eq LogType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogType -> LogType -> Bool
$c/= :: LogType -> LogType -> Bool
== :: LogType -> LogType -> Bool
$c== :: LogType -> LogType -> Bool
Prelude.Eq,
      Eq LogType
Eq LogType
-> (LogType -> LogType -> Ordering)
-> (LogType -> LogType -> Bool)
-> (LogType -> LogType -> Bool)
-> (LogType -> LogType -> Bool)
-> (LogType -> LogType -> Bool)
-> (LogType -> LogType -> LogType)
-> (LogType -> LogType -> LogType)
-> Ord LogType
LogType -> LogType -> Bool
LogType -> LogType -> Ordering
LogType -> LogType -> LogType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: LogType -> LogType -> LogType
$cmin :: LogType -> LogType -> LogType
max :: LogType -> LogType -> LogType
$cmax :: LogType -> LogType -> LogType
>= :: LogType -> LogType -> Bool
$c>= :: LogType -> LogType -> Bool
> :: LogType -> LogType -> Bool
$c> :: LogType -> LogType -> Bool
<= :: LogType -> LogType -> Bool
$c<= :: LogType -> LogType -> Bool
< :: LogType -> LogType -> Bool
$c< :: LogType -> LogType -> Bool
compare :: LogType -> LogType -> Ordering
$ccompare :: LogType -> LogType -> Ordering
$cp1Ord :: Eq LogType
Prelude.Ord,
      (forall x. LogType -> Rep LogType x)
-> (forall x. Rep LogType x -> LogType) -> Generic LogType
forall x. Rep LogType x -> LogType
forall x. LogType -> Rep LogType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogType x -> LogType
$cfrom :: forall x. LogType -> Rep LogType x
Prelude.Generic
    )
  deriving newtype
    ( Int -> LogType -> Int
LogType -> Int
(Int -> LogType -> Int) -> (LogType -> Int) -> Hashable LogType
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: LogType -> Int
$chash :: LogType -> Int
hashWithSalt :: Int -> LogType -> Int
$chashWithSalt :: Int -> LogType -> Int
Prelude.Hashable,
      LogType -> ()
(LogType -> ()) -> NFData LogType
forall a. (a -> ()) -> NFData a
rnf :: LogType -> ()
$crnf :: LogType -> ()
Prelude.NFData,
      Text -> Either String LogType
(Text -> Either String LogType) -> FromText LogType
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String LogType
$cfromText :: Text -> Either String LogType
Core.FromText,
      LogType -> Text
(LogType -> Text) -> ToText LogType
forall a. (a -> Text) -> ToText a
toText :: LogType -> Text
$ctoText :: LogType -> Text
Core.ToText,
      LogType -> ByteString
(LogType -> ByteString) -> ToByteString LogType
forall a. (a -> ByteString) -> ToByteString a
toBS :: LogType -> ByteString
$ctoBS :: LogType -> ByteString
Core.ToByteString,
      LogType -> ByteStringBuilder
(LogType -> ByteStringBuilder) -> ToLog LogType
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: LogType -> ByteStringBuilder
$cbuild :: LogType -> ByteStringBuilder
Core.ToLog,
      HeaderName -> LogType -> [Header]
(HeaderName -> LogType -> [Header]) -> ToHeader LogType
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> LogType -> [Header]
$ctoHeader :: HeaderName -> LogType -> [Header]
Core.ToHeader,
      LogType -> QueryString
(LogType -> QueryString) -> ToQuery LogType
forall a. (a -> QueryString) -> ToQuery a
toQuery :: LogType -> QueryString
$ctoQuery :: LogType -> QueryString
Core.ToQuery,
      Value -> Parser [LogType]
Value -> Parser LogType
(Value -> Parser LogType)
-> (Value -> Parser [LogType]) -> FromJSON LogType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [LogType]
$cparseJSONList :: Value -> Parser [LogType]
parseJSON :: Value -> Parser LogType
$cparseJSON :: Value -> Parser LogType
Core.FromJSON,
      FromJSONKeyFunction [LogType]
FromJSONKeyFunction LogType
FromJSONKeyFunction LogType
-> FromJSONKeyFunction [LogType] -> FromJSONKey LogType
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [LogType]
$cfromJSONKeyList :: FromJSONKeyFunction [LogType]
fromJSONKey :: FromJSONKeyFunction LogType
$cfromJSONKey :: FromJSONKeyFunction LogType
Core.FromJSONKey,
      [LogType] -> Encoding
[LogType] -> Value
LogType -> Encoding
LogType -> Value
(LogType -> Value)
-> (LogType -> Encoding)
-> ([LogType] -> Value)
-> ([LogType] -> Encoding)
-> ToJSON LogType
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [LogType] -> Encoding
$ctoEncodingList :: [LogType] -> Encoding
toJSONList :: [LogType] -> Value
$ctoJSONList :: [LogType] -> Value
toEncoding :: LogType -> Encoding
$ctoEncoding :: LogType -> Encoding
toJSON :: LogType -> Value
$ctoJSON :: LogType -> Value
Core.ToJSON,
      ToJSONKeyFunction [LogType]
ToJSONKeyFunction LogType
ToJSONKeyFunction LogType
-> ToJSONKeyFunction [LogType] -> ToJSONKey LogType
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [LogType]
$ctoJSONKeyList :: ToJSONKeyFunction [LogType]
toJSONKey :: ToJSONKeyFunction LogType
$ctoJSONKey :: ToJSONKeyFunction LogType
Core.ToJSONKey,
      [Node] -> Either String LogType
([Node] -> Either String LogType) -> FromXML LogType
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String LogType
$cparseXML :: [Node] -> Either String LogType
Core.FromXML,
      LogType -> XML
(LogType -> XML) -> ToXML LogType
forall a. (a -> XML) -> ToXML a
toXML :: LogType -> XML
$ctoXML :: LogType -> XML
Core.ToXML
    )

pattern LogType_AUDIT_LOGS :: LogType
pattern $bLogType_AUDIT_LOGS :: LogType
$mLogType_AUDIT_LOGS :: forall r. LogType -> (Void# -> r) -> (Void# -> r) -> r
LogType_AUDIT_LOGS = LogType' "AUDIT_LOGS"

pattern LogType_ES_APPLICATION_LOGS :: LogType
pattern $bLogType_ES_APPLICATION_LOGS :: LogType
$mLogType_ES_APPLICATION_LOGS :: forall r. LogType -> (Void# -> r) -> (Void# -> r) -> r
LogType_ES_APPLICATION_LOGS = LogType' "ES_APPLICATION_LOGS"

pattern LogType_INDEX_SLOW_LOGS :: LogType
pattern $bLogType_INDEX_SLOW_LOGS :: LogType
$mLogType_INDEX_SLOW_LOGS :: forall r. LogType -> (Void# -> r) -> (Void# -> r) -> r
LogType_INDEX_SLOW_LOGS = LogType' "INDEX_SLOW_LOGS"

pattern LogType_SEARCH_SLOW_LOGS :: LogType
pattern $bLogType_SEARCH_SLOW_LOGS :: LogType
$mLogType_SEARCH_SLOW_LOGS :: forall r. LogType -> (Void# -> r) -> (Void# -> r) -> r
LogType_SEARCH_SLOW_LOGS = LogType' "SEARCH_SLOW_LOGS"

{-# COMPLETE
  LogType_AUDIT_LOGS,
  LogType_ES_APPLICATION_LOGS,
  LogType_INDEX_SLOW_LOGS,
  LogType_SEARCH_SLOW_LOGS,
  LogType'
  #-}