{-# 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.Glue.Types.UpdateXMLClassifierRequest
-- 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.Glue.Types.UpdateXMLClassifierRequest where

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

-- | Specifies an XML classifier to be updated.
--
-- /See:/ 'newUpdateXMLClassifierRequest' smart constructor.
data UpdateXMLClassifierRequest = UpdateXMLClassifierRequest'
  { -- | An identifier of the data format that the classifier matches.
    UpdateXMLClassifierRequest -> Maybe Text
classification :: Prelude.Maybe Prelude.Text,
    -- | The XML tag designating the element that contains each record in an XML
    -- document being parsed. This cannot identify a self-closing element
    -- (closed by @\/>@). An empty row element that contains only attributes
    -- can be parsed as long as it ends with a closing tag (for example,
    -- @\<row item_a=\"A\" item_b=\"B\">\<\/row>@ is okay, but
    -- @\<row item_a=\"A\" item_b=\"B\" \/>@ is not).
    UpdateXMLClassifierRequest -> Maybe Text
rowTag :: Prelude.Maybe Prelude.Text,
    -- | The name of the classifier.
    UpdateXMLClassifierRequest -> Text
name :: Prelude.Text
  }
  deriving (UpdateXMLClassifierRequest -> UpdateXMLClassifierRequest -> Bool
(UpdateXMLClassifierRequest -> UpdateXMLClassifierRequest -> Bool)
-> (UpdateXMLClassifierRequest
    -> UpdateXMLClassifierRequest -> Bool)
-> Eq UpdateXMLClassifierRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateXMLClassifierRequest -> UpdateXMLClassifierRequest -> Bool
$c/= :: UpdateXMLClassifierRequest -> UpdateXMLClassifierRequest -> Bool
== :: UpdateXMLClassifierRequest -> UpdateXMLClassifierRequest -> Bool
$c== :: UpdateXMLClassifierRequest -> UpdateXMLClassifierRequest -> Bool
Prelude.Eq, ReadPrec [UpdateXMLClassifierRequest]
ReadPrec UpdateXMLClassifierRequest
Int -> ReadS UpdateXMLClassifierRequest
ReadS [UpdateXMLClassifierRequest]
(Int -> ReadS UpdateXMLClassifierRequest)
-> ReadS [UpdateXMLClassifierRequest]
-> ReadPrec UpdateXMLClassifierRequest
-> ReadPrec [UpdateXMLClassifierRequest]
-> Read UpdateXMLClassifierRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateXMLClassifierRequest]
$creadListPrec :: ReadPrec [UpdateXMLClassifierRequest]
readPrec :: ReadPrec UpdateXMLClassifierRequest
$creadPrec :: ReadPrec UpdateXMLClassifierRequest
readList :: ReadS [UpdateXMLClassifierRequest]
$creadList :: ReadS [UpdateXMLClassifierRequest]
readsPrec :: Int -> ReadS UpdateXMLClassifierRequest
$creadsPrec :: Int -> ReadS UpdateXMLClassifierRequest
Prelude.Read, Int -> UpdateXMLClassifierRequest -> ShowS
[UpdateXMLClassifierRequest] -> ShowS
UpdateXMLClassifierRequest -> String
(Int -> UpdateXMLClassifierRequest -> ShowS)
-> (UpdateXMLClassifierRequest -> String)
-> ([UpdateXMLClassifierRequest] -> ShowS)
-> Show UpdateXMLClassifierRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateXMLClassifierRequest] -> ShowS
$cshowList :: [UpdateXMLClassifierRequest] -> ShowS
show :: UpdateXMLClassifierRequest -> String
$cshow :: UpdateXMLClassifierRequest -> String
showsPrec :: Int -> UpdateXMLClassifierRequest -> ShowS
$cshowsPrec :: Int -> UpdateXMLClassifierRequest -> ShowS
Prelude.Show, (forall x.
 UpdateXMLClassifierRequest -> Rep UpdateXMLClassifierRequest x)
-> (forall x.
    Rep UpdateXMLClassifierRequest x -> UpdateXMLClassifierRequest)
-> Generic UpdateXMLClassifierRequest
forall x.
Rep UpdateXMLClassifierRequest x -> UpdateXMLClassifierRequest
forall x.
UpdateXMLClassifierRequest -> Rep UpdateXMLClassifierRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateXMLClassifierRequest x -> UpdateXMLClassifierRequest
$cfrom :: forall x.
UpdateXMLClassifierRequest -> Rep UpdateXMLClassifierRequest x
Prelude.Generic)

-- |
-- Create a value of 'UpdateXMLClassifierRequest' 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:
--
-- 'classification', 'updateXMLClassifierRequest_classification' - An identifier of the data format that the classifier matches.
--
-- 'rowTag', 'updateXMLClassifierRequest_rowTag' - The XML tag designating the element that contains each record in an XML
-- document being parsed. This cannot identify a self-closing element
-- (closed by @\/>@). An empty row element that contains only attributes
-- can be parsed as long as it ends with a closing tag (for example,
-- @\<row item_a=\"A\" item_b=\"B\">\<\/row>@ is okay, but
-- @\<row item_a=\"A\" item_b=\"B\" \/>@ is not).
--
-- 'name', 'updateXMLClassifierRequest_name' - The name of the classifier.
newUpdateXMLClassifierRequest ::
  -- | 'name'
  Prelude.Text ->
  UpdateXMLClassifierRequest
newUpdateXMLClassifierRequest :: Text -> UpdateXMLClassifierRequest
newUpdateXMLClassifierRequest Text
pName_ =
  UpdateXMLClassifierRequest' :: Maybe Text -> Maybe Text -> Text -> UpdateXMLClassifierRequest
UpdateXMLClassifierRequest'
    { $sel:classification:UpdateXMLClassifierRequest' :: Maybe Text
classification =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:rowTag:UpdateXMLClassifierRequest' :: Maybe Text
rowTag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateXMLClassifierRequest' :: Text
name = Text
pName_
    }

-- | An identifier of the data format that the classifier matches.
updateXMLClassifierRequest_classification :: Lens.Lens' UpdateXMLClassifierRequest (Prelude.Maybe Prelude.Text)
updateXMLClassifierRequest_classification :: (Maybe Text -> f (Maybe Text))
-> UpdateXMLClassifierRequest -> f UpdateXMLClassifierRequest
updateXMLClassifierRequest_classification = (UpdateXMLClassifierRequest -> Maybe Text)
-> (UpdateXMLClassifierRequest
    -> Maybe Text -> UpdateXMLClassifierRequest)
-> Lens
     UpdateXMLClassifierRequest
     UpdateXMLClassifierRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateXMLClassifierRequest' {Maybe Text
classification :: Maybe Text
$sel:classification:UpdateXMLClassifierRequest' :: UpdateXMLClassifierRequest -> Maybe Text
classification} -> Maybe Text
classification) (\s :: UpdateXMLClassifierRequest
s@UpdateXMLClassifierRequest' {} Maybe Text
a -> UpdateXMLClassifierRequest
s {$sel:classification:UpdateXMLClassifierRequest' :: Maybe Text
classification = Maybe Text
a} :: UpdateXMLClassifierRequest)

-- | The XML tag designating the element that contains each record in an XML
-- document being parsed. This cannot identify a self-closing element
-- (closed by @\/>@). An empty row element that contains only attributes
-- can be parsed as long as it ends with a closing tag (for example,
-- @\<row item_a=\"A\" item_b=\"B\">\<\/row>@ is okay, but
-- @\<row item_a=\"A\" item_b=\"B\" \/>@ is not).
updateXMLClassifierRequest_rowTag :: Lens.Lens' UpdateXMLClassifierRequest (Prelude.Maybe Prelude.Text)
updateXMLClassifierRequest_rowTag :: (Maybe Text -> f (Maybe Text))
-> UpdateXMLClassifierRequest -> f UpdateXMLClassifierRequest
updateXMLClassifierRequest_rowTag = (UpdateXMLClassifierRequest -> Maybe Text)
-> (UpdateXMLClassifierRequest
    -> Maybe Text -> UpdateXMLClassifierRequest)
-> Lens
     UpdateXMLClassifierRequest
     UpdateXMLClassifierRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateXMLClassifierRequest' {Maybe Text
rowTag :: Maybe Text
$sel:rowTag:UpdateXMLClassifierRequest' :: UpdateXMLClassifierRequest -> Maybe Text
rowTag} -> Maybe Text
rowTag) (\s :: UpdateXMLClassifierRequest
s@UpdateXMLClassifierRequest' {} Maybe Text
a -> UpdateXMLClassifierRequest
s {$sel:rowTag:UpdateXMLClassifierRequest' :: Maybe Text
rowTag = Maybe Text
a} :: UpdateXMLClassifierRequest)

-- | The name of the classifier.
updateXMLClassifierRequest_name :: Lens.Lens' UpdateXMLClassifierRequest Prelude.Text
updateXMLClassifierRequest_name :: (Text -> f Text)
-> UpdateXMLClassifierRequest -> f UpdateXMLClassifierRequest
updateXMLClassifierRequest_name = (UpdateXMLClassifierRequest -> Text)
-> (UpdateXMLClassifierRequest
    -> Text -> UpdateXMLClassifierRequest)
-> Lens
     UpdateXMLClassifierRequest UpdateXMLClassifierRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateXMLClassifierRequest' {Text
name :: Text
$sel:name:UpdateXMLClassifierRequest' :: UpdateXMLClassifierRequest -> Text
name} -> Text
name) (\s :: UpdateXMLClassifierRequest
s@UpdateXMLClassifierRequest' {} Text
a -> UpdateXMLClassifierRequest
s {$sel:name:UpdateXMLClassifierRequest' :: Text
name = Text
a} :: UpdateXMLClassifierRequest)

instance Prelude.Hashable UpdateXMLClassifierRequest

instance Prelude.NFData UpdateXMLClassifierRequest

instance Core.ToJSON UpdateXMLClassifierRequest where
  toJSON :: UpdateXMLClassifierRequest -> Value
toJSON UpdateXMLClassifierRequest' {Maybe Text
Text
name :: Text
rowTag :: Maybe Text
classification :: Maybe Text
$sel:name:UpdateXMLClassifierRequest' :: UpdateXMLClassifierRequest -> Text
$sel:rowTag:UpdateXMLClassifierRequest' :: UpdateXMLClassifierRequest -> Maybe Text
$sel:classification:UpdateXMLClassifierRequest' :: UpdateXMLClassifierRequest -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Classification" 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
classification,
            (Text
"RowTag" 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
rowTag,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )