{-# 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.Firehose.CreateDeliveryStream
-- 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 a Kinesis Data Firehose delivery stream.
--
-- By default, you can create up to 50 delivery streams per AWS Region.
--
-- This is an asynchronous operation that immediately returns. The initial
-- status of the delivery stream is @CREATING@. After the delivery stream
-- is created, its status is @ACTIVE@ and it now accepts data. If the
-- delivery stream creation fails, the status transitions to
-- @CREATING_FAILED@. Attempts to send data to a delivery stream that is
-- not in the @ACTIVE@ state cause an exception. To check the state of a
-- delivery stream, use DescribeDeliveryStream.
--
-- If the status of a delivery stream is @CREATING_FAILED@, this status
-- doesn\'t change, and you can\'t invoke @CreateDeliveryStream@ again on
-- it. However, you can invoke the DeleteDeliveryStream operation to delete
-- it.
--
-- A Kinesis Data Firehose delivery stream can be configured to receive
-- records directly from providers using PutRecord or PutRecordBatch, or it
-- can be configured to use an existing Kinesis stream as its source. To
-- specify a Kinesis data stream as input, set the @DeliveryStreamType@
-- parameter to @KinesisStreamAsSource@, and provide the Kinesis stream
-- Amazon Resource Name (ARN) and role ARN in the
-- @KinesisStreamSourceConfiguration@ parameter.
--
-- To create a delivery stream with server-side encryption (SSE) enabled,
-- include DeliveryStreamEncryptionConfigurationInput in your request. This
-- is optional. You can also invoke StartDeliveryStreamEncryption to turn
-- on SSE for an existing delivery stream that doesn\'t have SSE enabled.
--
-- A delivery stream is configured with a single destination: Amazon S3,
-- Amazon ES, Amazon Redshift, or Splunk. You must specify only one of the
-- following destination configuration parameters:
-- @ExtendedS3DestinationConfiguration@, @S3DestinationConfiguration@,
-- @ElasticsearchDestinationConfiguration@,
-- @RedshiftDestinationConfiguration@, or @SplunkDestinationConfiguration@.
--
-- When you specify @S3DestinationConfiguration@, you can also provide the
-- following optional values: BufferingHints, @EncryptionConfiguration@,
-- and @CompressionFormat@. By default, if no @BufferingHints@ value is
-- provided, Kinesis Data Firehose buffers data up to 5 MB or for 5
-- minutes, whichever condition is satisfied first. @BufferingHints@ is a
-- hint, so there are some cases where the service cannot adhere to these
-- conditions strictly. For example, record boundaries might be such that
-- the size is a little over or under the configured buffering size. By
-- default, no encryption is performed. We strongly recommend that you
-- enable encryption to ensure secure data storage in Amazon S3.
--
-- A few notes about Amazon Redshift as a destination:
--
-- -   An Amazon Redshift destination requires an S3 bucket as intermediate
--     location. Kinesis Data Firehose first delivers data to Amazon S3 and
--     then uses @COPY@ syntax to load data into an Amazon Redshift table.
--     This is specified in the
--     @RedshiftDestinationConfiguration.S3Configuration@ parameter.
--
-- -   The compression formats @SNAPPY@ or @ZIP@ cannot be specified in
--     @RedshiftDestinationConfiguration.S3Configuration@ because the
--     Amazon Redshift @COPY@ operation that reads from the S3 bucket
--     doesn\'t support these compression formats.
--
-- -   We strongly recommend that you use the user name and password you
--     provide exclusively with Kinesis Data Firehose, and that the
--     permissions for the account are restricted for Amazon Redshift
--     @INSERT@ permissions.
--
-- Kinesis Data Firehose assumes the IAM role that is configured as part of
-- the destination. The role should allow the Kinesis Data Firehose
-- principal to assume the role, and the role should have permissions that
-- allow the service to deliver the data. 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>
-- in the /Amazon Kinesis Data Firehose Developer Guide/.
module Amazonka.Firehose.CreateDeliveryStream
  ( -- * Creating a Request
    CreateDeliveryStream (..),
    newCreateDeliveryStream,

    -- * Request Lenses
    createDeliveryStream_s3DestinationConfiguration,
    createDeliveryStream_redshiftDestinationConfiguration,
    createDeliveryStream_elasticsearchDestinationConfiguration,
    createDeliveryStream_extendedS3DestinationConfiguration,
    createDeliveryStream_kinesisStreamSourceConfiguration,
    createDeliveryStream_httpEndpointDestinationConfiguration,
    createDeliveryStream_amazonopensearchserviceDestinationConfiguration,
    createDeliveryStream_deliveryStreamType,
    createDeliveryStream_splunkDestinationConfiguration,
    createDeliveryStream_tags,
    createDeliveryStream_deliveryStreamEncryptionConfigurationInput,
    createDeliveryStream_deliveryStreamName,

    -- * Destructuring the Response
    CreateDeliveryStreamResponse (..),
    newCreateDeliveryStreamResponse,

    -- * Response Lenses
    createDeliveryStreamResponse_deliveryStreamARN,
    createDeliveryStreamResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateDeliveryStream' smart constructor.
data CreateDeliveryStream = CreateDeliveryStream'
  { -- | [Deprecated] The destination in Amazon S3. You can specify only one
    -- destination.
    CreateDeliveryStream -> Maybe S3DestinationConfiguration
s3DestinationConfiguration :: Prelude.Maybe S3DestinationConfiguration,
    -- | The destination in Amazon Redshift. You can specify only one
    -- destination.
    CreateDeliveryStream -> Maybe RedshiftDestinationConfiguration
redshiftDestinationConfiguration :: Prelude.Maybe RedshiftDestinationConfiguration,
    -- | The destination in Amazon ES. You can specify only one destination.
    CreateDeliveryStream -> Maybe ElasticsearchDestinationConfiguration
elasticsearchDestinationConfiguration :: Prelude.Maybe ElasticsearchDestinationConfiguration,
    -- | The destination in Amazon S3. You can specify only one destination.
    CreateDeliveryStream -> Maybe ExtendedS3DestinationConfiguration
extendedS3DestinationConfiguration :: Prelude.Maybe ExtendedS3DestinationConfiguration,
    -- | When a Kinesis data stream is used as the source for the delivery
    -- stream, a KinesisStreamSourceConfiguration containing the Kinesis data
    -- stream Amazon Resource Name (ARN) and the role ARN for the source
    -- stream.
    CreateDeliveryStream -> Maybe KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration :: Prelude.Maybe KinesisStreamSourceConfiguration,
    -- | Enables configuring Kinesis Firehose to deliver data to any HTTP
    -- endpoint destination. You can specify only one destination.
    CreateDeliveryStream -> Maybe HttpEndpointDestinationConfiguration
httpEndpointDestinationConfiguration :: Prelude.Maybe HttpEndpointDestinationConfiguration,
    CreateDeliveryStream
-> Maybe AmazonopensearchserviceDestinationConfiguration
amazonopensearchserviceDestinationConfiguration :: Prelude.Maybe AmazonopensearchserviceDestinationConfiguration,
    -- | The delivery stream type. This parameter can be one of the following
    -- values:
    --
    -- -   @DirectPut@: Provider applications access the delivery stream
    --     directly.
    --
    -- -   @KinesisStreamAsSource@: The delivery stream uses a Kinesis data
    --     stream as a source.
    CreateDeliveryStream -> Maybe DeliveryStreamType
deliveryStreamType :: Prelude.Maybe DeliveryStreamType,
    -- | The destination in Splunk. You can specify only one destination.
    CreateDeliveryStream -> Maybe SplunkDestinationConfiguration
splunkDestinationConfiguration :: Prelude.Maybe SplunkDestinationConfiguration,
    -- | A set of tags to assign to the delivery stream. A tag is a key-value
    -- pair that you can define and assign to AWS resources. Tags are metadata.
    -- For example, you can add friendly names and descriptions or other types
    -- of information that can help you distinguish the delivery stream. For
    -- more information about tags, see
    -- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html Using Cost Allocation Tags>
    -- in the AWS Billing and Cost Management User Guide.
    --
    -- You can specify up to 50 tags when creating a delivery stream.
    CreateDeliveryStream -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | Used to specify the type and Amazon Resource Name (ARN) of the KMS key
    -- needed for Server-Side Encryption (SSE).
    CreateDeliveryStream
-> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput :: Prelude.Maybe DeliveryStreamEncryptionConfigurationInput,
    -- | The name of the delivery stream. This name must be unique per AWS
    -- account in the same AWS Region. If the delivery streams are in different
    -- accounts or different Regions, you can have multiple delivery streams
    -- with the same name.
    CreateDeliveryStream -> Text
deliveryStreamName :: Prelude.Text
  }
  deriving (CreateDeliveryStream -> CreateDeliveryStream -> Bool
(CreateDeliveryStream -> CreateDeliveryStream -> Bool)
-> (CreateDeliveryStream -> CreateDeliveryStream -> Bool)
-> Eq CreateDeliveryStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeliveryStream -> CreateDeliveryStream -> Bool
$c/= :: CreateDeliveryStream -> CreateDeliveryStream -> Bool
== :: CreateDeliveryStream -> CreateDeliveryStream -> Bool
$c== :: CreateDeliveryStream -> CreateDeliveryStream -> Bool
Prelude.Eq, Int -> CreateDeliveryStream -> ShowS
[CreateDeliveryStream] -> ShowS
CreateDeliveryStream -> String
(Int -> CreateDeliveryStream -> ShowS)
-> (CreateDeliveryStream -> String)
-> ([CreateDeliveryStream] -> ShowS)
-> Show CreateDeliveryStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeliveryStream] -> ShowS
$cshowList :: [CreateDeliveryStream] -> ShowS
show :: CreateDeliveryStream -> String
$cshow :: CreateDeliveryStream -> String
showsPrec :: Int -> CreateDeliveryStream -> ShowS
$cshowsPrec :: Int -> CreateDeliveryStream -> ShowS
Prelude.Show, (forall x. CreateDeliveryStream -> Rep CreateDeliveryStream x)
-> (forall x. Rep CreateDeliveryStream x -> CreateDeliveryStream)
-> Generic CreateDeliveryStream
forall x. Rep CreateDeliveryStream x -> CreateDeliveryStream
forall x. CreateDeliveryStream -> Rep CreateDeliveryStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDeliveryStream x -> CreateDeliveryStream
$cfrom :: forall x. CreateDeliveryStream -> Rep CreateDeliveryStream x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeliveryStream' 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:
--
-- 's3DestinationConfiguration', 'createDeliveryStream_s3DestinationConfiguration' - [Deprecated] The destination in Amazon S3. You can specify only one
-- destination.
--
-- 'redshiftDestinationConfiguration', 'createDeliveryStream_redshiftDestinationConfiguration' - The destination in Amazon Redshift. You can specify only one
-- destination.
--
-- 'elasticsearchDestinationConfiguration', 'createDeliveryStream_elasticsearchDestinationConfiguration' - The destination in Amazon ES. You can specify only one destination.
--
-- 'extendedS3DestinationConfiguration', 'createDeliveryStream_extendedS3DestinationConfiguration' - The destination in Amazon S3. You can specify only one destination.
--
-- 'kinesisStreamSourceConfiguration', 'createDeliveryStream_kinesisStreamSourceConfiguration' - When a Kinesis data stream is used as the source for the delivery
-- stream, a KinesisStreamSourceConfiguration containing the Kinesis data
-- stream Amazon Resource Name (ARN) and the role ARN for the source
-- stream.
--
-- 'httpEndpointDestinationConfiguration', 'createDeliveryStream_httpEndpointDestinationConfiguration' - Enables configuring Kinesis Firehose to deliver data to any HTTP
-- endpoint destination. You can specify only one destination.
--
-- 'amazonopensearchserviceDestinationConfiguration', 'createDeliveryStream_amazonopensearchserviceDestinationConfiguration' - Undocumented member.
--
-- 'deliveryStreamType', 'createDeliveryStream_deliveryStreamType' - The delivery stream type. This parameter can be one of the following
-- values:
--
-- -   @DirectPut@: Provider applications access the delivery stream
--     directly.
--
-- -   @KinesisStreamAsSource@: The delivery stream uses a Kinesis data
--     stream as a source.
--
-- 'splunkDestinationConfiguration', 'createDeliveryStream_splunkDestinationConfiguration' - The destination in Splunk. You can specify only one destination.
--
-- 'tags', 'createDeliveryStream_tags' - A set of tags to assign to the delivery stream. A tag is a key-value
-- pair that you can define and assign to AWS resources. Tags are metadata.
-- For example, you can add friendly names and descriptions or other types
-- of information that can help you distinguish the delivery stream. For
-- more information about tags, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html Using Cost Allocation Tags>
-- in the AWS Billing and Cost Management User Guide.
--
-- You can specify up to 50 tags when creating a delivery stream.
--
-- 'deliveryStreamEncryptionConfigurationInput', 'createDeliveryStream_deliveryStreamEncryptionConfigurationInput' - Used to specify the type and Amazon Resource Name (ARN) of the KMS key
-- needed for Server-Side Encryption (SSE).
--
-- 'deliveryStreamName', 'createDeliveryStream_deliveryStreamName' - The name of the delivery stream. This name must be unique per AWS
-- account in the same AWS Region. If the delivery streams are in different
-- accounts or different Regions, you can have multiple delivery streams
-- with the same name.
newCreateDeliveryStream ::
  -- | 'deliveryStreamName'
  Prelude.Text ->
  CreateDeliveryStream
newCreateDeliveryStream :: Text -> CreateDeliveryStream
newCreateDeliveryStream Text
pDeliveryStreamName_ =
  CreateDeliveryStream' :: Maybe S3DestinationConfiguration
-> Maybe RedshiftDestinationConfiguration
-> Maybe ElasticsearchDestinationConfiguration
-> Maybe ExtendedS3DestinationConfiguration
-> Maybe KinesisStreamSourceConfiguration
-> Maybe HttpEndpointDestinationConfiguration
-> Maybe AmazonopensearchserviceDestinationConfiguration
-> Maybe DeliveryStreamType
-> Maybe SplunkDestinationConfiguration
-> Maybe (NonEmpty Tag)
-> Maybe DeliveryStreamEncryptionConfigurationInput
-> Text
-> CreateDeliveryStream
CreateDeliveryStream'
    { $sel:s3DestinationConfiguration:CreateDeliveryStream' :: Maybe S3DestinationConfiguration
s3DestinationConfiguration =
        Maybe S3DestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:redshiftDestinationConfiguration:CreateDeliveryStream' :: Maybe RedshiftDestinationConfiguration
redshiftDestinationConfiguration = Maybe RedshiftDestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:elasticsearchDestinationConfiguration:CreateDeliveryStream' :: Maybe ElasticsearchDestinationConfiguration
elasticsearchDestinationConfiguration =
        Maybe ElasticsearchDestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:extendedS3DestinationConfiguration:CreateDeliveryStream' :: Maybe ExtendedS3DestinationConfiguration
extendedS3DestinationConfiguration = Maybe ExtendedS3DestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:kinesisStreamSourceConfiguration:CreateDeliveryStream' :: Maybe KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration = Maybe KinesisStreamSourceConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:httpEndpointDestinationConfiguration:CreateDeliveryStream' :: Maybe HttpEndpointDestinationConfiguration
httpEndpointDestinationConfiguration =
        Maybe HttpEndpointDestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:amazonopensearchserviceDestinationConfiguration:CreateDeliveryStream' :: Maybe AmazonopensearchserviceDestinationConfiguration
amazonopensearchserviceDestinationConfiguration =
        Maybe AmazonopensearchserviceDestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryStreamType:CreateDeliveryStream' :: Maybe DeliveryStreamType
deliveryStreamType = Maybe DeliveryStreamType
forall a. Maybe a
Prelude.Nothing,
      $sel:splunkDestinationConfiguration:CreateDeliveryStream' :: Maybe SplunkDestinationConfiguration
splunkDestinationConfiguration = Maybe SplunkDestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateDeliveryStream' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryStreamEncryptionConfigurationInput:CreateDeliveryStream' :: Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput =
        Maybe DeliveryStreamEncryptionConfigurationInput
forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryStreamName:CreateDeliveryStream' :: Text
deliveryStreamName = Text
pDeliveryStreamName_
    }

-- | [Deprecated] The destination in Amazon S3. You can specify only one
-- destination.
createDeliveryStream_s3DestinationConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe S3DestinationConfiguration)
createDeliveryStream_s3DestinationConfiguration :: (Maybe S3DestinationConfiguration
 -> f (Maybe S3DestinationConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_s3DestinationConfiguration = (CreateDeliveryStream -> Maybe S3DestinationConfiguration)
-> (CreateDeliveryStream
    -> Maybe S3DestinationConfiguration -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe S3DestinationConfiguration)
     (Maybe S3DestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe S3DestinationConfiguration
s3DestinationConfiguration :: Maybe S3DestinationConfiguration
$sel:s3DestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe S3DestinationConfiguration
s3DestinationConfiguration} -> Maybe S3DestinationConfiguration
s3DestinationConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe S3DestinationConfiguration
a -> CreateDeliveryStream
s {$sel:s3DestinationConfiguration:CreateDeliveryStream' :: Maybe S3DestinationConfiguration
s3DestinationConfiguration = Maybe S3DestinationConfiguration
a} :: CreateDeliveryStream)

-- | The destination in Amazon Redshift. You can specify only one
-- destination.
createDeliveryStream_redshiftDestinationConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe RedshiftDestinationConfiguration)
createDeliveryStream_redshiftDestinationConfiguration :: (Maybe RedshiftDestinationConfiguration
 -> f (Maybe RedshiftDestinationConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_redshiftDestinationConfiguration = (CreateDeliveryStream -> Maybe RedshiftDestinationConfiguration)
-> (CreateDeliveryStream
    -> Maybe RedshiftDestinationConfiguration -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe RedshiftDestinationConfiguration)
     (Maybe RedshiftDestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe RedshiftDestinationConfiguration
redshiftDestinationConfiguration :: Maybe RedshiftDestinationConfiguration
$sel:redshiftDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe RedshiftDestinationConfiguration
redshiftDestinationConfiguration} -> Maybe RedshiftDestinationConfiguration
redshiftDestinationConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe RedshiftDestinationConfiguration
a -> CreateDeliveryStream
s {$sel:redshiftDestinationConfiguration:CreateDeliveryStream' :: Maybe RedshiftDestinationConfiguration
redshiftDestinationConfiguration = Maybe RedshiftDestinationConfiguration
a} :: CreateDeliveryStream)

-- | The destination in Amazon ES. You can specify only one destination.
createDeliveryStream_elasticsearchDestinationConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe ElasticsearchDestinationConfiguration)
createDeliveryStream_elasticsearchDestinationConfiguration :: (Maybe ElasticsearchDestinationConfiguration
 -> f (Maybe ElasticsearchDestinationConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_elasticsearchDestinationConfiguration = (CreateDeliveryStream
 -> Maybe ElasticsearchDestinationConfiguration)
-> (CreateDeliveryStream
    -> Maybe ElasticsearchDestinationConfiguration
    -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe ElasticsearchDestinationConfiguration)
     (Maybe ElasticsearchDestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe ElasticsearchDestinationConfiguration
elasticsearchDestinationConfiguration :: Maybe ElasticsearchDestinationConfiguration
$sel:elasticsearchDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe ElasticsearchDestinationConfiguration
elasticsearchDestinationConfiguration} -> Maybe ElasticsearchDestinationConfiguration
elasticsearchDestinationConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe ElasticsearchDestinationConfiguration
a -> CreateDeliveryStream
s {$sel:elasticsearchDestinationConfiguration:CreateDeliveryStream' :: Maybe ElasticsearchDestinationConfiguration
elasticsearchDestinationConfiguration = Maybe ElasticsearchDestinationConfiguration
a} :: CreateDeliveryStream)

-- | The destination in Amazon S3. You can specify only one destination.
createDeliveryStream_extendedS3DestinationConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe ExtendedS3DestinationConfiguration)
createDeliveryStream_extendedS3DestinationConfiguration :: (Maybe ExtendedS3DestinationConfiguration
 -> f (Maybe ExtendedS3DestinationConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_extendedS3DestinationConfiguration = (CreateDeliveryStream -> Maybe ExtendedS3DestinationConfiguration)
-> (CreateDeliveryStream
    -> Maybe ExtendedS3DestinationConfiguration
    -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe ExtendedS3DestinationConfiguration)
     (Maybe ExtendedS3DestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe ExtendedS3DestinationConfiguration
extendedS3DestinationConfiguration :: Maybe ExtendedS3DestinationConfiguration
$sel:extendedS3DestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe ExtendedS3DestinationConfiguration
extendedS3DestinationConfiguration} -> Maybe ExtendedS3DestinationConfiguration
extendedS3DestinationConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe ExtendedS3DestinationConfiguration
a -> CreateDeliveryStream
s {$sel:extendedS3DestinationConfiguration:CreateDeliveryStream' :: Maybe ExtendedS3DestinationConfiguration
extendedS3DestinationConfiguration = Maybe ExtendedS3DestinationConfiguration
a} :: CreateDeliveryStream)

-- | When a Kinesis data stream is used as the source for the delivery
-- stream, a KinesisStreamSourceConfiguration containing the Kinesis data
-- stream Amazon Resource Name (ARN) and the role ARN for the source
-- stream.
createDeliveryStream_kinesisStreamSourceConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe KinesisStreamSourceConfiguration)
createDeliveryStream_kinesisStreamSourceConfiguration :: (Maybe KinesisStreamSourceConfiguration
 -> f (Maybe KinesisStreamSourceConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_kinesisStreamSourceConfiguration = (CreateDeliveryStream -> Maybe KinesisStreamSourceConfiguration)
-> (CreateDeliveryStream
    -> Maybe KinesisStreamSourceConfiguration -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe KinesisStreamSourceConfiguration)
     (Maybe KinesisStreamSourceConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration :: Maybe KinesisStreamSourceConfiguration
$sel:kinesisStreamSourceConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration} -> Maybe KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe KinesisStreamSourceConfiguration
a -> CreateDeliveryStream
s {$sel:kinesisStreamSourceConfiguration:CreateDeliveryStream' :: Maybe KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration = Maybe KinesisStreamSourceConfiguration
a} :: CreateDeliveryStream)

-- | Enables configuring Kinesis Firehose to deliver data to any HTTP
-- endpoint destination. You can specify only one destination.
createDeliveryStream_httpEndpointDestinationConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe HttpEndpointDestinationConfiguration)
createDeliveryStream_httpEndpointDestinationConfiguration :: (Maybe HttpEndpointDestinationConfiguration
 -> f (Maybe HttpEndpointDestinationConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_httpEndpointDestinationConfiguration = (CreateDeliveryStream
 -> Maybe HttpEndpointDestinationConfiguration)
-> (CreateDeliveryStream
    -> Maybe HttpEndpointDestinationConfiguration
    -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe HttpEndpointDestinationConfiguration)
     (Maybe HttpEndpointDestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe HttpEndpointDestinationConfiguration
httpEndpointDestinationConfiguration :: Maybe HttpEndpointDestinationConfiguration
$sel:httpEndpointDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe HttpEndpointDestinationConfiguration
httpEndpointDestinationConfiguration} -> Maybe HttpEndpointDestinationConfiguration
httpEndpointDestinationConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe HttpEndpointDestinationConfiguration
a -> CreateDeliveryStream
s {$sel:httpEndpointDestinationConfiguration:CreateDeliveryStream' :: Maybe HttpEndpointDestinationConfiguration
httpEndpointDestinationConfiguration = Maybe HttpEndpointDestinationConfiguration
a} :: CreateDeliveryStream)

-- | Undocumented member.
createDeliveryStream_amazonopensearchserviceDestinationConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe AmazonopensearchserviceDestinationConfiguration)
createDeliveryStream_amazonopensearchserviceDestinationConfiguration :: (Maybe AmazonopensearchserviceDestinationConfiguration
 -> f (Maybe AmazonopensearchserviceDestinationConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_amazonopensearchserviceDestinationConfiguration = (CreateDeliveryStream
 -> Maybe AmazonopensearchserviceDestinationConfiguration)
-> (CreateDeliveryStream
    -> Maybe AmazonopensearchserviceDestinationConfiguration
    -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe AmazonopensearchserviceDestinationConfiguration)
     (Maybe AmazonopensearchserviceDestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe AmazonopensearchserviceDestinationConfiguration
amazonopensearchserviceDestinationConfiguration :: Maybe AmazonopensearchserviceDestinationConfiguration
$sel:amazonopensearchserviceDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream
-> Maybe AmazonopensearchserviceDestinationConfiguration
amazonopensearchserviceDestinationConfiguration} -> Maybe AmazonopensearchserviceDestinationConfiguration
amazonopensearchserviceDestinationConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe AmazonopensearchserviceDestinationConfiguration
a -> CreateDeliveryStream
s {$sel:amazonopensearchserviceDestinationConfiguration:CreateDeliveryStream' :: Maybe AmazonopensearchserviceDestinationConfiguration
amazonopensearchserviceDestinationConfiguration = Maybe AmazonopensearchserviceDestinationConfiguration
a} :: CreateDeliveryStream)

-- | The delivery stream type. This parameter can be one of the following
-- values:
--
-- -   @DirectPut@: Provider applications access the delivery stream
--     directly.
--
-- -   @KinesisStreamAsSource@: The delivery stream uses a Kinesis data
--     stream as a source.
createDeliveryStream_deliveryStreamType :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe DeliveryStreamType)
createDeliveryStream_deliveryStreamType :: (Maybe DeliveryStreamType -> f (Maybe DeliveryStreamType))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_deliveryStreamType = (CreateDeliveryStream -> Maybe DeliveryStreamType)
-> (CreateDeliveryStream
    -> Maybe DeliveryStreamType -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe DeliveryStreamType)
     (Maybe DeliveryStreamType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe DeliveryStreamType
deliveryStreamType :: Maybe DeliveryStreamType
$sel:deliveryStreamType:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe DeliveryStreamType
deliveryStreamType} -> Maybe DeliveryStreamType
deliveryStreamType) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe DeliveryStreamType
a -> CreateDeliveryStream
s {$sel:deliveryStreamType:CreateDeliveryStream' :: Maybe DeliveryStreamType
deliveryStreamType = Maybe DeliveryStreamType
a} :: CreateDeliveryStream)

-- | The destination in Splunk. You can specify only one destination.
createDeliveryStream_splunkDestinationConfiguration :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe SplunkDestinationConfiguration)
createDeliveryStream_splunkDestinationConfiguration :: (Maybe SplunkDestinationConfiguration
 -> f (Maybe SplunkDestinationConfiguration))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_splunkDestinationConfiguration = (CreateDeliveryStream -> Maybe SplunkDestinationConfiguration)
-> (CreateDeliveryStream
    -> Maybe SplunkDestinationConfiguration -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe SplunkDestinationConfiguration)
     (Maybe SplunkDestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe SplunkDestinationConfiguration
splunkDestinationConfiguration :: Maybe SplunkDestinationConfiguration
$sel:splunkDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe SplunkDestinationConfiguration
splunkDestinationConfiguration} -> Maybe SplunkDestinationConfiguration
splunkDestinationConfiguration) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe SplunkDestinationConfiguration
a -> CreateDeliveryStream
s {$sel:splunkDestinationConfiguration:CreateDeliveryStream' :: Maybe SplunkDestinationConfiguration
splunkDestinationConfiguration = Maybe SplunkDestinationConfiguration
a} :: CreateDeliveryStream)

-- | A set of tags to assign to the delivery stream. A tag is a key-value
-- pair that you can define and assign to AWS resources. Tags are metadata.
-- For example, you can add friendly names and descriptions or other types
-- of information that can help you distinguish the delivery stream. For
-- more information about tags, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html Using Cost Allocation Tags>
-- in the AWS Billing and Cost Management User Guide.
--
-- You can specify up to 50 tags when creating a delivery stream.
createDeliveryStream_tags :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe (Prelude.NonEmpty Tag))
createDeliveryStream_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_tags = (CreateDeliveryStream -> Maybe (NonEmpty Tag))
-> (CreateDeliveryStream
    -> Maybe (NonEmpty Tag) -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe (NonEmpty Tag)
a -> CreateDeliveryStream
s {$sel:tags:CreateDeliveryStream' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateDeliveryStream) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateDeliveryStream -> f CreateDeliveryStream)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDeliveryStream
-> f CreateDeliveryStream
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Used to specify the type and Amazon Resource Name (ARN) of the KMS key
-- needed for Server-Side Encryption (SSE).
createDeliveryStream_deliveryStreamEncryptionConfigurationInput :: Lens.Lens' CreateDeliveryStream (Prelude.Maybe DeliveryStreamEncryptionConfigurationInput)
createDeliveryStream_deliveryStreamEncryptionConfigurationInput :: (Maybe DeliveryStreamEncryptionConfigurationInput
 -> f (Maybe DeliveryStreamEncryptionConfigurationInput))
-> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_deliveryStreamEncryptionConfigurationInput = (CreateDeliveryStream
 -> Maybe DeliveryStreamEncryptionConfigurationInput)
-> (CreateDeliveryStream
    -> Maybe DeliveryStreamEncryptionConfigurationInput
    -> CreateDeliveryStream)
-> Lens
     CreateDeliveryStream
     CreateDeliveryStream
     (Maybe DeliveryStreamEncryptionConfigurationInput)
     (Maybe DeliveryStreamEncryptionConfigurationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput :: Maybe DeliveryStreamEncryptionConfigurationInput
$sel:deliveryStreamEncryptionConfigurationInput:CreateDeliveryStream' :: CreateDeliveryStream
-> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput} -> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Maybe DeliveryStreamEncryptionConfigurationInput
a -> CreateDeliveryStream
s {$sel:deliveryStreamEncryptionConfigurationInput:CreateDeliveryStream' :: Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput = Maybe DeliveryStreamEncryptionConfigurationInput
a} :: CreateDeliveryStream)

-- | The name of the delivery stream. This name must be unique per AWS
-- account in the same AWS Region. If the delivery streams are in different
-- accounts or different Regions, you can have multiple delivery streams
-- with the same name.
createDeliveryStream_deliveryStreamName :: Lens.Lens' CreateDeliveryStream Prelude.Text
createDeliveryStream_deliveryStreamName :: (Text -> f Text) -> CreateDeliveryStream -> f CreateDeliveryStream
createDeliveryStream_deliveryStreamName = (CreateDeliveryStream -> Text)
-> (CreateDeliveryStream -> Text -> CreateDeliveryStream)
-> Lens CreateDeliveryStream CreateDeliveryStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStream' {Text
deliveryStreamName :: Text
$sel:deliveryStreamName:CreateDeliveryStream' :: CreateDeliveryStream -> Text
deliveryStreamName} -> Text
deliveryStreamName) (\s :: CreateDeliveryStream
s@CreateDeliveryStream' {} Text
a -> CreateDeliveryStream
s {$sel:deliveryStreamName:CreateDeliveryStream' :: Text
deliveryStreamName = Text
a} :: CreateDeliveryStream)

instance Core.AWSRequest CreateDeliveryStream where
  type
    AWSResponse CreateDeliveryStream =
      CreateDeliveryStreamResponse
  request :: CreateDeliveryStream -> Request CreateDeliveryStream
request = Service -> CreateDeliveryStream -> Request CreateDeliveryStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDeliveryStream
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDeliveryStream)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDeliveryStream))
-> Logger
-> Service
-> Proxy CreateDeliveryStream
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDeliveryStream)))
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 -> CreateDeliveryStreamResponse
CreateDeliveryStreamResponse'
            (Maybe Text -> Int -> CreateDeliveryStreamResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDeliveryStreamResponse)
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
"DeliveryStreamARN")
            Either String (Int -> CreateDeliveryStreamResponse)
-> Either String Int -> Either String CreateDeliveryStreamResponse
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 CreateDeliveryStream

instance Prelude.NFData CreateDeliveryStream

instance Core.ToHeaders CreateDeliveryStream where
  toHeaders :: CreateDeliveryStream -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDeliveryStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Firehose_20150804.CreateDeliveryStream" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateDeliveryStream where
  toJSON :: CreateDeliveryStream -> Value
toJSON CreateDeliveryStream' {Maybe (NonEmpty Tag)
Maybe DeliveryStreamType
Maybe DeliveryStreamEncryptionConfigurationInput
Maybe KinesisStreamSourceConfiguration
Maybe S3DestinationConfiguration
Maybe RedshiftDestinationConfiguration
Maybe HttpEndpointDestinationConfiguration
Maybe ExtendedS3DestinationConfiguration
Maybe SplunkDestinationConfiguration
Maybe ElasticsearchDestinationConfiguration
Maybe AmazonopensearchserviceDestinationConfiguration
Text
deliveryStreamName :: Text
deliveryStreamEncryptionConfigurationInput :: Maybe DeliveryStreamEncryptionConfigurationInput
tags :: Maybe (NonEmpty Tag)
splunkDestinationConfiguration :: Maybe SplunkDestinationConfiguration
deliveryStreamType :: Maybe DeliveryStreamType
amazonopensearchserviceDestinationConfiguration :: Maybe AmazonopensearchserviceDestinationConfiguration
httpEndpointDestinationConfiguration :: Maybe HttpEndpointDestinationConfiguration
kinesisStreamSourceConfiguration :: Maybe KinesisStreamSourceConfiguration
extendedS3DestinationConfiguration :: Maybe ExtendedS3DestinationConfiguration
elasticsearchDestinationConfiguration :: Maybe ElasticsearchDestinationConfiguration
redshiftDestinationConfiguration :: Maybe RedshiftDestinationConfiguration
s3DestinationConfiguration :: Maybe S3DestinationConfiguration
$sel:deliveryStreamName:CreateDeliveryStream' :: CreateDeliveryStream -> Text
$sel:deliveryStreamEncryptionConfigurationInput:CreateDeliveryStream' :: CreateDeliveryStream
-> Maybe DeliveryStreamEncryptionConfigurationInput
$sel:tags:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe (NonEmpty Tag)
$sel:splunkDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe SplunkDestinationConfiguration
$sel:deliveryStreamType:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe DeliveryStreamType
$sel:amazonopensearchserviceDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream
-> Maybe AmazonopensearchserviceDestinationConfiguration
$sel:httpEndpointDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe HttpEndpointDestinationConfiguration
$sel:kinesisStreamSourceConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe KinesisStreamSourceConfiguration
$sel:extendedS3DestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe ExtendedS3DestinationConfiguration
$sel:elasticsearchDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe ElasticsearchDestinationConfiguration
$sel:redshiftDestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe RedshiftDestinationConfiguration
$sel:s3DestinationConfiguration:CreateDeliveryStream' :: CreateDeliveryStream -> Maybe S3DestinationConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"S3DestinationConfiguration" Text -> S3DestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (S3DestinationConfiguration -> Pair)
-> Maybe S3DestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3DestinationConfiguration
s3DestinationConfiguration,
            (Text
"RedshiftDestinationConfiguration" Text -> RedshiftDestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RedshiftDestinationConfiguration -> Pair)
-> Maybe RedshiftDestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RedshiftDestinationConfiguration
redshiftDestinationConfiguration,
            (Text
"ElasticsearchDestinationConfiguration" Text -> ElasticsearchDestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ElasticsearchDestinationConfiguration -> Pair)
-> Maybe ElasticsearchDestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ElasticsearchDestinationConfiguration
elasticsearchDestinationConfiguration,
            (Text
"ExtendedS3DestinationConfiguration" Text -> ExtendedS3DestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ExtendedS3DestinationConfiguration -> Pair)
-> Maybe ExtendedS3DestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ExtendedS3DestinationConfiguration
extendedS3DestinationConfiguration,
            (Text
"KinesisStreamSourceConfiguration" Text -> KinesisStreamSourceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (KinesisStreamSourceConfiguration -> Pair)
-> Maybe KinesisStreamSourceConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisStreamSourceConfiguration
kinesisStreamSourceConfiguration,
            (Text
"HttpEndpointDestinationConfiguration" Text -> HttpEndpointDestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HttpEndpointDestinationConfiguration -> Pair)
-> Maybe HttpEndpointDestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HttpEndpointDestinationConfiguration
httpEndpointDestinationConfiguration,
            ( Text
"AmazonopensearchserviceDestinationConfiguration"
                Text -> AmazonopensearchserviceDestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=
            )
              (AmazonopensearchserviceDestinationConfiguration -> Pair)
-> Maybe AmazonopensearchserviceDestinationConfiguration
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AmazonopensearchserviceDestinationConfiguration
amazonopensearchserviceDestinationConfiguration,
            (Text
"DeliveryStreamType" Text -> DeliveryStreamType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DeliveryStreamType -> Pair)
-> Maybe DeliveryStreamType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeliveryStreamType
deliveryStreamType,
            (Text
"SplunkDestinationConfiguration" Text -> SplunkDestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SplunkDestinationConfiguration -> Pair)
-> Maybe SplunkDestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SplunkDestinationConfiguration
splunkDestinationConfiguration,
            (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            ( Text
"DeliveryStreamEncryptionConfigurationInput"
                Text -> DeliveryStreamEncryptionConfigurationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=
            )
              (DeliveryStreamEncryptionConfigurationInput -> Pair)
-> Maybe DeliveryStreamEncryptionConfigurationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DeliveryStreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deliveryStreamName)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateDeliveryStreamResponse' 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:
--
-- 'deliveryStreamARN', 'createDeliveryStreamResponse_deliveryStreamARN' - The ARN of the delivery stream.
--
-- 'httpStatus', 'createDeliveryStreamResponse_httpStatus' - The response's http status code.
newCreateDeliveryStreamResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDeliveryStreamResponse
newCreateDeliveryStreamResponse :: Int -> CreateDeliveryStreamResponse
newCreateDeliveryStreamResponse Int
pHttpStatus_ =
  CreateDeliveryStreamResponse' :: Maybe Text -> Int -> CreateDeliveryStreamResponse
CreateDeliveryStreamResponse'
    { $sel:deliveryStreamARN:CreateDeliveryStreamResponse' :: Maybe Text
deliveryStreamARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDeliveryStreamResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the delivery stream.
createDeliveryStreamResponse_deliveryStreamARN :: Lens.Lens' CreateDeliveryStreamResponse (Prelude.Maybe Prelude.Text)
createDeliveryStreamResponse_deliveryStreamARN :: (Maybe Text -> f (Maybe Text))
-> CreateDeliveryStreamResponse -> f CreateDeliveryStreamResponse
createDeliveryStreamResponse_deliveryStreamARN = (CreateDeliveryStreamResponse -> Maybe Text)
-> (CreateDeliveryStreamResponse
    -> Maybe Text -> CreateDeliveryStreamResponse)
-> Lens
     CreateDeliveryStreamResponse
     CreateDeliveryStreamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliveryStreamResponse' {Maybe Text
deliveryStreamARN :: Maybe Text
$sel:deliveryStreamARN:CreateDeliveryStreamResponse' :: CreateDeliveryStreamResponse -> Maybe Text
deliveryStreamARN} -> Maybe Text
deliveryStreamARN) (\s :: CreateDeliveryStreamResponse
s@CreateDeliveryStreamResponse' {} Maybe Text
a -> CreateDeliveryStreamResponse
s {$sel:deliveryStreamARN:CreateDeliveryStreamResponse' :: Maybe Text
deliveryStreamARN = Maybe Text
a} :: CreateDeliveryStreamResponse)

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

instance Prelude.NFData CreateDeliveryStreamResponse