{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Firehose.Types.ElasticsearchDestinationUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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.Prelude as Prelude

-- | Describes an update for a destination in Amazon ES.
--
-- /See:/ 'newElasticsearchDestinationUpdate' smart constructor.
data ElasticsearchDestinationUpdate = ElasticsearchDestinationUpdate'
  { -- | The buffering options. If no value is specified,
    -- @ElasticsearchBufferingHints@ object default values are used.
    ElasticsearchDestinationUpdate -> Maybe ElasticsearchBufferingHints
bufferingHints :: Prelude.Maybe ElasticsearchBufferingHints,
    -- | The CloudWatch logging options for your delivery stream.
    ElasticsearchDestinationUpdate -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Prelude.Maybe CloudWatchLoggingOptions,
    -- | 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 ARN of the Amazon ES domain. The IAM role must have permissions
    -- for @DescribeDomain@, @DescribeDomains@, and
    -- @DescribeDomainConfig@ 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 Amazon Web Services Service Namespaces>.
    --
    -- Specify either @ClusterEndpoint@ or @DomainARN@.
    ElasticsearchDestinationUpdate -> Maybe Text
domainARN :: Prelude.Maybe Prelude.Text,
    -- | The Elasticsearch index name.
    ElasticsearchDestinationUpdate -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text,
    -- | 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 data processing configuration.
    ElasticsearchDestinationUpdate -> Maybe ProcessingConfiguration
processingConfiguration :: Prelude.Maybe ProcessingConfiguration,
    -- | 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 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 Amazon Web Services Service Namespaces>.
    ElasticsearchDestinationUpdate -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 destination.
    ElasticsearchDestinationUpdate -> Maybe S3DestinationUpdate
s3Update :: Prelude.Maybe S3DestinationUpdate,
    -- | 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
  }
  deriving (ElasticsearchDestinationUpdate
-> ElasticsearchDestinationUpdate -> Bool
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]
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
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.
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:
--
-- 'bufferingHints', 'elasticsearchDestinationUpdate_bufferingHints' - The buffering options. If no value is specified,
-- @ElasticsearchBufferingHints@ object default values are used.
--
-- 'cloudWatchLoggingOptions', 'elasticsearchDestinationUpdate_cloudWatchLoggingOptions' - The CloudWatch logging options for your delivery stream.
--
-- 'clusterEndpoint', 'elasticsearchDestinationUpdate_clusterEndpoint' - The endpoint to use when communicating with the cluster. Specify either
-- this @ClusterEndpoint@ or the @DomainARN@ field.
--
-- 'domainARN', 'elasticsearchDestinationUpdate_domainARN' - The ARN of the Amazon ES domain. The IAM role must have permissions
-- for @DescribeDomain@, @DescribeDomains@, and
-- @DescribeDomainConfig@ 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 Amazon Web Services Service Namespaces>.
--
-- Specify either @ClusterEndpoint@ or @DomainARN@.
--
-- 'indexName', 'elasticsearchDestinationUpdate_indexName' - The Elasticsearch index name.
--
-- '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@.
--
-- 'processingConfiguration', 'elasticsearchDestinationUpdate_processingConfiguration' - The data processing configuration.
--
-- '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).
--
-- '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 Amazon Web Services Service Namespaces>.
--
-- 's3Update', 'elasticsearchDestinationUpdate_s3Update' - The Amazon S3 destination.
--
-- '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@.
newElasticsearchDestinationUpdate ::
  ElasticsearchDestinationUpdate
newElasticsearchDestinationUpdate :: ElasticsearchDestinationUpdate
newElasticsearchDestinationUpdate =
  ElasticsearchDestinationUpdate'
    { $sel:bufferingHints:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchBufferingHints
bufferingHints =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLoggingOptions:ElasticsearchDestinationUpdate' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:clusterEndpoint:ElasticsearchDestinationUpdate' :: Maybe Text
clusterEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:domainARN:ElasticsearchDestinationUpdate' :: Maybe Text
domainARN = forall a. Maybe a
Prelude.Nothing,
      $sel:indexName:ElasticsearchDestinationUpdate' :: Maybe Text
indexName = forall a. Maybe a
Prelude.Nothing,
      $sel:indexRotationPeriod:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod = forall a. Maybe a
Prelude.Nothing,
      $sel:processingConfiguration:ElasticsearchDestinationUpdate' :: Maybe ProcessingConfiguration
processingConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:retryOptions:ElasticsearchDestinationUpdate' :: Maybe ElasticsearchRetryOptions
retryOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:ElasticsearchDestinationUpdate' :: Maybe Text
roleARN = forall a. Maybe a
Prelude.Nothing,
      $sel:s3Update:ElasticsearchDestinationUpdate' :: Maybe S3DestinationUpdate
s3Update = forall a. Maybe a
Prelude.Nothing,
      $sel:typeName:ElasticsearchDestinationUpdate' :: Maybe Text
typeName = forall a. Maybe a
Prelude.Nothing
    }

-- | The buffering options. If no value is specified,
-- @ElasticsearchBufferingHints@ object default values are used.
elasticsearchDestinationUpdate_bufferingHints :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe ElasticsearchBufferingHints)
elasticsearchDestinationUpdate_bufferingHints :: Lens'
  ElasticsearchDestinationUpdate (Maybe ElasticsearchBufferingHints)
elasticsearchDestinationUpdate_bufferingHints = 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 CloudWatch logging options for your delivery stream.
elasticsearchDestinationUpdate_cloudWatchLoggingOptions :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe CloudWatchLoggingOptions)
elasticsearchDestinationUpdate_cloudWatchLoggingOptions :: Lens'
  ElasticsearchDestinationUpdate (Maybe CloudWatchLoggingOptions)
elasticsearchDestinationUpdate_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 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 :: Lens' ElasticsearchDestinationUpdate (Maybe Text)
elasticsearchDestinationUpdate_clusterEndpoint = 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 ARN of the Amazon ES domain. The IAM role must have permissions
-- for @DescribeDomain@, @DescribeDomains@, and
-- @DescribeDomainConfig@ 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 Amazon Web Services Service Namespaces>.
--
-- Specify either @ClusterEndpoint@ or @DomainARN@.
elasticsearchDestinationUpdate_domainARN :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_domainARN :: Lens' ElasticsearchDestinationUpdate (Maybe Text)
elasticsearchDestinationUpdate_domainARN = 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 Elasticsearch index name.
elasticsearchDestinationUpdate_indexName :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_indexName :: Lens' ElasticsearchDestinationUpdate (Maybe Text)
elasticsearchDestinationUpdate_indexName = 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)

-- | 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 :: Lens'
  ElasticsearchDestinationUpdate
  (Maybe ElasticsearchIndexRotationPeriod)
elasticsearchDestinationUpdate_indexRotationPeriod = 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 data processing configuration.
elasticsearchDestinationUpdate_processingConfiguration :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe ProcessingConfiguration)
elasticsearchDestinationUpdate_processingConfiguration :: Lens'
  ElasticsearchDestinationUpdate (Maybe ProcessingConfiguration)
elasticsearchDestinationUpdate_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 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 :: Lens'
  ElasticsearchDestinationUpdate (Maybe ElasticsearchRetryOptions)
elasticsearchDestinationUpdate_retryOptions = 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 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 Amazon Web Services Service Namespaces>.
elasticsearchDestinationUpdate_roleARN :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe Prelude.Text)
elasticsearchDestinationUpdate_roleARN :: Lens' ElasticsearchDestinationUpdate (Maybe Text)
elasticsearchDestinationUpdate_roleARN = 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 Amazon S3 destination.
elasticsearchDestinationUpdate_s3Update :: Lens.Lens' ElasticsearchDestinationUpdate (Prelude.Maybe S3DestinationUpdate)
elasticsearchDestinationUpdate_s3Update :: Lens' ElasticsearchDestinationUpdate (Maybe S3DestinationUpdate)
elasticsearchDestinationUpdate_s3Update = 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 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 :: Lens' ElasticsearchDestinationUpdate (Maybe Text)
elasticsearchDestinationUpdate_typeName = 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)

instance
  Prelude.Hashable
    ElasticsearchDestinationUpdate
  where
  hashWithSalt :: Int -> ElasticsearchDestinationUpdate -> Int
hashWithSalt
    Int
_salt
    ElasticsearchDestinationUpdate' {Maybe Text
Maybe CloudWatchLoggingOptions
Maybe ElasticsearchBufferingHints
Maybe ElasticsearchIndexRotationPeriod
Maybe ElasticsearchRetryOptions
Maybe ProcessingConfiguration
Maybe S3DestinationUpdate
typeName :: Maybe Text
s3Update :: Maybe S3DestinationUpdate
roleARN :: Maybe Text
retryOptions :: Maybe ElasticsearchRetryOptions
processingConfiguration :: Maybe ProcessingConfiguration
indexRotationPeriod :: Maybe ElasticsearchIndexRotationPeriod
indexName :: Maybe Text
domainARN :: Maybe Text
clusterEndpoint :: Maybe Text
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
bufferingHints :: Maybe ElasticsearchBufferingHints
$sel:typeName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:s3Update:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe S3DestinationUpdate
$sel:roleARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:retryOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchRetryOptions
$sel:processingConfiguration:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ProcessingConfiguration
$sel:indexRotationPeriod:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate
-> Maybe ElasticsearchIndexRotationPeriod
$sel:indexName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:domainARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:clusterEndpoint:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:cloudWatchLoggingOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe CloudWatchLoggingOptions
$sel:bufferingHints:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchBufferingHints
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ElasticsearchBufferingHints
bufferingHints
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterEndpoint
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainARN
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
indexName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProcessingConfiguration
processingConfiguration
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ElasticsearchRetryOptions
retryOptions
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleARN
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3DestinationUpdate
s3Update
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
typeName

instance
  Prelude.NFData
    ElasticsearchDestinationUpdate
  where
  rnf :: ElasticsearchDestinationUpdate -> ()
rnf ElasticsearchDestinationUpdate' {Maybe Text
Maybe CloudWatchLoggingOptions
Maybe ElasticsearchBufferingHints
Maybe ElasticsearchIndexRotationPeriod
Maybe ElasticsearchRetryOptions
Maybe ProcessingConfiguration
Maybe S3DestinationUpdate
typeName :: Maybe Text
s3Update :: Maybe S3DestinationUpdate
roleARN :: Maybe Text
retryOptions :: Maybe ElasticsearchRetryOptions
processingConfiguration :: Maybe ProcessingConfiguration
indexRotationPeriod :: Maybe ElasticsearchIndexRotationPeriod
indexName :: Maybe Text
domainARN :: Maybe Text
clusterEndpoint :: Maybe Text
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
bufferingHints :: Maybe ElasticsearchBufferingHints
$sel:typeName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:s3Update:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe S3DestinationUpdate
$sel:roleARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:retryOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchRetryOptions
$sel:processingConfiguration:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ProcessingConfiguration
$sel:indexRotationPeriod:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate
-> Maybe ElasticsearchIndexRotationPeriod
$sel:indexName:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:domainARN:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:clusterEndpoint:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe Text
$sel:cloudWatchLoggingOptions:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe CloudWatchLoggingOptions
$sel:bufferingHints:ElasticsearchDestinationUpdate' :: ElasticsearchDestinationUpdate -> Maybe ElasticsearchBufferingHints
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ElasticsearchBufferingHints
bufferingHints
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
indexName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ElasticsearchIndexRotationPeriod
indexRotationPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProcessingConfiguration
processingConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ElasticsearchRetryOptions
retryOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3DestinationUpdate
s3Update
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
typeName

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