{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.CloudSearchDomains.Types.DocumentServiceWarning
-- 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.CloudSearchDomains.Types.DocumentServiceWarning where

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

-- | A warning returned by the document service when an issue is discovered
-- while processing an upload request.
--
-- /See:/ 'newDocumentServiceWarning' smart constructor.
data DocumentServiceWarning = DocumentServiceWarning'
  { -- | The description for a warning returned by the document service.
    DocumentServiceWarning -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (DocumentServiceWarning -> DocumentServiceWarning -> Bool
(DocumentServiceWarning -> DocumentServiceWarning -> Bool)
-> (DocumentServiceWarning -> DocumentServiceWarning -> Bool)
-> Eq DocumentServiceWarning
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentServiceWarning -> DocumentServiceWarning -> Bool
$c/= :: DocumentServiceWarning -> DocumentServiceWarning -> Bool
== :: DocumentServiceWarning -> DocumentServiceWarning -> Bool
$c== :: DocumentServiceWarning -> DocumentServiceWarning -> Bool
Prelude.Eq, ReadPrec [DocumentServiceWarning]
ReadPrec DocumentServiceWarning
Int -> ReadS DocumentServiceWarning
ReadS [DocumentServiceWarning]
(Int -> ReadS DocumentServiceWarning)
-> ReadS [DocumentServiceWarning]
-> ReadPrec DocumentServiceWarning
-> ReadPrec [DocumentServiceWarning]
-> Read DocumentServiceWarning
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentServiceWarning]
$creadListPrec :: ReadPrec [DocumentServiceWarning]
readPrec :: ReadPrec DocumentServiceWarning
$creadPrec :: ReadPrec DocumentServiceWarning
readList :: ReadS [DocumentServiceWarning]
$creadList :: ReadS [DocumentServiceWarning]
readsPrec :: Int -> ReadS DocumentServiceWarning
$creadsPrec :: Int -> ReadS DocumentServiceWarning
Prelude.Read, Int -> DocumentServiceWarning -> ShowS
[DocumentServiceWarning] -> ShowS
DocumentServiceWarning -> String
(Int -> DocumentServiceWarning -> ShowS)
-> (DocumentServiceWarning -> String)
-> ([DocumentServiceWarning] -> ShowS)
-> Show DocumentServiceWarning
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentServiceWarning] -> ShowS
$cshowList :: [DocumentServiceWarning] -> ShowS
show :: DocumentServiceWarning -> String
$cshow :: DocumentServiceWarning -> String
showsPrec :: Int -> DocumentServiceWarning -> ShowS
$cshowsPrec :: Int -> DocumentServiceWarning -> ShowS
Prelude.Show, (forall x. DocumentServiceWarning -> Rep DocumentServiceWarning x)
-> (forall x.
    Rep DocumentServiceWarning x -> DocumentServiceWarning)
-> Generic DocumentServiceWarning
forall x. Rep DocumentServiceWarning x -> DocumentServiceWarning
forall x. DocumentServiceWarning -> Rep DocumentServiceWarning x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocumentServiceWarning x -> DocumentServiceWarning
$cfrom :: forall x. DocumentServiceWarning -> Rep DocumentServiceWarning x
Prelude.Generic)

-- |
-- Create a value of 'DocumentServiceWarning' 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:
--
-- 'message', 'documentServiceWarning_message' - The description for a warning returned by the document service.
newDocumentServiceWarning ::
  DocumentServiceWarning
newDocumentServiceWarning :: DocumentServiceWarning
newDocumentServiceWarning =
  DocumentServiceWarning' :: Maybe Text -> DocumentServiceWarning
DocumentServiceWarning' {$sel:message:DocumentServiceWarning' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The description for a warning returned by the document service.
documentServiceWarning_message :: Lens.Lens' DocumentServiceWarning (Prelude.Maybe Prelude.Text)
documentServiceWarning_message :: (Maybe Text -> f (Maybe Text))
-> DocumentServiceWarning -> f DocumentServiceWarning
documentServiceWarning_message = (DocumentServiceWarning -> Maybe Text)
-> (DocumentServiceWarning -> Maybe Text -> DocumentServiceWarning)
-> Lens
     DocumentServiceWarning
     DocumentServiceWarning
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentServiceWarning' {Maybe Text
message :: Maybe Text
$sel:message:DocumentServiceWarning' :: DocumentServiceWarning -> Maybe Text
message} -> Maybe Text
message) (\s :: DocumentServiceWarning
s@DocumentServiceWarning' {} Maybe Text
a -> DocumentServiceWarning
s {$sel:message:DocumentServiceWarning' :: Maybe Text
message = Maybe Text
a} :: DocumentServiceWarning)

instance Core.FromJSON DocumentServiceWarning where
  parseJSON :: Value -> Parser DocumentServiceWarning
parseJSON =
    String
-> (Object -> Parser DocumentServiceWarning)
-> Value
-> Parser DocumentServiceWarning
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DocumentServiceWarning"
      ( \Object
x ->
          Maybe Text -> DocumentServiceWarning
DocumentServiceWarning'
            (Maybe Text -> DocumentServiceWarning)
-> Parser (Maybe Text) -> Parser DocumentServiceWarning
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"message")
      )

instance Prelude.Hashable DocumentServiceWarning

instance Prelude.NFData DocumentServiceWarning