{-# 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.Glue.UpdateCrawler
-- 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)
--
-- Updates a crawler. If a crawler is running, you must stop it using
-- @StopCrawler@ before updating it.
module Amazonka.Glue.UpdateCrawler
  ( -- * Creating a Request
    UpdateCrawler (..),
    newUpdateCrawler,

    -- * Request Lenses
    updateCrawler_schemaChangePolicy,
    updateCrawler_schedule,
    updateCrawler_recrawlPolicy,
    updateCrawler_classifiers,
    updateCrawler_role,
    updateCrawler_targets,
    updateCrawler_databaseName,
    updateCrawler_crawlerSecurityConfiguration,
    updateCrawler_lineageConfiguration,
    updateCrawler_configuration,
    updateCrawler_tablePrefix,
    updateCrawler_description,
    updateCrawler_name,

    -- * Destructuring the Response
    UpdateCrawlerResponse (..),
    newUpdateCrawlerResponse,

    -- * Response Lenses
    updateCrawlerResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
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:/ 'newUpdateCrawler' smart constructor.
data UpdateCrawler = UpdateCrawler'
  { -- | The policy for the crawler\'s update and deletion behavior.
    UpdateCrawler -> Maybe SchemaChangePolicy
schemaChangePolicy :: Prelude.Maybe SchemaChangePolicy,
    -- | A @cron@ expression used to specify the schedule (see
    -- <https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html Time-Based Schedules for Jobs and Crawlers>.
    -- For example, to run something every day at 12:15 UTC, you would specify:
    -- @cron(15 12 * * ? *)@.
    UpdateCrawler -> Maybe Text
schedule :: Prelude.Maybe Prelude.Text,
    -- | A policy that specifies whether to crawl the entire dataset again, or to
    -- crawl only folders that were added since the last crawler run.
    UpdateCrawler -> Maybe RecrawlPolicy
recrawlPolicy :: Prelude.Maybe RecrawlPolicy,
    -- | A list of custom classifiers that the user has registered. By default,
    -- all built-in classifiers are included in a crawl, but these custom
    -- classifiers always override the default classifiers for a given
    -- classification.
    UpdateCrawler -> Maybe [Text]
classifiers :: Prelude.Maybe [Prelude.Text],
    -- | The IAM role or Amazon Resource Name (ARN) of an IAM role that is used
    -- by the new crawler to access customer resources.
    UpdateCrawler -> Maybe Text
role' :: Prelude.Maybe Prelude.Text,
    -- | A list of targets to crawl.
    UpdateCrawler -> Maybe CrawlerTargets
targets :: Prelude.Maybe CrawlerTargets,
    -- | The Glue database where results are stored, such as:
    -- @arn:aws:daylight:us-east-1::database\/sometable\/*@.
    UpdateCrawler -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
    -- | The name of the @SecurityConfiguration@ structure to be used by this
    -- crawler.
    UpdateCrawler -> Maybe Text
crawlerSecurityConfiguration :: Prelude.Maybe Prelude.Text,
    -- | Specifies data lineage configuration settings for the crawler.
    UpdateCrawler -> Maybe LineageConfiguration
lineageConfiguration :: Prelude.Maybe LineageConfiguration,
    -- | Crawler configuration information. This versioned JSON string allows
    -- users to specify aspects of a crawler\'s behavior. For more information,
    -- see
    -- <https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html Configuring a Crawler>.
    UpdateCrawler -> Maybe Text
configuration :: Prelude.Maybe Prelude.Text,
    -- | The table prefix used for catalog tables that are created.
    UpdateCrawler -> Maybe Text
tablePrefix :: Prelude.Maybe Prelude.Text,
    -- | A description of the new crawler.
    UpdateCrawler -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Name of the new crawler.
    UpdateCrawler -> Text
name :: Prelude.Text
  }
  deriving (UpdateCrawler -> UpdateCrawler -> Bool
(UpdateCrawler -> UpdateCrawler -> Bool)
-> (UpdateCrawler -> UpdateCrawler -> Bool) -> Eq UpdateCrawler
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCrawler -> UpdateCrawler -> Bool
$c/= :: UpdateCrawler -> UpdateCrawler -> Bool
== :: UpdateCrawler -> UpdateCrawler -> Bool
$c== :: UpdateCrawler -> UpdateCrawler -> Bool
Prelude.Eq, ReadPrec [UpdateCrawler]
ReadPrec UpdateCrawler
Int -> ReadS UpdateCrawler
ReadS [UpdateCrawler]
(Int -> ReadS UpdateCrawler)
-> ReadS [UpdateCrawler]
-> ReadPrec UpdateCrawler
-> ReadPrec [UpdateCrawler]
-> Read UpdateCrawler
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCrawler]
$creadListPrec :: ReadPrec [UpdateCrawler]
readPrec :: ReadPrec UpdateCrawler
$creadPrec :: ReadPrec UpdateCrawler
readList :: ReadS [UpdateCrawler]
$creadList :: ReadS [UpdateCrawler]
readsPrec :: Int -> ReadS UpdateCrawler
$creadsPrec :: Int -> ReadS UpdateCrawler
Prelude.Read, Int -> UpdateCrawler -> ShowS
[UpdateCrawler] -> ShowS
UpdateCrawler -> String
(Int -> UpdateCrawler -> ShowS)
-> (UpdateCrawler -> String)
-> ([UpdateCrawler] -> ShowS)
-> Show UpdateCrawler
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCrawler] -> ShowS
$cshowList :: [UpdateCrawler] -> ShowS
show :: UpdateCrawler -> String
$cshow :: UpdateCrawler -> String
showsPrec :: Int -> UpdateCrawler -> ShowS
$cshowsPrec :: Int -> UpdateCrawler -> ShowS
Prelude.Show, (forall x. UpdateCrawler -> Rep UpdateCrawler x)
-> (forall x. Rep UpdateCrawler x -> UpdateCrawler)
-> Generic UpdateCrawler
forall x. Rep UpdateCrawler x -> UpdateCrawler
forall x. UpdateCrawler -> Rep UpdateCrawler x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCrawler x -> UpdateCrawler
$cfrom :: forall x. UpdateCrawler -> Rep UpdateCrawler x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCrawler' 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:
--
-- 'schemaChangePolicy', 'updateCrawler_schemaChangePolicy' - The policy for the crawler\'s update and deletion behavior.
--
-- 'schedule', 'updateCrawler_schedule' - A @cron@ expression used to specify the schedule (see
-- <https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html Time-Based Schedules for Jobs and Crawlers>.
-- For example, to run something every day at 12:15 UTC, you would specify:
-- @cron(15 12 * * ? *)@.
--
-- 'recrawlPolicy', 'updateCrawler_recrawlPolicy' - A policy that specifies whether to crawl the entire dataset again, or to
-- crawl only folders that were added since the last crawler run.
--
-- 'classifiers', 'updateCrawler_classifiers' - A list of custom classifiers that the user has registered. By default,
-- all built-in classifiers are included in a crawl, but these custom
-- classifiers always override the default classifiers for a given
-- classification.
--
-- 'role'', 'updateCrawler_role' - The IAM role or Amazon Resource Name (ARN) of an IAM role that is used
-- by the new crawler to access customer resources.
--
-- 'targets', 'updateCrawler_targets' - A list of targets to crawl.
--
-- 'databaseName', 'updateCrawler_databaseName' - The Glue database where results are stored, such as:
-- @arn:aws:daylight:us-east-1::database\/sometable\/*@.
--
-- 'crawlerSecurityConfiguration', 'updateCrawler_crawlerSecurityConfiguration' - The name of the @SecurityConfiguration@ structure to be used by this
-- crawler.
--
-- 'lineageConfiguration', 'updateCrawler_lineageConfiguration' - Specifies data lineage configuration settings for the crawler.
--
-- 'configuration', 'updateCrawler_configuration' - Crawler configuration information. This versioned JSON string allows
-- users to specify aspects of a crawler\'s behavior. For more information,
-- see
-- <https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html Configuring a Crawler>.
--
-- 'tablePrefix', 'updateCrawler_tablePrefix' - The table prefix used for catalog tables that are created.
--
-- 'description', 'updateCrawler_description' - A description of the new crawler.
--
-- 'name', 'updateCrawler_name' - Name of the new crawler.
newUpdateCrawler ::
  -- | 'name'
  Prelude.Text ->
  UpdateCrawler
newUpdateCrawler :: Text -> UpdateCrawler
newUpdateCrawler Text
pName_ =
  UpdateCrawler' :: Maybe SchemaChangePolicy
-> Maybe Text
-> Maybe RecrawlPolicy
-> Maybe [Text]
-> Maybe Text
-> Maybe CrawlerTargets
-> Maybe Text
-> Maybe Text
-> Maybe LineageConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> UpdateCrawler
UpdateCrawler'
    { $sel:schemaChangePolicy:UpdateCrawler' :: Maybe SchemaChangePolicy
schemaChangePolicy =
        Maybe SchemaChangePolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:schedule:UpdateCrawler' :: Maybe Text
schedule = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recrawlPolicy:UpdateCrawler' :: Maybe RecrawlPolicy
recrawlPolicy = Maybe RecrawlPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:classifiers:UpdateCrawler' :: Maybe [Text]
classifiers = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:role':UpdateCrawler' :: Maybe Text
role' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:UpdateCrawler' :: Maybe CrawlerTargets
targets = Maybe CrawlerTargets
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:UpdateCrawler' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:crawlerSecurityConfiguration:UpdateCrawler' :: Maybe Text
crawlerSecurityConfiguration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lineageConfiguration:UpdateCrawler' :: Maybe LineageConfiguration
lineageConfiguration = Maybe LineageConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:configuration:UpdateCrawler' :: Maybe Text
configuration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tablePrefix:UpdateCrawler' :: Maybe Text
tablePrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateCrawler' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateCrawler' :: Text
name = Text
pName_
    }

-- | The policy for the crawler\'s update and deletion behavior.
updateCrawler_schemaChangePolicy :: Lens.Lens' UpdateCrawler (Prelude.Maybe SchemaChangePolicy)
updateCrawler_schemaChangePolicy :: (Maybe SchemaChangePolicy -> f (Maybe SchemaChangePolicy))
-> UpdateCrawler -> f UpdateCrawler
updateCrawler_schemaChangePolicy = (UpdateCrawler -> Maybe SchemaChangePolicy)
-> (UpdateCrawler -> Maybe SchemaChangePolicy -> UpdateCrawler)
-> Lens
     UpdateCrawler
     UpdateCrawler
     (Maybe SchemaChangePolicy)
     (Maybe SchemaChangePolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe SchemaChangePolicy
schemaChangePolicy :: Maybe SchemaChangePolicy
$sel:schemaChangePolicy:UpdateCrawler' :: UpdateCrawler -> Maybe SchemaChangePolicy
schemaChangePolicy} -> Maybe SchemaChangePolicy
schemaChangePolicy) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe SchemaChangePolicy
a -> UpdateCrawler
s {$sel:schemaChangePolicy:UpdateCrawler' :: Maybe SchemaChangePolicy
schemaChangePolicy = Maybe SchemaChangePolicy
a} :: UpdateCrawler)

-- | A @cron@ expression used to specify the schedule (see
-- <https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html Time-Based Schedules for Jobs and Crawlers>.
-- For example, to run something every day at 12:15 UTC, you would specify:
-- @cron(15 12 * * ? *)@.
updateCrawler_schedule :: Lens.Lens' UpdateCrawler (Prelude.Maybe Prelude.Text)
updateCrawler_schedule :: (Maybe Text -> f (Maybe Text)) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_schedule = (UpdateCrawler -> Maybe Text)
-> (UpdateCrawler -> Maybe Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe Text
schedule :: Maybe Text
$sel:schedule:UpdateCrawler' :: UpdateCrawler -> Maybe Text
schedule} -> Maybe Text
schedule) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe Text
a -> UpdateCrawler
s {$sel:schedule:UpdateCrawler' :: Maybe Text
schedule = Maybe Text
a} :: UpdateCrawler)

-- | A policy that specifies whether to crawl the entire dataset again, or to
-- crawl only folders that were added since the last crawler run.
updateCrawler_recrawlPolicy :: Lens.Lens' UpdateCrawler (Prelude.Maybe RecrawlPolicy)
updateCrawler_recrawlPolicy :: (Maybe RecrawlPolicy -> f (Maybe RecrawlPolicy))
-> UpdateCrawler -> f UpdateCrawler
updateCrawler_recrawlPolicy = (UpdateCrawler -> Maybe RecrawlPolicy)
-> (UpdateCrawler -> Maybe RecrawlPolicy -> UpdateCrawler)
-> Lens
     UpdateCrawler
     UpdateCrawler
     (Maybe RecrawlPolicy)
     (Maybe RecrawlPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe RecrawlPolicy
recrawlPolicy :: Maybe RecrawlPolicy
$sel:recrawlPolicy:UpdateCrawler' :: UpdateCrawler -> Maybe RecrawlPolicy
recrawlPolicy} -> Maybe RecrawlPolicy
recrawlPolicy) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe RecrawlPolicy
a -> UpdateCrawler
s {$sel:recrawlPolicy:UpdateCrawler' :: Maybe RecrawlPolicy
recrawlPolicy = Maybe RecrawlPolicy
a} :: UpdateCrawler)

-- | A list of custom classifiers that the user has registered. By default,
-- all built-in classifiers are included in a crawl, but these custom
-- classifiers always override the default classifiers for a given
-- classification.
updateCrawler_classifiers :: Lens.Lens' UpdateCrawler (Prelude.Maybe [Prelude.Text])
updateCrawler_classifiers :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateCrawler -> f UpdateCrawler
updateCrawler_classifiers = (UpdateCrawler -> Maybe [Text])
-> (UpdateCrawler -> Maybe [Text] -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe [Text]
classifiers :: Maybe [Text]
$sel:classifiers:UpdateCrawler' :: UpdateCrawler -> Maybe [Text]
classifiers} -> Maybe [Text]
classifiers) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe [Text]
a -> UpdateCrawler
s {$sel:classifiers:UpdateCrawler' :: Maybe [Text]
classifiers = Maybe [Text]
a} :: UpdateCrawler) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateCrawler -> f UpdateCrawler)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateCrawler
-> f UpdateCrawler
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IAM role or Amazon Resource Name (ARN) of an IAM role that is used
-- by the new crawler to access customer resources.
updateCrawler_role :: Lens.Lens' UpdateCrawler (Prelude.Maybe Prelude.Text)
updateCrawler_role :: (Maybe Text -> f (Maybe Text)) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_role = (UpdateCrawler -> Maybe Text)
-> (UpdateCrawler -> Maybe Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe Text
role' :: Maybe Text
$sel:role':UpdateCrawler' :: UpdateCrawler -> Maybe Text
role'} -> Maybe Text
role') (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe Text
a -> UpdateCrawler
s {$sel:role':UpdateCrawler' :: Maybe Text
role' = Maybe Text
a} :: UpdateCrawler)

-- | A list of targets to crawl.
updateCrawler_targets :: Lens.Lens' UpdateCrawler (Prelude.Maybe CrawlerTargets)
updateCrawler_targets :: (Maybe CrawlerTargets -> f (Maybe CrawlerTargets))
-> UpdateCrawler -> f UpdateCrawler
updateCrawler_targets = (UpdateCrawler -> Maybe CrawlerTargets)
-> (UpdateCrawler -> Maybe CrawlerTargets -> UpdateCrawler)
-> Lens
     UpdateCrawler
     UpdateCrawler
     (Maybe CrawlerTargets)
     (Maybe CrawlerTargets)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe CrawlerTargets
targets :: Maybe CrawlerTargets
$sel:targets:UpdateCrawler' :: UpdateCrawler -> Maybe CrawlerTargets
targets} -> Maybe CrawlerTargets
targets) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe CrawlerTargets
a -> UpdateCrawler
s {$sel:targets:UpdateCrawler' :: Maybe CrawlerTargets
targets = Maybe CrawlerTargets
a} :: UpdateCrawler)

-- | The Glue database where results are stored, such as:
-- @arn:aws:daylight:us-east-1::database\/sometable\/*@.
updateCrawler_databaseName :: Lens.Lens' UpdateCrawler (Prelude.Maybe Prelude.Text)
updateCrawler_databaseName :: (Maybe Text -> f (Maybe Text)) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_databaseName = (UpdateCrawler -> Maybe Text)
-> (UpdateCrawler -> Maybe Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:UpdateCrawler' :: UpdateCrawler -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe Text
a -> UpdateCrawler
s {$sel:databaseName:UpdateCrawler' :: Maybe Text
databaseName = Maybe Text
a} :: UpdateCrawler)

-- | The name of the @SecurityConfiguration@ structure to be used by this
-- crawler.
updateCrawler_crawlerSecurityConfiguration :: Lens.Lens' UpdateCrawler (Prelude.Maybe Prelude.Text)
updateCrawler_crawlerSecurityConfiguration :: (Maybe Text -> f (Maybe Text)) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_crawlerSecurityConfiguration = (UpdateCrawler -> Maybe Text)
-> (UpdateCrawler -> Maybe Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe Text
crawlerSecurityConfiguration :: Maybe Text
$sel:crawlerSecurityConfiguration:UpdateCrawler' :: UpdateCrawler -> Maybe Text
crawlerSecurityConfiguration} -> Maybe Text
crawlerSecurityConfiguration) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe Text
a -> UpdateCrawler
s {$sel:crawlerSecurityConfiguration:UpdateCrawler' :: Maybe Text
crawlerSecurityConfiguration = Maybe Text
a} :: UpdateCrawler)

-- | Specifies data lineage configuration settings for the crawler.
updateCrawler_lineageConfiguration :: Lens.Lens' UpdateCrawler (Prelude.Maybe LineageConfiguration)
updateCrawler_lineageConfiguration :: (Maybe LineageConfiguration -> f (Maybe LineageConfiguration))
-> UpdateCrawler -> f UpdateCrawler
updateCrawler_lineageConfiguration = (UpdateCrawler -> Maybe LineageConfiguration)
-> (UpdateCrawler -> Maybe LineageConfiguration -> UpdateCrawler)
-> Lens
     UpdateCrawler
     UpdateCrawler
     (Maybe LineageConfiguration)
     (Maybe LineageConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe LineageConfiguration
lineageConfiguration :: Maybe LineageConfiguration
$sel:lineageConfiguration:UpdateCrawler' :: UpdateCrawler -> Maybe LineageConfiguration
lineageConfiguration} -> Maybe LineageConfiguration
lineageConfiguration) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe LineageConfiguration
a -> UpdateCrawler
s {$sel:lineageConfiguration:UpdateCrawler' :: Maybe LineageConfiguration
lineageConfiguration = Maybe LineageConfiguration
a} :: UpdateCrawler)

-- | Crawler configuration information. This versioned JSON string allows
-- users to specify aspects of a crawler\'s behavior. For more information,
-- see
-- <https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html Configuring a Crawler>.
updateCrawler_configuration :: Lens.Lens' UpdateCrawler (Prelude.Maybe Prelude.Text)
updateCrawler_configuration :: (Maybe Text -> f (Maybe Text)) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_configuration = (UpdateCrawler -> Maybe Text)
-> (UpdateCrawler -> Maybe Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe Text
configuration :: Maybe Text
$sel:configuration:UpdateCrawler' :: UpdateCrawler -> Maybe Text
configuration} -> Maybe Text
configuration) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe Text
a -> UpdateCrawler
s {$sel:configuration:UpdateCrawler' :: Maybe Text
configuration = Maybe Text
a} :: UpdateCrawler)

-- | The table prefix used for catalog tables that are created.
updateCrawler_tablePrefix :: Lens.Lens' UpdateCrawler (Prelude.Maybe Prelude.Text)
updateCrawler_tablePrefix :: (Maybe Text -> f (Maybe Text)) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_tablePrefix = (UpdateCrawler -> Maybe Text)
-> (UpdateCrawler -> Maybe Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe Text
tablePrefix :: Maybe Text
$sel:tablePrefix:UpdateCrawler' :: UpdateCrawler -> Maybe Text
tablePrefix} -> Maybe Text
tablePrefix) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe Text
a -> UpdateCrawler
s {$sel:tablePrefix:UpdateCrawler' :: Maybe Text
tablePrefix = Maybe Text
a} :: UpdateCrawler)

-- | A description of the new crawler.
updateCrawler_description :: Lens.Lens' UpdateCrawler (Prelude.Maybe Prelude.Text)
updateCrawler_description :: (Maybe Text -> f (Maybe Text)) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_description = (UpdateCrawler -> Maybe Text)
-> (UpdateCrawler -> Maybe Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Maybe Text
description :: Maybe Text
$sel:description:UpdateCrawler' :: UpdateCrawler -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateCrawler
s@UpdateCrawler' {} Maybe Text
a -> UpdateCrawler
s {$sel:description:UpdateCrawler' :: Maybe Text
description = Maybe Text
a} :: UpdateCrawler)

-- | Name of the new crawler.
updateCrawler_name :: Lens.Lens' UpdateCrawler Prelude.Text
updateCrawler_name :: (Text -> f Text) -> UpdateCrawler -> f UpdateCrawler
updateCrawler_name = (UpdateCrawler -> Text)
-> (UpdateCrawler -> Text -> UpdateCrawler)
-> Lens UpdateCrawler UpdateCrawler Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCrawler' {Text
name :: Text
$sel:name:UpdateCrawler' :: UpdateCrawler -> Text
name} -> Text
name) (\s :: UpdateCrawler
s@UpdateCrawler' {} Text
a -> UpdateCrawler
s {$sel:name:UpdateCrawler' :: Text
name = Text
a} :: UpdateCrawler)

instance Core.AWSRequest UpdateCrawler where
  type
    AWSResponse UpdateCrawler =
      UpdateCrawlerResponse
  request :: UpdateCrawler -> Request UpdateCrawler
request = Service -> UpdateCrawler -> Request UpdateCrawler
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateCrawler
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateCrawler)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateCrawler))
-> Logger
-> Service
-> Proxy UpdateCrawler
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateCrawler)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateCrawlerResponse
UpdateCrawlerResponse'
            (Int -> UpdateCrawlerResponse)
-> Either String Int -> Either String UpdateCrawlerResponse
forall (f :: * -> *) a b. Functor 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 UpdateCrawler

instance Prelude.NFData UpdateCrawler

instance Core.ToHeaders UpdateCrawler where
  toHeaders :: UpdateCrawler -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateCrawler -> 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
"AWSGlue.UpdateCrawler" :: 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 UpdateCrawler where
  toJSON :: UpdateCrawler -> Value
toJSON UpdateCrawler' {Maybe [Text]
Maybe Text
Maybe LineageConfiguration
Maybe RecrawlPolicy
Maybe CrawlerTargets
Maybe SchemaChangePolicy
Text
name :: Text
description :: Maybe Text
tablePrefix :: Maybe Text
configuration :: Maybe Text
lineageConfiguration :: Maybe LineageConfiguration
crawlerSecurityConfiguration :: Maybe Text
databaseName :: Maybe Text
targets :: Maybe CrawlerTargets
role' :: Maybe Text
classifiers :: Maybe [Text]
recrawlPolicy :: Maybe RecrawlPolicy
schedule :: Maybe Text
schemaChangePolicy :: Maybe SchemaChangePolicy
$sel:name:UpdateCrawler' :: UpdateCrawler -> Text
$sel:description:UpdateCrawler' :: UpdateCrawler -> Maybe Text
$sel:tablePrefix:UpdateCrawler' :: UpdateCrawler -> Maybe Text
$sel:configuration:UpdateCrawler' :: UpdateCrawler -> Maybe Text
$sel:lineageConfiguration:UpdateCrawler' :: UpdateCrawler -> Maybe LineageConfiguration
$sel:crawlerSecurityConfiguration:UpdateCrawler' :: UpdateCrawler -> Maybe Text
$sel:databaseName:UpdateCrawler' :: UpdateCrawler -> Maybe Text
$sel:targets:UpdateCrawler' :: UpdateCrawler -> Maybe CrawlerTargets
$sel:role':UpdateCrawler' :: UpdateCrawler -> Maybe Text
$sel:classifiers:UpdateCrawler' :: UpdateCrawler -> Maybe [Text]
$sel:recrawlPolicy:UpdateCrawler' :: UpdateCrawler -> Maybe RecrawlPolicy
$sel:schedule:UpdateCrawler' :: UpdateCrawler -> Maybe Text
$sel:schemaChangePolicy:UpdateCrawler' :: UpdateCrawler -> Maybe SchemaChangePolicy
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SchemaChangePolicy" Text -> SchemaChangePolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SchemaChangePolicy -> Pair)
-> Maybe SchemaChangePolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SchemaChangePolicy
schemaChangePolicy,
            (Text
"Schedule" 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
schedule,
            (Text
"RecrawlPolicy" Text -> RecrawlPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RecrawlPolicy -> Pair) -> Maybe RecrawlPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecrawlPolicy
recrawlPolicy,
            (Text
"Classifiers" 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]
classifiers,
            (Text
"Role" 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
role',
            (Text
"Targets" Text -> CrawlerTargets -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CrawlerTargets -> Pair) -> Maybe CrawlerTargets -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CrawlerTargets
targets,
            (Text
"DatabaseName" 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
databaseName,
            (Text
"CrawlerSecurityConfiguration" 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
crawlerSecurityConfiguration,
            (Text
"LineageConfiguration" Text -> LineageConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LineageConfiguration -> Pair)
-> Maybe LineageConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LineageConfiguration
lineageConfiguration,
            (Text
"Configuration" 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
configuration,
            (Text
"TablePrefix" 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
tablePrefix,
            (Text
"Description" 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
description,
            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)
          ]
      )

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

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

-- | /See:/ 'newUpdateCrawlerResponse' smart constructor.
data UpdateCrawlerResponse = UpdateCrawlerResponse'
  { -- | The response's http status code.
    UpdateCrawlerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateCrawlerResponse -> UpdateCrawlerResponse -> Bool
(UpdateCrawlerResponse -> UpdateCrawlerResponse -> Bool)
-> (UpdateCrawlerResponse -> UpdateCrawlerResponse -> Bool)
-> Eq UpdateCrawlerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCrawlerResponse -> UpdateCrawlerResponse -> Bool
$c/= :: UpdateCrawlerResponse -> UpdateCrawlerResponse -> Bool
== :: UpdateCrawlerResponse -> UpdateCrawlerResponse -> Bool
$c== :: UpdateCrawlerResponse -> UpdateCrawlerResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCrawlerResponse]
ReadPrec UpdateCrawlerResponse
Int -> ReadS UpdateCrawlerResponse
ReadS [UpdateCrawlerResponse]
(Int -> ReadS UpdateCrawlerResponse)
-> ReadS [UpdateCrawlerResponse]
-> ReadPrec UpdateCrawlerResponse
-> ReadPrec [UpdateCrawlerResponse]
-> Read UpdateCrawlerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCrawlerResponse]
$creadListPrec :: ReadPrec [UpdateCrawlerResponse]
readPrec :: ReadPrec UpdateCrawlerResponse
$creadPrec :: ReadPrec UpdateCrawlerResponse
readList :: ReadS [UpdateCrawlerResponse]
$creadList :: ReadS [UpdateCrawlerResponse]
readsPrec :: Int -> ReadS UpdateCrawlerResponse
$creadsPrec :: Int -> ReadS UpdateCrawlerResponse
Prelude.Read, Int -> UpdateCrawlerResponse -> ShowS
[UpdateCrawlerResponse] -> ShowS
UpdateCrawlerResponse -> String
(Int -> UpdateCrawlerResponse -> ShowS)
-> (UpdateCrawlerResponse -> String)
-> ([UpdateCrawlerResponse] -> ShowS)
-> Show UpdateCrawlerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCrawlerResponse] -> ShowS
$cshowList :: [UpdateCrawlerResponse] -> ShowS
show :: UpdateCrawlerResponse -> String
$cshow :: UpdateCrawlerResponse -> String
showsPrec :: Int -> UpdateCrawlerResponse -> ShowS
$cshowsPrec :: Int -> UpdateCrawlerResponse -> ShowS
Prelude.Show, (forall x. UpdateCrawlerResponse -> Rep UpdateCrawlerResponse x)
-> (forall x. Rep UpdateCrawlerResponse x -> UpdateCrawlerResponse)
-> Generic UpdateCrawlerResponse
forall x. Rep UpdateCrawlerResponse x -> UpdateCrawlerResponse
forall x. UpdateCrawlerResponse -> Rep UpdateCrawlerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCrawlerResponse x -> UpdateCrawlerResponse
$cfrom :: forall x. UpdateCrawlerResponse -> Rep UpdateCrawlerResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCrawlerResponse' 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:
--
-- 'httpStatus', 'updateCrawlerResponse_httpStatus' - The response's http status code.
newUpdateCrawlerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateCrawlerResponse
newUpdateCrawlerResponse :: Int -> UpdateCrawlerResponse
newUpdateCrawlerResponse Int
pHttpStatus_ =
  UpdateCrawlerResponse' :: Int -> UpdateCrawlerResponse
UpdateCrawlerResponse' {$sel:httpStatus:UpdateCrawlerResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData UpdateCrawlerResponse