{-# 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.UpdateJsonClassifierRequest
-- 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.UpdateJsonClassifierRequest where

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

-- | Specifies a JSON classifier to be updated.
--
-- /See:/ 'newUpdateJsonClassifierRequest' smart constructor.
data UpdateJsonClassifierRequest = UpdateJsonClassifierRequest'
  { -- | A @JsonPath@ string defining the JSON data for the classifier to
    -- classify. Glue supports a subset of JsonPath, as described in
    -- <https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json Writing JsonPath Custom Classifiers>.
    UpdateJsonClassifierRequest -> Maybe Text
jsonPath :: Prelude.Maybe Prelude.Text,
    -- | The name of the classifier.
    UpdateJsonClassifierRequest -> Text
name :: Prelude.Text
  }
  deriving (UpdateJsonClassifierRequest -> UpdateJsonClassifierRequest -> Bool
(UpdateJsonClassifierRequest
 -> UpdateJsonClassifierRequest -> Bool)
-> (UpdateJsonClassifierRequest
    -> UpdateJsonClassifierRequest -> Bool)
-> Eq UpdateJsonClassifierRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateJsonClassifierRequest -> UpdateJsonClassifierRequest -> Bool
$c/= :: UpdateJsonClassifierRequest -> UpdateJsonClassifierRequest -> Bool
== :: UpdateJsonClassifierRequest -> UpdateJsonClassifierRequest -> Bool
$c== :: UpdateJsonClassifierRequest -> UpdateJsonClassifierRequest -> Bool
Prelude.Eq, ReadPrec [UpdateJsonClassifierRequest]
ReadPrec UpdateJsonClassifierRequest
Int -> ReadS UpdateJsonClassifierRequest
ReadS [UpdateJsonClassifierRequest]
(Int -> ReadS UpdateJsonClassifierRequest)
-> ReadS [UpdateJsonClassifierRequest]
-> ReadPrec UpdateJsonClassifierRequest
-> ReadPrec [UpdateJsonClassifierRequest]
-> Read UpdateJsonClassifierRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateJsonClassifierRequest]
$creadListPrec :: ReadPrec [UpdateJsonClassifierRequest]
readPrec :: ReadPrec UpdateJsonClassifierRequest
$creadPrec :: ReadPrec UpdateJsonClassifierRequest
readList :: ReadS [UpdateJsonClassifierRequest]
$creadList :: ReadS [UpdateJsonClassifierRequest]
readsPrec :: Int -> ReadS UpdateJsonClassifierRequest
$creadsPrec :: Int -> ReadS UpdateJsonClassifierRequest
Prelude.Read, Int -> UpdateJsonClassifierRequest -> ShowS
[UpdateJsonClassifierRequest] -> ShowS
UpdateJsonClassifierRequest -> String
(Int -> UpdateJsonClassifierRequest -> ShowS)
-> (UpdateJsonClassifierRequest -> String)
-> ([UpdateJsonClassifierRequest] -> ShowS)
-> Show UpdateJsonClassifierRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateJsonClassifierRequest] -> ShowS
$cshowList :: [UpdateJsonClassifierRequest] -> ShowS
show :: UpdateJsonClassifierRequest -> String
$cshow :: UpdateJsonClassifierRequest -> String
showsPrec :: Int -> UpdateJsonClassifierRequest -> ShowS
$cshowsPrec :: Int -> UpdateJsonClassifierRequest -> ShowS
Prelude.Show, (forall x.
 UpdateJsonClassifierRequest -> Rep UpdateJsonClassifierRequest x)
-> (forall x.
    Rep UpdateJsonClassifierRequest x -> UpdateJsonClassifierRequest)
-> Generic UpdateJsonClassifierRequest
forall x.
Rep UpdateJsonClassifierRequest x -> UpdateJsonClassifierRequest
forall x.
UpdateJsonClassifierRequest -> Rep UpdateJsonClassifierRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateJsonClassifierRequest x -> UpdateJsonClassifierRequest
$cfrom :: forall x.
UpdateJsonClassifierRequest -> Rep UpdateJsonClassifierRequest x
Prelude.Generic)

-- |
-- Create a value of 'UpdateJsonClassifierRequest' 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:
--
-- 'jsonPath', 'updateJsonClassifierRequest_jsonPath' - A @JsonPath@ string defining the JSON data for the classifier to
-- classify. Glue supports a subset of JsonPath, as described in
-- <https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json Writing JsonPath Custom Classifiers>.
--
-- 'name', 'updateJsonClassifierRequest_name' - The name of the classifier.
newUpdateJsonClassifierRequest ::
  -- | 'name'
  Prelude.Text ->
  UpdateJsonClassifierRequest
newUpdateJsonClassifierRequest :: Text -> UpdateJsonClassifierRequest
newUpdateJsonClassifierRequest Text
pName_ =
  UpdateJsonClassifierRequest' :: Maybe Text -> Text -> UpdateJsonClassifierRequest
UpdateJsonClassifierRequest'
    { $sel:jsonPath:UpdateJsonClassifierRequest' :: Maybe Text
jsonPath =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateJsonClassifierRequest' :: Text
name = Text
pName_
    }

-- | A @JsonPath@ string defining the JSON data for the classifier to
-- classify. Glue supports a subset of JsonPath, as described in
-- <https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json Writing JsonPath Custom Classifiers>.
updateJsonClassifierRequest_jsonPath :: Lens.Lens' UpdateJsonClassifierRequest (Prelude.Maybe Prelude.Text)
updateJsonClassifierRequest_jsonPath :: (Maybe Text -> f (Maybe Text))
-> UpdateJsonClassifierRequest -> f UpdateJsonClassifierRequest
updateJsonClassifierRequest_jsonPath = (UpdateJsonClassifierRequest -> Maybe Text)
-> (UpdateJsonClassifierRequest
    -> Maybe Text -> UpdateJsonClassifierRequest)
-> Lens
     UpdateJsonClassifierRequest
     UpdateJsonClassifierRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJsonClassifierRequest' {Maybe Text
jsonPath :: Maybe Text
$sel:jsonPath:UpdateJsonClassifierRequest' :: UpdateJsonClassifierRequest -> Maybe Text
jsonPath} -> Maybe Text
jsonPath) (\s :: UpdateJsonClassifierRequest
s@UpdateJsonClassifierRequest' {} Maybe Text
a -> UpdateJsonClassifierRequest
s {$sel:jsonPath:UpdateJsonClassifierRequest' :: Maybe Text
jsonPath = Maybe Text
a} :: UpdateJsonClassifierRequest)

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

instance Prelude.Hashable UpdateJsonClassifierRequest

instance Prelude.NFData UpdateJsonClassifierRequest

instance Core.ToJSON UpdateJsonClassifierRequest where
  toJSON :: UpdateJsonClassifierRequest -> Value
toJSON UpdateJsonClassifierRequest' {Maybe Text
Text
name :: Text
jsonPath :: Maybe Text
$sel:name:UpdateJsonClassifierRequest' :: UpdateJsonClassifierRequest -> Text
$sel:jsonPath:UpdateJsonClassifierRequest' :: UpdateJsonClassifierRequest -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"JsonPath" 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
jsonPath,
            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)
          ]
      )