{-# 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.Firehose.Types.ElasticsearchDestinationUpdate
-- 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.Firehose.Types.ElasticsearchDestinationUpdate where

import qualified Amazonka.Core as Core
import Amazonka.Firehose.Types.CloudWatchLoggingOptions
import Amazonka.Firehose.Types.ElasticsearchBufferingHints
import Amazonka.Firehose.Types.ElasticsearchIndexRotationPeriod
import Amazonka.Firehose.Types.ElasticsearchRetryOptions
import Amazonka.Firehose.Types.ProcessingConfiguration
import Amazonka.Firehose.Types.S3DestinationUpdate
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an update for a destination in Amazon ES.
--
-- /See:/ 'newElasticsearchDestinationUpdate' smart constructor.
data ElasticsearchDestinationUpdate = ElasticsearchDestinationUpdate'
  { -- | The Elasticsearch index rotation period. Index rotation appends a
    -- timestamp to @IndexName@ to facilitate the expiration of old data. For
    -- more information, see
    -- <https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation Index Rotation for the Amazon ES Destination>.
    -- Default value is @OneDay@.
    ElasticsearchDestinationUpdate
-> Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod :: Prelude.Maybe ElasticsearchIndexRotationPeriod,
    -- | The Elasticsearch type name. For Elasticsearch 6.x, there can be only
    -- one type per index. If you try to specify a new type for an existing
    -- index that already has another type, Kinesis Data Firehose returns an
    -- error during runtime.
    --
    -- If you upgrade Elasticsearch from 6.x to 7.x and don’t update your
    -- delivery stream, Kinesis Data Firehose still delivers data to
    -- Elasticsearch with the old index name and type name. If you want to
    -- update your delivery stream with a new index name, provide an empty
    -- string for @TypeName@.
    ElasticsearchDestinationUpdate -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the Amazon ES domain. The IAM role must have permissions
    -- for @DescribeElasticsearchDomain@, @DescribeElasticsearchDomains@, and
    -- @DescribeElasticsearchDomainConfig@ after assuming the IAM role
    -- specified in @RoleARN@. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
    --
    -- Specify either @ClusterEndpoint@ or @DomainARN@.
    ElasticsearchDestinationUpdate -> Maybe Text
domainARN :: Prelude.Maybe Prelude.Text,
    -- | The CloudWatch logging options for your delivery stream.
    ElasticsearchDestinationUpdate -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Prelude.Maybe CloudWatchLoggingOptions,
    -- | The Amazon S3 destination.
    ElasticsearchDestinationUpdate -> Maybe S3DestinationUpdate
s3Update :: Prelude.Maybe S3DestinationUpdate,
    -- | The buffering options. If no value is specified,
    -- @ElasticsearchBufferingHints@ object default values are used.
    ElasticsearchDestinationUpdate -> Maybe ElasticsearchBufferingHints
bufferingHints :: Prelude.Maybe ElasticsearchBufferingHints,
    -- | The retry behavior in case Kinesis Data Firehose is unable to deliver
    -- documents to Amazon ES. The default value is 300 (5 minutes).
    ElasticsearchDestinationUpdate -> Maybe ElasticsearchRetryOptions
retryOptions :: Prelude.Maybe ElasticsearchRetryOptions,
    -- | The data processing configuration.
    ElasticsearchDestinationUpdate -> Maybe ProcessingConfiguration
processingConfiguration :: Prelude.Maybe ProcessingConfiguration,
    -- | The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis
    -- Data Firehose for calling the Amazon ES Configuration API and for
    -- indexing documents. For more information, see
    -- <https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3 Grant Kinesis Data Firehose Access to an Amazon S3 Destination>
    -- and
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
    ElasticsearchDestinationUpdate -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The endpoint to use when communicating with the cluster. Specify either
    -- this @ClusterEndpoint@ or the @DomainARN@ field.
    ElasticsearchDestinationUpdate -> Maybe Text
clusterEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The Elasticsearch index name.
    ElasticsearchDestinationUpdate -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text
  }
  deriving (ElasticsearchDestinationUpdate
-> ElasticsearchDestinationUpdate -> Bool
(ElasticsearchDestinationUpdate
 -> ElasticsearchDestinationUpdate -> Bool)
-> (ElasticsearchDestinationUpdate
    -> ElasticsearchDestinationUpdate -> Bool)
-> Eq ElasticsearchDestinationUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElasticsearchDestinationUpdate
-> ElasticsearchDestinationUpdate -> Bool
$c/= :: ElasticsearchDestinationUpdate
-> ElasticsearchDestinationUpdate -> Bool
== :: ElasticsearchDestinationUpdate
-> ElasticsearchDestinationUpdate -> Bool
$c== :: ElasticsearchDestinationUpdate
-> ElasticsearchDestinationUpdate -> Bool
Prelude.Eq, ReadPrec [ElasticsearchDestinationUpdate]
ReadPrec ElasticsearchDestinationUpdate
Int -> ReadS ElasticsearchDestinationUpdate
ReadS [ElasticsearchDestinationUpdate]
(Int -> ReadS ElasticsearchDestinationUpdate)
-> ReadS [ElasticsearchDestinationUpdate]
-> ReadPrec ElasticsearchDestinationUpdate
-> ReadPrec [ElasticsearchDestinationUpdate]
-> Read ElasticsearchDestinationUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElasticsearchDestinationUpdate]
$creadListPrec :: ReadPrec [ElasticsearchDestinationUpdate]
readPrec :: ReadPrec ElasticsearchDestinationUpdate
$creadPrec :: ReadPrec ElasticsearchDestinationUpdate
readList :: ReadS [ElasticsearchDestinationUpdate]
$creadList :: ReadS [ElasticsearchDestinationUpdate]
readsPrec :: Int -> ReadS ElasticsearchDestinationUpdate
$creadsPrec :: Int -> ReadS ElasticsearchDestinationUpdate
Prelude.Read, Int -> ElasticsearchDestinationUpdate -> ShowS
[ElasticsearchDestinationUpdate] -> ShowS
ElasticsearchDestinationUpdate -> String
(Int -> ElasticsearchDestinationUpdate -> ShowS)
-> (ElasticsearchDestinationUpdate -> String)
-> ([ElasticsearchDestinationUpdate] -> ShowS)
-> Show ElasticsearchDestinationUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElasticsearchDestinationUpdate] -> ShowS
$cshowList :: [ElasticsearchDestinationUpdate] -> ShowS
show :: ElasticsearchDestinationUpdate -> String
$cshow :: ElasticsearchDestinationUpdate -> String
showsPrec :: Int -> ElasticsearchDestinationUpdate -> ShowS
$cshowsPrec :: Int -> ElasticsearchDestinationUpdate -> ShowS
Prelude.Show, (forall x.
 ElasticsearchDestinationUpdate
 -> Rep ElasticsearchDestinationUpdate x)
-> (forall x.
    Rep ElasticsearchDestinationUpdate x
    -> ElasticsearchDestinationUpdate)
-> Generic ElasticsearchDestinationUpdate
forall x.
Rep ElasticsearchDestinationUpdate x
-> ElasticsearchDestinationUpdate
forall x.
ElasticsearchDestinationUpdate
-> Rep ElasticsearchDestinationUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ElasticsearchDestinationUpdate x
-> ElasticsearchDestinationUpdate
$cfrom :: forall x.
ElasticsearchDestinationUpdate
-> Rep ElasticsearchDestinationUpdate x
Prelude.Generic)

-- |
-- Create a value of 'ElasticsearchDestinationUpdate' 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:
--
-- 'indexRotationPeriod', 'elasticsearchDestinationUpdate_indexRotationPeriod' - The Elasticsearch index rotation period. Index rotation appends a
-- timestamp to @IndexName@ to facilitate the expiration of old data. For
-- more information, see
-- <https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation Index Rotation for the Amazon ES Destination>.
-- Default value is @OneDay@.
--
-- 'typeName', 'elasticsearchDestinationUpdate_typeName' - The Elasticsearch type name. For Elasticsearch 6.x, there can be only
-- one type per index. If you try to specify a new type for an existing
-- index that already has another type, Kinesis Data Firehose returns an
-- error during runtime.
--
-- If you upgrade Elasticsearch from 6.x to 7.x and don’t update your
-- delivery stream, Kinesis Data Firehose still delivers data to
-- Elasticsearch with the old index name and type name. If you want to
-- update your delivery stream with a new index name, provide an empty
-- string for @TypeName@.
--
-- 'domainARN', 'elasticsearchDestinationUpdate_domainARN' - The ARN of the Amazon ES domain. The IAM role must have permissions
-- for @DescribeElasticsearchDomain@, @DescribeElasticsearchDomains@, and
-- @DescribeElasticsearchDomainConfig@ after assuming the IAM role
-- specified in @RoleARN@. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
--
-- Specify either @ClusterEndpoint@ or @DomainARN@.
--
-- 'cloudWatchLoggingOptions', 'elasticsearchDestinationUpdate_cloudWatchLoggingOptions' - The CloudWatch logging options for your delivery stream.
--
-- 's3Update', 'elasticsearchDestinationUpdate_s3Update' - The Amazon S3 destination.
--
-- 'bufferingHints', 'elasticsearchDestinationUpdate_bufferingHints' - The buffering options. If no value is specified,
-- @ElasticsearchBufferingHints@ object default values are used.
--
-- 'retryOptions', 'elasticsearchDestinationUpdate_retryOptions' - The retry behavior in case Kinesis Data Firehose is unable to deliver
-- documents to Amazon ES. The default value is 300 (5 minutes).
--
-- 'processingConfiguration', 'elasticsearchDestinationUpdate_processingConfiguration' - The data processing configuration.
--
-- 'roleARN', 'elasticsearchDestinationUpdate_roleARN' - The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis
-- Data Firehose for calling the Amazon ES Configuration API and for
-- indexing documents. For more information, see
-- <https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3 Grant Kinesis Data Firehose Access to an Amazon S3 Destination>
-- and
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
--
-- 'clusterEndpoint', 'elasticsearchDestinationUpdate_clusterEndpoint' - The endpoint to use when communicating with the cluster. Specify either
-- this @ClusterEndpoint@ or the @DomainARN@ field.
--
-- 'indexName', 'elasticsearchDestinationUpdate_indexName' - The Elasticsearch index name.
newElasticsearchDestinationUpdate ::
  ElasticsearchDestinationUpdate
newElasticsearchDestinationUpdate :: ElasticsearchDestinationUpdate
newElasticsearchDestinationUpdate =
  ElasticsearchDestinationUpdate' :: Maybe ElasticsearchIndexRotationPeriod
-> Maybe Text
-> Maybe Text
-> Maybe CloudWatchLoggingOptions
-> Maybe S3DestinationUpdate
-> Maybe ElasticsearchBufferingHints
-> Maybe ElasticsearchRetryOptions
-> Maybe ProcessingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ElasticsearchDestinationUpdate
ElasticsearchDestinationUpdate'
    { $sel:indexRotationPeriod:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod =
        Maybe ElasticsearchIndexRotationPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:typeName:ElasticsearchDestinationUpdate' :: Maybe Text
typeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainARN:ElasticsearchDestinationUpdate' :: Maybe Text
domainARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLoggingOptions:ElasticsearchDestinationUpdate' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = Maybe CloudWatchLoggingOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Update:ElasticsearchDestinationUpdate' :: Maybe S3DestinationUpdate
s3Update = Maybe S3DestinationUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:bufferingHints:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchBufferingHints
bufferingHints = Maybe ElasticsearchBufferingHints
forall a. Maybe a
Prelude.Nothing,
      $sel:retryOptions:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchRetryOptions
retryOptions = Maybe ElasticsearchRetryOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:processingConfiguration:ElasticsearchDestinationUpdate' :: Maybe ProcessingConfiguration
processingConfiguration = Maybe ProcessingConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:ElasticsearchDestinationUpdate' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterEndpoint:ElasticsearchDestinationUpdate' :: Maybe Text
clusterEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:indexName:ElasticsearchDestinationUpdate' :: Maybe Text
indexName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Elasticsearch index rotation period. Index rotation appends a
-- timestamp to @IndexName@ to facilitate the expiration of old data. For
-- more information, see
-- <https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation Index Rotation for the Amazon ES Destination>.
-- Default value is @OneDay@.
elasticsearchDestinationUpdate_indexRotationPeriod :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe ElasticsearchIndexRotationPeriod)
elasticsearchDestinationUpdate_indexRotationPeriod :: (Maybe ElasticsearchIndexRotationPeriod
 -> f (Maybe ElasticsearchIndexRotationPeriod))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_indexRotationPeriod = (ElasticsearchDestinationUpdate
 -> Maybe ElasticsearchIndexRotationPeriod)
-> (ElasticsearchDestinationUpdate
    -> Maybe ElasticsearchIndexRotationPeriod
    -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe ElasticsearchIndexRotationPeriod)
     (Maybe ElasticsearchIndexRotationPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod :: Maybe ElasticsearchIndexRotationPeriod
$sel:indexRotationPeriod:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate
-> Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod} -> Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe ElasticsearchIndexRotationPeriod
a -> ElasticsearchDestinationUpdate
s {$sel:indexRotationPeriod:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod = Maybe ElasticsearchIndexRotationPeriod
a} :: ElasticsearchDestinationUpdate)

-- | The Elasticsearch type name. For Elasticsearch 6.x, there can be only
-- one type per index. If you try to specify a new type for an existing
-- index that already has another type, Kinesis Data Firehose returns an
-- error during runtime.
--
-- If you upgrade Elasticsearch from 6.x to 7.x and don’t update your
-- delivery stream, Kinesis Data Firehose still delivers data to
-- Elasticsearch with the old index name and type name. If you want to
-- update your delivery stream with a new index name, provide an empty
-- string for @TypeName@.
elasticsearchDestinationUpdate_typeName :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_typeName :: (Maybe Text -> f (Maybe Text))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_typeName = (ElasticsearchDestinationUpdate -> Maybe Text)
-> (ElasticsearchDestinationUpdate
    -> Maybe Text -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe Text
typeName :: Maybe Text
$sel:typeName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe Text
a -> ElasticsearchDestinationUpdate
s {$sel:typeName:ElasticsearchDestinationUpdate' :: Maybe Text
typeName = Maybe Text
a} :: ElasticsearchDestinationUpdate)

-- | The ARN of the Amazon ES domain. The IAM role must have permissions
-- for @DescribeElasticsearchDomain@, @DescribeElasticsearchDomains@, and
-- @DescribeElasticsearchDomainConfig@ after assuming the IAM role
-- specified in @RoleARN@. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
--
-- Specify either @ClusterEndpoint@ or @DomainARN@.
elasticsearchDestinationUpdate_domainARN :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_domainARN :: (Maybe Text -> f (Maybe Text))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_domainARN = (ElasticsearchDestinationUpdate -> Maybe Text)
-> (ElasticsearchDestinationUpdate
    -> Maybe Text -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe Text
domainARN :: Maybe Text
$sel:domainARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
domainARN} -> Maybe Text
domainARN) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe Text
a -> ElasticsearchDestinationUpdate
s {$sel:domainARN:ElasticsearchDestinationUpdate' :: Maybe Text
domainARN = Maybe Text
a} :: ElasticsearchDestinationUpdate)

-- | The CloudWatch logging options for your delivery stream.
elasticsearchDestinationUpdate_cloudWatchLoggingOptions :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe CloudWatchLoggingOptions)
elasticsearchDestinationUpdate_cloudWatchLoggingOptions :: (Maybe CloudWatchLoggingOptions
 -> f (Maybe CloudWatchLoggingOptions))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_cloudWatchLoggingOptions = (ElasticsearchDestinationUpdate -> Maybe CloudWatchLoggingOptions)
-> (ElasticsearchDestinationUpdate
    -> Maybe CloudWatchLoggingOptions
    -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe CloudWatchLoggingOptions)
     (Maybe CloudWatchLoggingOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
$sel:cloudWatchLoggingOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions} -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe CloudWatchLoggingOptions
a -> ElasticsearchDestinationUpdate
s {$sel:cloudWatchLoggingOptions:ElasticsearchDestinationUpdate' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = Maybe CloudWatchLoggingOptions
a} :: ElasticsearchDestinationUpdate)

-- | The Amazon S3 destination.
elasticsearchDestinationUpdate_s3Update :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe S3DestinationUpdate)
elasticsearchDestinationUpdate_s3Update :: (Maybe S3DestinationUpdate -> f (Maybe S3DestinationUpdate))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_s3Update = (ElasticsearchDestinationUpdate -> Maybe S3DestinationUpdate)
-> (ElasticsearchDestinationUpdate
    -> Maybe S3DestinationUpdate -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe S3DestinationUpdate)
     (Maybe S3DestinationUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe S3DestinationUpdate
s3Update :: Maybe S3DestinationUpdate
$sel:s3Update:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe S3DestinationUpdate
s3Update} -> Maybe S3DestinationUpdate
s3Update) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe S3DestinationUpdate
a -> ElasticsearchDestinationUpdate
s {$sel:s3Update:ElasticsearchDestinationUpdate' :: Maybe S3DestinationUpdate
s3Update = Maybe S3DestinationUpdate
a} :: ElasticsearchDestinationUpdate)

-- | The buffering options. If no value is specified,
-- @ElasticsearchBufferingHints@ object default values are used.
elasticsearchDestinationUpdate_bufferingHints :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe ElasticsearchBufferingHints)
elasticsearchDestinationUpdate_bufferingHints :: (Maybe ElasticsearchBufferingHints
 -> f (Maybe ElasticsearchBufferingHints))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_bufferingHints = (ElasticsearchDestinationUpdate
 -> Maybe ElasticsearchBufferingHints)
-> (ElasticsearchDestinationUpdate
    -> Maybe ElasticsearchBufferingHints
    -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe ElasticsearchBufferingHints)
     (Maybe ElasticsearchBufferingHints)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe ElasticsearchBufferingHints
bufferingHints :: Maybe ElasticsearchBufferingHints
$sel:bufferingHints:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchBufferingHints
bufferingHints} -> Maybe ElasticsearchBufferingHints
bufferingHints) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe ElasticsearchBufferingHints
a -> ElasticsearchDestinationUpdate
s {$sel:bufferingHints:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchBufferingHints
bufferingHints = Maybe ElasticsearchBufferingHints
a} :: ElasticsearchDestinationUpdate)

-- | The retry behavior in case Kinesis Data Firehose is unable to deliver
-- documents to Amazon ES. The default value is 300 (5 minutes).
elasticsearchDestinationUpdate_retryOptions :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe ElasticsearchRetryOptions)
elasticsearchDestinationUpdate_retryOptions :: (Maybe ElasticsearchRetryOptions
 -> f (Maybe ElasticsearchRetryOptions))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_retryOptions = (ElasticsearchDestinationUpdate -> Maybe ElasticsearchRetryOptions)
-> (ElasticsearchDestinationUpdate
    -> Maybe ElasticsearchRetryOptions
    -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe ElasticsearchRetryOptions)
     (Maybe ElasticsearchRetryOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe ElasticsearchRetryOptions
retryOptions :: Maybe ElasticsearchRetryOptions
$sel:retryOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchRetryOptions
retryOptions} -> Maybe ElasticsearchRetryOptions
retryOptions) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe ElasticsearchRetryOptions
a -> ElasticsearchDestinationUpdate
s {$sel:retryOptions:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchRetryOptions
retryOptions = Maybe ElasticsearchRetryOptions
a} :: ElasticsearchDestinationUpdate)

-- | The data processing configuration.
elasticsearchDestinationUpdate_processingConfiguration :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe ProcessingConfiguration)
elasticsearchDestinationUpdate_processingConfiguration :: (Maybe ProcessingConfiguration
 -> f (Maybe ProcessingConfiguration))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_processingConfiguration = (ElasticsearchDestinationUpdate -> Maybe ProcessingConfiguration)
-> (ElasticsearchDestinationUpdate
    -> Maybe ProcessingConfiguration -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe ProcessingConfiguration)
     (Maybe ProcessingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe ProcessingConfiguration
processingConfiguration :: Maybe ProcessingConfiguration
$sel:processingConfiguration:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ProcessingConfiguration
processingConfiguration} -> Maybe ProcessingConfiguration
processingConfiguration) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe ProcessingConfiguration
a -> ElasticsearchDestinationUpdate
s {$sel:processingConfiguration:ElasticsearchDestinationUpdate' :: Maybe ProcessingConfiguration
processingConfiguration = Maybe ProcessingConfiguration
a} :: ElasticsearchDestinationUpdate)

-- | The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis
-- Data Firehose for calling the Amazon ES Configuration API and for
-- indexing documents. For more information, see
-- <https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3 Grant Kinesis Data Firehose Access to an Amazon S3 Destination>
-- and
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
elasticsearchDestinationUpdate_roleARN :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_roleARN :: (Maybe Text -> f (Maybe Text))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_roleARN = (ElasticsearchDestinationUpdate -> Maybe Text)
-> (ElasticsearchDestinationUpdate
    -> Maybe Text -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe Text
a -> ElasticsearchDestinationUpdate
s {$sel:roleARN:ElasticsearchDestinationUpdate' :: Maybe Text
roleARN = Maybe Text
a} :: ElasticsearchDestinationUpdate)

-- | The endpoint to use when communicating with the cluster. Specify either
-- this @ClusterEndpoint@ or the @DomainARN@ field.
elasticsearchDestinationUpdate_clusterEndpoint :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_clusterEndpoint :: (Maybe Text -> f (Maybe Text))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_clusterEndpoint = (ElasticsearchDestinationUpdate -> Maybe Text)
-> (ElasticsearchDestinationUpdate
    -> Maybe Text -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe Text
clusterEndpoint :: Maybe Text
$sel:clusterEndpoint:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
clusterEndpoint} -> Maybe Text
clusterEndpoint) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe Text
a -> ElasticsearchDestinationUpdate
s {$sel:clusterEndpoint:ElasticsearchDestinationUpdate' :: Maybe Text
clusterEndpoint = Maybe Text
a} :: ElasticsearchDestinationUpdate)

-- | The Elasticsearch index name.
elasticsearchDestinationUpdate_indexName :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_indexName :: (Maybe Text -> f (Maybe Text))
-> ElasticsearchDestinationUpdate
-> f ElasticsearchDestinationUpdate
elasticsearchDestinationUpdate_indexName = (ElasticsearchDestinationUpdate -> Maybe Text)
-> (ElasticsearchDestinationUpdate
    -> Maybe Text -> ElasticsearchDestinationUpdate)
-> Lens
     ElasticsearchDestinationUpdate
     ElasticsearchDestinationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchDestinationUpdate' {Maybe Text
indexName :: Maybe Text
$sel:indexName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
indexName} -> Maybe Text
indexName) (\s :: ElasticsearchDestinationUpdate
s@ElasticsearchDestinationUpdate' {} Maybe Text
a -> ElasticsearchDestinationUpdate
s {$sel:indexName:ElasticsearchDestinationUpdate' :: Maybe Text
indexName = Maybe Text
a} :: ElasticsearchDestinationUpdate)

instance
  Prelude.Hashable
    ElasticsearchDestinationUpdate

instance
  Prelude.NFData
    ElasticsearchDestinationUpdate

instance Core.ToJSON ElasticsearchDestinationUpdate where
  toJSON :: ElasticsearchDestinationUpdate -> Value
toJSON ElasticsearchDestinationUpdate' {Maybe Text
Maybe CloudWatchLoggingOptions
Maybe ElasticsearchBufferingHints
Maybe ElasticsearchIndexRotationPeriod
Maybe ElasticsearchRetryOptions
Maybe ProcessingConfiguration
Maybe S3DestinationUpdate
indexName :: Maybe Text
clusterEndpoint :: Maybe Text
roleARN :: Maybe Text
processingConfiguration :: Maybe ProcessingConfiguration
retryOptions :: Maybe ElasticsearchRetryOptions
bufferingHints :: Maybe ElasticsearchBufferingHints
s3Update :: Maybe S3DestinationUpdate
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
domainARN :: Maybe Text
typeName :: Maybe Text
indexRotationPeriod :: Maybe ElasticsearchIndexRotationPeriod
$sel:indexName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:clusterEndpoint:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:roleARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:processingConfiguration:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ProcessingConfiguration
$sel:retryOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchRetryOptions
$sel:bufferingHints:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchBufferingHints
$sel:s3Update:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe S3DestinationUpdate
$sel:cloudWatchLoggingOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe CloudWatchLoggingOptions
$sel:domainARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:typeName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:indexRotationPeriod:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate
-> Maybe ElasticsearchIndexRotationPeriod
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IndexRotationPeriod" Text -> ElasticsearchIndexRotationPeriod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ElasticsearchIndexRotationPeriod -> Pair)
-> Maybe ElasticsearchIndexRotationPeriod -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod,
            (Text
"TypeName" 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
typeName,
            (Text
"DomainARN" 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
domainARN,
            (Text
"CloudWatchLoggingOptions" Text -> CloudWatchLoggingOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CloudWatchLoggingOptions -> Pair)
-> Maybe CloudWatchLoggingOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions,
            (Text
"S3Update" Text -> S3DestinationUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3DestinationUpdate -> Pair)
-> Maybe S3DestinationUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3DestinationUpdate
s3Update,
            (Text
"BufferingHints" Text -> ElasticsearchBufferingHints -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ElasticsearchBufferingHints -> Pair)
-> Maybe ElasticsearchBufferingHints -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ElasticsearchBufferingHints
bufferingHints,
            (Text
"RetryOptions" Text -> ElasticsearchRetryOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ElasticsearchRetryOptions -> Pair)
-> Maybe ElasticsearchRetryOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ElasticsearchRetryOptions
retryOptions,
            (Text
"ProcessingConfiguration" Text -> ProcessingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProcessingConfiguration -> Pair)
-> Maybe ProcessingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProcessingConfiguration
processingConfiguration,
            (Text
"RoleARN" 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
roleARN,
            (Text
"ClusterEndpoint" 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
clusterEndpoint,
            (Text
"IndexName" 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
indexName
          ]
      )