{-# 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.MacieV2.CreateCustomDataIdentifier
-- 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)
--
-- Creates and defines the criteria and other settings for a custom data
-- identifier.
module Amazonka.MacieV2.CreateCustomDataIdentifier
  ( -- * Creating a Request
    CreateCustomDataIdentifier (..),
    newCreateCustomDataIdentifier,

    -- * Request Lenses
    createCustomDataIdentifier_clientToken,
    createCustomDataIdentifier_regex,
    createCustomDataIdentifier_name,
    createCustomDataIdentifier_keywords,
    createCustomDataIdentifier_ignoreWords,
    createCustomDataIdentifier_maximumMatchDistance,
    createCustomDataIdentifier_description,
    createCustomDataIdentifier_tags,

    -- * Destructuring the Response
    CreateCustomDataIdentifierResponse (..),
    newCreateCustomDataIdentifierResponse,

    -- * Response Lenses
    createCustomDataIdentifierResponse_customDataIdentifierId,
    createCustomDataIdentifierResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateCustomDataIdentifier' smart constructor.
data CreateCustomDataIdentifier = CreateCustomDataIdentifier'
  { -- | A unique, case-sensitive token that you provide to ensure the
    -- idempotency of the request.
    CreateCustomDataIdentifier -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The regular expression (/regex/) that defines the pattern to match. The
    -- expression can contain as many as 512 characters.
    CreateCustomDataIdentifier -> Maybe Text
regex :: Prelude.Maybe Prelude.Text,
    -- | A custom name for the custom data identifier. The name can contain as
    -- many as 128 characters.
    --
    -- We strongly recommend that you avoid including any sensitive data in the
    -- name of a custom data identifier. Other users of your account might be
    -- able to see the identifier\'s name, depending on the actions that
    -- they\'re allowed to perform in Amazon Macie.
    CreateCustomDataIdentifier -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | An array that lists specific character sequences (keywords), one of
    -- which must be within proximity (maximumMatchDistance) of the regular
    -- expression to match. The array can contain as many as 50 keywords. Each
    -- keyword can contain 3-90 UTF-8 characters. Keywords aren\'t case
    -- sensitive.
    CreateCustomDataIdentifier -> Maybe [Text]
keywords :: Prelude.Maybe [Prelude.Text],
    -- | An array that lists specific character sequences (ignore words) to
    -- exclude from the results. If the text matched by the regular expression
    -- is the same as any string in this array, Amazon Macie ignores it. The
    -- array can contain as many as 10 ignore words. Each ignore word can
    -- contain 4-90 UTF-8 characters. Ignore words are case sensitive.
    CreateCustomDataIdentifier -> Maybe [Text]
ignoreWords :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of characters that can exist between text that
    -- matches the regex pattern and the character sequences specified by the
    -- keywords array. Amazon Macie includes or excludes a result based on the
    -- proximity of a keyword to text that matches the regex pattern. The
    -- distance can be 1-300 characters. The default value is 50.
    CreateCustomDataIdentifier -> Maybe Int
maximumMatchDistance :: Prelude.Maybe Prelude.Int,
    -- | A custom description of the custom data identifier. The description can
    -- contain as many as 512 characters.
    --
    -- We strongly recommend that you avoid including any sensitive data in the
    -- description of a custom data identifier. Other users of your account
    -- might be able to see the identifier\'s description, depending on the
    -- actions that they\'re allowed to perform in Amazon Macie.
    CreateCustomDataIdentifier -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A map of key-value pairs that specifies the tags to associate with the
    -- custom data identifier.
    --
    -- A custom data identifier can have a maximum of 50 tags. Each tag
    -- consists of a tag key and an associated tag value. The maximum length of
    -- a tag key is 128 characters. The maximum length of a tag value is 256
    -- characters.
    CreateCustomDataIdentifier -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (CreateCustomDataIdentifier -> CreateCustomDataIdentifier -> Bool
(CreateCustomDataIdentifier -> CreateCustomDataIdentifier -> Bool)
-> (CreateCustomDataIdentifier
    -> CreateCustomDataIdentifier -> Bool)
-> Eq CreateCustomDataIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomDataIdentifier -> CreateCustomDataIdentifier -> Bool
$c/= :: CreateCustomDataIdentifier -> CreateCustomDataIdentifier -> Bool
== :: CreateCustomDataIdentifier -> CreateCustomDataIdentifier -> Bool
$c== :: CreateCustomDataIdentifier -> CreateCustomDataIdentifier -> Bool
Prelude.Eq, ReadPrec [CreateCustomDataIdentifier]
ReadPrec CreateCustomDataIdentifier
Int -> ReadS CreateCustomDataIdentifier
ReadS [CreateCustomDataIdentifier]
(Int -> ReadS CreateCustomDataIdentifier)
-> ReadS [CreateCustomDataIdentifier]
-> ReadPrec CreateCustomDataIdentifier
-> ReadPrec [CreateCustomDataIdentifier]
-> Read CreateCustomDataIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomDataIdentifier]
$creadListPrec :: ReadPrec [CreateCustomDataIdentifier]
readPrec :: ReadPrec CreateCustomDataIdentifier
$creadPrec :: ReadPrec CreateCustomDataIdentifier
readList :: ReadS [CreateCustomDataIdentifier]
$creadList :: ReadS [CreateCustomDataIdentifier]
readsPrec :: Int -> ReadS CreateCustomDataIdentifier
$creadsPrec :: Int -> ReadS CreateCustomDataIdentifier
Prelude.Read, Int -> CreateCustomDataIdentifier -> ShowS
[CreateCustomDataIdentifier] -> ShowS
CreateCustomDataIdentifier -> String
(Int -> CreateCustomDataIdentifier -> ShowS)
-> (CreateCustomDataIdentifier -> String)
-> ([CreateCustomDataIdentifier] -> ShowS)
-> Show CreateCustomDataIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomDataIdentifier] -> ShowS
$cshowList :: [CreateCustomDataIdentifier] -> ShowS
show :: CreateCustomDataIdentifier -> String
$cshow :: CreateCustomDataIdentifier -> String
showsPrec :: Int -> CreateCustomDataIdentifier -> ShowS
$cshowsPrec :: Int -> CreateCustomDataIdentifier -> ShowS
Prelude.Show, (forall x.
 CreateCustomDataIdentifier -> Rep CreateCustomDataIdentifier x)
-> (forall x.
    Rep CreateCustomDataIdentifier x -> CreateCustomDataIdentifier)
-> Generic CreateCustomDataIdentifier
forall x.
Rep CreateCustomDataIdentifier x -> CreateCustomDataIdentifier
forall x.
CreateCustomDataIdentifier -> Rep CreateCustomDataIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCustomDataIdentifier x -> CreateCustomDataIdentifier
$cfrom :: forall x.
CreateCustomDataIdentifier -> Rep CreateCustomDataIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomDataIdentifier' 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:
--
-- 'clientToken', 'createCustomDataIdentifier_clientToken' - A unique, case-sensitive token that you provide to ensure the
-- idempotency of the request.
--
-- 'regex', 'createCustomDataIdentifier_regex' - The regular expression (/regex/) that defines the pattern to match. The
-- expression can contain as many as 512 characters.
--
-- 'name', 'createCustomDataIdentifier_name' - A custom name for the custom data identifier. The name can contain as
-- many as 128 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- name of a custom data identifier. Other users of your account might be
-- able to see the identifier\'s name, depending on the actions that
-- they\'re allowed to perform in Amazon Macie.
--
-- 'keywords', 'createCustomDataIdentifier_keywords' - An array that lists specific character sequences (keywords), one of
-- which must be within proximity (maximumMatchDistance) of the regular
-- expression to match. The array can contain as many as 50 keywords. Each
-- keyword can contain 3-90 UTF-8 characters. Keywords aren\'t case
-- sensitive.
--
-- 'ignoreWords', 'createCustomDataIdentifier_ignoreWords' - An array that lists specific character sequences (ignore words) to
-- exclude from the results. If the text matched by the regular expression
-- is the same as any string in this array, Amazon Macie ignores it. The
-- array can contain as many as 10 ignore words. Each ignore word can
-- contain 4-90 UTF-8 characters. Ignore words are case sensitive.
--
-- 'maximumMatchDistance', 'createCustomDataIdentifier_maximumMatchDistance' - The maximum number of characters that can exist between text that
-- matches the regex pattern and the character sequences specified by the
-- keywords array. Amazon Macie includes or excludes a result based on the
-- proximity of a keyword to text that matches the regex pattern. The
-- distance can be 1-300 characters. The default value is 50.
--
-- 'description', 'createCustomDataIdentifier_description' - A custom description of the custom data identifier. The description can
-- contain as many as 512 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- description of a custom data identifier. Other users of your account
-- might be able to see the identifier\'s description, depending on the
-- actions that they\'re allowed to perform in Amazon Macie.
--
-- 'tags', 'createCustomDataIdentifier_tags' - A map of key-value pairs that specifies the tags to associate with the
-- custom data identifier.
--
-- A custom data identifier can have a maximum of 50 tags. Each tag
-- consists of a tag key and an associated tag value. The maximum length of
-- a tag key is 128 characters. The maximum length of a tag value is 256
-- characters.
newCreateCustomDataIdentifier ::
  CreateCustomDataIdentifier
newCreateCustomDataIdentifier :: CreateCustomDataIdentifier
newCreateCustomDataIdentifier =
  CreateCustomDataIdentifier' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe (HashMap Text Text)
-> CreateCustomDataIdentifier
CreateCustomDataIdentifier'
    { $sel:clientToken:CreateCustomDataIdentifier' :: Maybe Text
clientToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:regex:CreateCustomDataIdentifier' :: Maybe Text
regex = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateCustomDataIdentifier' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keywords:CreateCustomDataIdentifier' :: Maybe [Text]
keywords = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:ignoreWords:CreateCustomDataIdentifier' :: Maybe [Text]
ignoreWords = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumMatchDistance:CreateCustomDataIdentifier' :: Maybe Int
maximumMatchDistance = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateCustomDataIdentifier' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateCustomDataIdentifier' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | A unique, case-sensitive token that you provide to ensure the
-- idempotency of the request.
createCustomDataIdentifier_clientToken :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe Prelude.Text)
createCustomDataIdentifier_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_clientToken = (CreateCustomDataIdentifier -> Maybe Text)
-> (CreateCustomDataIdentifier
    -> Maybe Text -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe Text
a -> CreateCustomDataIdentifier
s {$sel:clientToken:CreateCustomDataIdentifier' :: Maybe Text
clientToken = Maybe Text
a} :: CreateCustomDataIdentifier)

-- | The regular expression (/regex/) that defines the pattern to match. The
-- expression can contain as many as 512 characters.
createCustomDataIdentifier_regex :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe Prelude.Text)
createCustomDataIdentifier_regex :: (Maybe Text -> f (Maybe Text))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_regex = (CreateCustomDataIdentifier -> Maybe Text)
-> (CreateCustomDataIdentifier
    -> Maybe Text -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe Text
regex :: Maybe Text
$sel:regex:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
regex} -> Maybe Text
regex) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe Text
a -> CreateCustomDataIdentifier
s {$sel:regex:CreateCustomDataIdentifier' :: Maybe Text
regex = Maybe Text
a} :: CreateCustomDataIdentifier)

-- | A custom name for the custom data identifier. The name can contain as
-- many as 128 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- name of a custom data identifier. Other users of your account might be
-- able to see the identifier\'s name, depending on the actions that
-- they\'re allowed to perform in Amazon Macie.
createCustomDataIdentifier_name :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe Prelude.Text)
createCustomDataIdentifier_name :: (Maybe Text -> f (Maybe Text))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_name = (CreateCustomDataIdentifier -> Maybe Text)
-> (CreateCustomDataIdentifier
    -> Maybe Text -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe Text
name :: Maybe Text
$sel:name:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe Text
a -> CreateCustomDataIdentifier
s {$sel:name:CreateCustomDataIdentifier' :: Maybe Text
name = Maybe Text
a} :: CreateCustomDataIdentifier)

-- | An array that lists specific character sequences (keywords), one of
-- which must be within proximity (maximumMatchDistance) of the regular
-- expression to match. The array can contain as many as 50 keywords. Each
-- keyword can contain 3-90 UTF-8 characters. Keywords aren\'t case
-- sensitive.
createCustomDataIdentifier_keywords :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe [Prelude.Text])
createCustomDataIdentifier_keywords :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_keywords = (CreateCustomDataIdentifier -> Maybe [Text])
-> (CreateCustomDataIdentifier
    -> Maybe [Text] -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe [Text]
keywords :: Maybe [Text]
$sel:keywords:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe [Text]
keywords} -> Maybe [Text]
keywords) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe [Text]
a -> CreateCustomDataIdentifier
s {$sel:keywords:CreateCustomDataIdentifier' :: Maybe [Text]
keywords = Maybe [Text]
a} :: CreateCustomDataIdentifier) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateCustomDataIdentifier
-> f CreateCustomDataIdentifier
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

-- | An array that lists specific character sequences (ignore words) to
-- exclude from the results. If the text matched by the regular expression
-- is the same as any string in this array, Amazon Macie ignores it. The
-- array can contain as many as 10 ignore words. Each ignore word can
-- contain 4-90 UTF-8 characters. Ignore words are case sensitive.
createCustomDataIdentifier_ignoreWords :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe [Prelude.Text])
createCustomDataIdentifier_ignoreWords :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_ignoreWords = (CreateCustomDataIdentifier -> Maybe [Text])
-> (CreateCustomDataIdentifier
    -> Maybe [Text] -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe [Text]
ignoreWords :: Maybe [Text]
$sel:ignoreWords:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe [Text]
ignoreWords} -> Maybe [Text]
ignoreWords) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe [Text]
a -> CreateCustomDataIdentifier
s {$sel:ignoreWords:CreateCustomDataIdentifier' :: Maybe [Text]
ignoreWords = Maybe [Text]
a} :: CreateCustomDataIdentifier) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateCustomDataIdentifier
-> f CreateCustomDataIdentifier
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 maximum number of characters that can exist between text that
-- matches the regex pattern and the character sequences specified by the
-- keywords array. Amazon Macie includes or excludes a result based on the
-- proximity of a keyword to text that matches the regex pattern. The
-- distance can be 1-300 characters. The default value is 50.
createCustomDataIdentifier_maximumMatchDistance :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe Prelude.Int)
createCustomDataIdentifier_maximumMatchDistance :: (Maybe Int -> f (Maybe Int))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_maximumMatchDistance = (CreateCustomDataIdentifier -> Maybe Int)
-> (CreateCustomDataIdentifier
    -> Maybe Int -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe Int
maximumMatchDistance :: Maybe Int
$sel:maximumMatchDistance:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Int
maximumMatchDistance} -> Maybe Int
maximumMatchDistance) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe Int
a -> CreateCustomDataIdentifier
s {$sel:maximumMatchDistance:CreateCustomDataIdentifier' :: Maybe Int
maximumMatchDistance = Maybe Int
a} :: CreateCustomDataIdentifier)

-- | A custom description of the custom data identifier. The description can
-- contain as many as 512 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- description of a custom data identifier. Other users of your account
-- might be able to see the identifier\'s description, depending on the
-- actions that they\'re allowed to perform in Amazon Macie.
createCustomDataIdentifier_description :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe Prelude.Text)
createCustomDataIdentifier_description :: (Maybe Text -> f (Maybe Text))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_description = (CreateCustomDataIdentifier -> Maybe Text)
-> (CreateCustomDataIdentifier
    -> Maybe Text -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe Text
description :: Maybe Text
$sel:description:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe Text
a -> CreateCustomDataIdentifier
s {$sel:description:CreateCustomDataIdentifier' :: Maybe Text
description = Maybe Text
a} :: CreateCustomDataIdentifier)

-- | A map of key-value pairs that specifies the tags to associate with the
-- custom data identifier.
--
-- A custom data identifier can have a maximum of 50 tags. Each tag
-- consists of a tag key and an associated tag value. The maximum length of
-- a tag key is 128 characters. The maximum length of a tag value is 256
-- characters.
createCustomDataIdentifier_tags :: Lens.Lens' CreateCustomDataIdentifier (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createCustomDataIdentifier_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier
createCustomDataIdentifier_tags = (CreateCustomDataIdentifier -> Maybe (HashMap Text Text))
-> (CreateCustomDataIdentifier
    -> Maybe (HashMap Text Text) -> CreateCustomDataIdentifier)
-> Lens
     CreateCustomDataIdentifier
     CreateCustomDataIdentifier
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifier' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateCustomDataIdentifier
s@CreateCustomDataIdentifier' {} Maybe (HashMap Text Text)
a -> CreateCustomDataIdentifier
s {$sel:tags:CreateCustomDataIdentifier' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateCustomDataIdentifier) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateCustomDataIdentifier -> f CreateCustomDataIdentifier)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateCustomDataIdentifier
-> f CreateCustomDataIdentifier
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateCustomDataIdentifier where
  type
    AWSResponse CreateCustomDataIdentifier =
      CreateCustomDataIdentifierResponse
  request :: CreateCustomDataIdentifier -> Request CreateCustomDataIdentifier
request = Service
-> CreateCustomDataIdentifier -> Request CreateCustomDataIdentifier
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCustomDataIdentifier
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCustomDataIdentifier)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateCustomDataIdentifier))
-> Logger
-> Service
-> Proxy CreateCustomDataIdentifier
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCustomDataIdentifier)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateCustomDataIdentifierResponse
CreateCustomDataIdentifierResponse'
            (Maybe Text -> Int -> CreateCustomDataIdentifierResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateCustomDataIdentifierResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"customDataIdentifierId")
            Either String (Int -> CreateCustomDataIdentifierResponse)
-> Either String Int
-> Either String CreateCustomDataIdentifierResponse
forall (f :: * -> *) a b. Applicative f => 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 CreateCustomDataIdentifier

instance Prelude.NFData CreateCustomDataIdentifier

instance Core.ToHeaders CreateCustomDataIdentifier where
  toHeaders :: CreateCustomDataIdentifier -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateCustomDataIdentifier -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateCustomDataIdentifier where
  toJSON :: CreateCustomDataIdentifier -> Value
toJSON CreateCustomDataIdentifier' {Maybe Int
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
maximumMatchDistance :: Maybe Int
ignoreWords :: Maybe [Text]
keywords :: Maybe [Text]
name :: Maybe Text
regex :: Maybe Text
clientToken :: Maybe Text
$sel:tags:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe (HashMap Text Text)
$sel:description:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
$sel:maximumMatchDistance:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Int
$sel:ignoreWords:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe [Text]
$sel:keywords:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe [Text]
$sel:name:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
$sel:regex:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
$sel:clientToken:CreateCustomDataIdentifier' :: CreateCustomDataIdentifier -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" 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
clientToken,
            (Text
"regex" 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
regex,
            (Text
"name" 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
name,
            (Text
"keywords" 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]
keywords,
            (Text
"ignoreWords" 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]
ignoreWords,
            (Text
"maximumMatchDistance" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maximumMatchDistance,
            (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,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
          ]
      )

instance Core.ToPath CreateCustomDataIdentifier where
  toPath :: CreateCustomDataIdentifier -> ByteString
toPath = ByteString -> CreateCustomDataIdentifier -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/custom-data-identifiers"

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

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

-- |
-- Create a value of 'CreateCustomDataIdentifierResponse' 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:
--
-- 'customDataIdentifierId', 'createCustomDataIdentifierResponse_customDataIdentifierId' - The unique identifier for the custom data identifier that was created.
--
-- 'httpStatus', 'createCustomDataIdentifierResponse_httpStatus' - The response's http status code.
newCreateCustomDataIdentifierResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCustomDataIdentifierResponse
newCreateCustomDataIdentifierResponse :: Int -> CreateCustomDataIdentifierResponse
newCreateCustomDataIdentifierResponse Int
pHttpStatus_ =
  CreateCustomDataIdentifierResponse' :: Maybe Text -> Int -> CreateCustomDataIdentifierResponse
CreateCustomDataIdentifierResponse'
    { $sel:customDataIdentifierId:CreateCustomDataIdentifierResponse' :: Maybe Text
customDataIdentifierId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCustomDataIdentifierResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier for the custom data identifier that was created.
createCustomDataIdentifierResponse_customDataIdentifierId :: Lens.Lens' CreateCustomDataIdentifierResponse (Prelude.Maybe Prelude.Text)
createCustomDataIdentifierResponse_customDataIdentifierId :: (Maybe Text -> f (Maybe Text))
-> CreateCustomDataIdentifierResponse
-> f CreateCustomDataIdentifierResponse
createCustomDataIdentifierResponse_customDataIdentifierId = (CreateCustomDataIdentifierResponse -> Maybe Text)
-> (CreateCustomDataIdentifierResponse
    -> Maybe Text -> CreateCustomDataIdentifierResponse)
-> Lens
     CreateCustomDataIdentifierResponse
     CreateCustomDataIdentifierResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomDataIdentifierResponse' {Maybe Text
customDataIdentifierId :: Maybe Text
$sel:customDataIdentifierId:CreateCustomDataIdentifierResponse' :: CreateCustomDataIdentifierResponse -> Maybe Text
customDataIdentifierId} -> Maybe Text
customDataIdentifierId) (\s :: CreateCustomDataIdentifierResponse
s@CreateCustomDataIdentifierResponse' {} Maybe Text
a -> CreateCustomDataIdentifierResponse
s {$sel:customDataIdentifierId:CreateCustomDataIdentifierResponse' :: Maybe Text
customDataIdentifierId = Maybe Text
a} :: CreateCustomDataIdentifierResponse)

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

instance
  Prelude.NFData
    CreateCustomDataIdentifierResponse