{-# 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.Rekognition.CreateStreamProcessor
-- 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 an Amazon Rekognition stream processor that you can use to
-- detect and recognize faces in a streaming video.
--
-- Amazon Rekognition Video is a consumer of live video from Amazon Kinesis
-- Video Streams. Amazon Rekognition Video sends analysis results to Amazon
-- Kinesis Data Streams.
--
-- You provide as input a Kinesis video stream (@Input@) and a Kinesis data
-- stream (@Output@) stream. You also specify the face recognition criteria
-- in @Settings@. For example, the collection containing faces that you
-- want to recognize. Use @Name@ to assign an identifier for the stream
-- processor. You use @Name@ to manage the stream processor. For example,
-- you can start processing the source video by calling
-- StartStreamProcessor with the @Name@ field.
--
-- After you have finished analyzing a streaming video, use
-- StopStreamProcessor to stop processing. You can delete the stream
-- processor by calling DeleteStreamProcessor.
--
-- This operation requires permissions to perform the
-- @rekognition:CreateStreamProcessor@ action. If you want to tag your
-- stream processor, you also require permission to perform the
-- @rekognition:TagResource@ operation.
module Amazonka.Rekognition.CreateStreamProcessor
  ( -- * Creating a Request
    CreateStreamProcessor (..),
    newCreateStreamProcessor,

    -- * Request Lenses
    createStreamProcessor_tags,
    createStreamProcessor_input,
    createStreamProcessor_output,
    createStreamProcessor_name,
    createStreamProcessor_settings,
    createStreamProcessor_roleArn,

    -- * Destructuring the Response
    CreateStreamProcessorResponse (..),
    newCreateStreamProcessorResponse,

    -- * Response Lenses
    createStreamProcessorResponse_streamProcessorArn,
    createStreamProcessorResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateStreamProcessor' smart constructor.
data CreateStreamProcessor = CreateStreamProcessor'
  { -- | A set of tags (key-value pairs) that you want to attach to the stream
    -- processor.
    CreateStreamProcessor -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Kinesis video stream stream that provides the source streaming video. If
    -- you are using the AWS CLI, the parameter name is @StreamProcessorInput@.
    CreateStreamProcessor -> StreamProcessorInput
input :: StreamProcessorInput,
    -- | Kinesis data stream stream to which Amazon Rekognition Video puts the
    -- analysis results. If you are using the AWS CLI, the parameter name is
    -- @StreamProcessorOutput@.
    CreateStreamProcessor -> StreamProcessorOutput
output :: StreamProcessorOutput,
    -- | An identifier you assign to the stream processor. You can use @Name@ to
    -- manage the stream processor. For example, you can get the current status
    -- of the stream processor by calling DescribeStreamProcessor. @Name@ is
    -- idempotent.
    CreateStreamProcessor -> Text
name :: Prelude.Text,
    -- | Face recognition input parameters to be used by the stream processor.
    -- Includes the collection to use for face recognition and the face
    -- attributes to detect.
    CreateStreamProcessor -> StreamProcessorSettings
settings :: StreamProcessorSettings,
    -- | ARN of the IAM role that allows access to the stream processor.
    CreateStreamProcessor -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateStreamProcessor -> CreateStreamProcessor -> Bool
(CreateStreamProcessor -> CreateStreamProcessor -> Bool)
-> (CreateStreamProcessor -> CreateStreamProcessor -> Bool)
-> Eq CreateStreamProcessor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStreamProcessor -> CreateStreamProcessor -> Bool
$c/= :: CreateStreamProcessor -> CreateStreamProcessor -> Bool
== :: CreateStreamProcessor -> CreateStreamProcessor -> Bool
$c== :: CreateStreamProcessor -> CreateStreamProcessor -> Bool
Prelude.Eq, ReadPrec [CreateStreamProcessor]
ReadPrec CreateStreamProcessor
Int -> ReadS CreateStreamProcessor
ReadS [CreateStreamProcessor]
(Int -> ReadS CreateStreamProcessor)
-> ReadS [CreateStreamProcessor]
-> ReadPrec CreateStreamProcessor
-> ReadPrec [CreateStreamProcessor]
-> Read CreateStreamProcessor
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStreamProcessor]
$creadListPrec :: ReadPrec [CreateStreamProcessor]
readPrec :: ReadPrec CreateStreamProcessor
$creadPrec :: ReadPrec CreateStreamProcessor
readList :: ReadS [CreateStreamProcessor]
$creadList :: ReadS [CreateStreamProcessor]
readsPrec :: Int -> ReadS CreateStreamProcessor
$creadsPrec :: Int -> ReadS CreateStreamProcessor
Prelude.Read, Int -> CreateStreamProcessor -> ShowS
[CreateStreamProcessor] -> ShowS
CreateStreamProcessor -> String
(Int -> CreateStreamProcessor -> ShowS)
-> (CreateStreamProcessor -> String)
-> ([CreateStreamProcessor] -> ShowS)
-> Show CreateStreamProcessor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStreamProcessor] -> ShowS
$cshowList :: [CreateStreamProcessor] -> ShowS
show :: CreateStreamProcessor -> String
$cshow :: CreateStreamProcessor -> String
showsPrec :: Int -> CreateStreamProcessor -> ShowS
$cshowsPrec :: Int -> CreateStreamProcessor -> ShowS
Prelude.Show, (forall x. CreateStreamProcessor -> Rep CreateStreamProcessor x)
-> (forall x. Rep CreateStreamProcessor x -> CreateStreamProcessor)
-> Generic CreateStreamProcessor
forall x. Rep CreateStreamProcessor x -> CreateStreamProcessor
forall x. CreateStreamProcessor -> Rep CreateStreamProcessor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStreamProcessor x -> CreateStreamProcessor
$cfrom :: forall x. CreateStreamProcessor -> Rep CreateStreamProcessor x
Prelude.Generic)

-- |
-- Create a value of 'CreateStreamProcessor' 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:
--
-- 'tags', 'createStreamProcessor_tags' - A set of tags (key-value pairs) that you want to attach to the stream
-- processor.
--
-- 'input', 'createStreamProcessor_input' - Kinesis video stream stream that provides the source streaming video. If
-- you are using the AWS CLI, the parameter name is @StreamProcessorInput@.
--
-- 'output', 'createStreamProcessor_output' - Kinesis data stream stream to which Amazon Rekognition Video puts the
-- analysis results. If you are using the AWS CLI, the parameter name is
-- @StreamProcessorOutput@.
--
-- 'name', 'createStreamProcessor_name' - An identifier you assign to the stream processor. You can use @Name@ to
-- manage the stream processor. For example, you can get the current status
-- of the stream processor by calling DescribeStreamProcessor. @Name@ is
-- idempotent.
--
-- 'settings', 'createStreamProcessor_settings' - Face recognition input parameters to be used by the stream processor.
-- Includes the collection to use for face recognition and the face
-- attributes to detect.
--
-- 'roleArn', 'createStreamProcessor_roleArn' - ARN of the IAM role that allows access to the stream processor.
newCreateStreamProcessor ::
  -- | 'input'
  StreamProcessorInput ->
  -- | 'output'
  StreamProcessorOutput ->
  -- | 'name'
  Prelude.Text ->
  -- | 'settings'
  StreamProcessorSettings ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateStreamProcessor
newCreateStreamProcessor :: StreamProcessorInput
-> StreamProcessorOutput
-> Text
-> StreamProcessorSettings
-> Text
-> CreateStreamProcessor
newCreateStreamProcessor
  StreamProcessorInput
pInput_
  StreamProcessorOutput
pOutput_
  Text
pName_
  StreamProcessorSettings
pSettings_
  Text
pRoleArn_ =
    CreateStreamProcessor' :: Maybe (HashMap Text Text)
-> StreamProcessorInput
-> StreamProcessorOutput
-> Text
-> StreamProcessorSettings
-> Text
-> CreateStreamProcessor
CreateStreamProcessor'
      { $sel:tags:CreateStreamProcessor' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:input:CreateStreamProcessor' :: StreamProcessorInput
input = StreamProcessorInput
pInput_,
        $sel:output:CreateStreamProcessor' :: StreamProcessorOutput
output = StreamProcessorOutput
pOutput_,
        $sel:name:CreateStreamProcessor' :: Text
name = Text
pName_,
        $sel:settings:CreateStreamProcessor' :: StreamProcessorSettings
settings = StreamProcessorSettings
pSettings_,
        $sel:roleArn:CreateStreamProcessor' :: Text
roleArn = Text
pRoleArn_
      }

-- | A set of tags (key-value pairs) that you want to attach to the stream
-- processor.
createStreamProcessor_tags :: Lens.Lens' CreateStreamProcessor (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createStreamProcessor_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateStreamProcessor -> f CreateStreamProcessor
createStreamProcessor_tags = (CreateStreamProcessor -> Maybe (HashMap Text Text))
-> (CreateStreamProcessor
    -> Maybe (HashMap Text Text) -> CreateStreamProcessor)
-> Lens
     CreateStreamProcessor
     CreateStreamProcessor
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamProcessor' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateStreamProcessor' :: CreateStreamProcessor -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateStreamProcessor
s@CreateStreamProcessor' {} Maybe (HashMap Text Text)
a -> CreateStreamProcessor
s {$sel:tags:CreateStreamProcessor' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateStreamProcessor) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateStreamProcessor -> f CreateStreamProcessor)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateStreamProcessor
-> f CreateStreamProcessor
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Kinesis video stream stream that provides the source streaming video. If
-- you are using the AWS CLI, the parameter name is @StreamProcessorInput@.
createStreamProcessor_input :: Lens.Lens' CreateStreamProcessor StreamProcessorInput
createStreamProcessor_input :: (StreamProcessorInput -> f StreamProcessorInput)
-> CreateStreamProcessor -> f CreateStreamProcessor
createStreamProcessor_input = (CreateStreamProcessor -> StreamProcessorInput)
-> (CreateStreamProcessor
    -> StreamProcessorInput -> CreateStreamProcessor)
-> Lens
     CreateStreamProcessor
     CreateStreamProcessor
     StreamProcessorInput
     StreamProcessorInput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamProcessor' {StreamProcessorInput
input :: StreamProcessorInput
$sel:input:CreateStreamProcessor' :: CreateStreamProcessor -> StreamProcessorInput
input} -> StreamProcessorInput
input) (\s :: CreateStreamProcessor
s@CreateStreamProcessor' {} StreamProcessorInput
a -> CreateStreamProcessor
s {$sel:input:CreateStreamProcessor' :: StreamProcessorInput
input = StreamProcessorInput
a} :: CreateStreamProcessor)

-- | Kinesis data stream stream to which Amazon Rekognition Video puts the
-- analysis results. If you are using the AWS CLI, the parameter name is
-- @StreamProcessorOutput@.
createStreamProcessor_output :: Lens.Lens' CreateStreamProcessor StreamProcessorOutput
createStreamProcessor_output :: (StreamProcessorOutput -> f StreamProcessorOutput)
-> CreateStreamProcessor -> f CreateStreamProcessor
createStreamProcessor_output = (CreateStreamProcessor -> StreamProcessorOutput)
-> (CreateStreamProcessor
    -> StreamProcessorOutput -> CreateStreamProcessor)
-> Lens
     CreateStreamProcessor
     CreateStreamProcessor
     StreamProcessorOutput
     StreamProcessorOutput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamProcessor' {StreamProcessorOutput
output :: StreamProcessorOutput
$sel:output:CreateStreamProcessor' :: CreateStreamProcessor -> StreamProcessorOutput
output} -> StreamProcessorOutput
output) (\s :: CreateStreamProcessor
s@CreateStreamProcessor' {} StreamProcessorOutput
a -> CreateStreamProcessor
s {$sel:output:CreateStreamProcessor' :: StreamProcessorOutput
output = StreamProcessorOutput
a} :: CreateStreamProcessor)

-- | An identifier you assign to the stream processor. You can use @Name@ to
-- manage the stream processor. For example, you can get the current status
-- of the stream processor by calling DescribeStreamProcessor. @Name@ is
-- idempotent.
createStreamProcessor_name :: Lens.Lens' CreateStreamProcessor Prelude.Text
createStreamProcessor_name :: (Text -> f Text)
-> CreateStreamProcessor -> f CreateStreamProcessor
createStreamProcessor_name = (CreateStreamProcessor -> Text)
-> (CreateStreamProcessor -> Text -> CreateStreamProcessor)
-> Lens CreateStreamProcessor CreateStreamProcessor Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamProcessor' {Text
name :: Text
$sel:name:CreateStreamProcessor' :: CreateStreamProcessor -> Text
name} -> Text
name) (\s :: CreateStreamProcessor
s@CreateStreamProcessor' {} Text
a -> CreateStreamProcessor
s {$sel:name:CreateStreamProcessor' :: Text
name = Text
a} :: CreateStreamProcessor)

-- | Face recognition input parameters to be used by the stream processor.
-- Includes the collection to use for face recognition and the face
-- attributes to detect.
createStreamProcessor_settings :: Lens.Lens' CreateStreamProcessor StreamProcessorSettings
createStreamProcessor_settings :: (StreamProcessorSettings -> f StreamProcessorSettings)
-> CreateStreamProcessor -> f CreateStreamProcessor
createStreamProcessor_settings = (CreateStreamProcessor -> StreamProcessorSettings)
-> (CreateStreamProcessor
    -> StreamProcessorSettings -> CreateStreamProcessor)
-> Lens
     CreateStreamProcessor
     CreateStreamProcessor
     StreamProcessorSettings
     StreamProcessorSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamProcessor' {StreamProcessorSettings
settings :: StreamProcessorSettings
$sel:settings:CreateStreamProcessor' :: CreateStreamProcessor -> StreamProcessorSettings
settings} -> StreamProcessorSettings
settings) (\s :: CreateStreamProcessor
s@CreateStreamProcessor' {} StreamProcessorSettings
a -> CreateStreamProcessor
s {$sel:settings:CreateStreamProcessor' :: StreamProcessorSettings
settings = StreamProcessorSettings
a} :: CreateStreamProcessor)

-- | ARN of the IAM role that allows access to the stream processor.
createStreamProcessor_roleArn :: Lens.Lens' CreateStreamProcessor Prelude.Text
createStreamProcessor_roleArn :: (Text -> f Text)
-> CreateStreamProcessor -> f CreateStreamProcessor
createStreamProcessor_roleArn = (CreateStreamProcessor -> Text)
-> (CreateStreamProcessor -> Text -> CreateStreamProcessor)
-> Lens CreateStreamProcessor CreateStreamProcessor Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamProcessor' {Text
roleArn :: Text
$sel:roleArn:CreateStreamProcessor' :: CreateStreamProcessor -> Text
roleArn} -> Text
roleArn) (\s :: CreateStreamProcessor
s@CreateStreamProcessor' {} Text
a -> CreateStreamProcessor
s {$sel:roleArn:CreateStreamProcessor' :: Text
roleArn = Text
a} :: CreateStreamProcessor)

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

instance Prelude.NFData CreateStreamProcessor

instance Core.ToHeaders CreateStreamProcessor where
  toHeaders :: CreateStreamProcessor -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateStreamProcessor -> 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
"RekognitionService.CreateStreamProcessor" ::
                          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 CreateStreamProcessor where
  toJSON :: CreateStreamProcessor -> Value
toJSON CreateStreamProcessor' {Maybe (HashMap Text Text)
Text
StreamProcessorInput
StreamProcessorOutput
StreamProcessorSettings
roleArn :: Text
settings :: StreamProcessorSettings
name :: Text
output :: StreamProcessorOutput
input :: StreamProcessorInput
tags :: Maybe (HashMap Text Text)
$sel:roleArn:CreateStreamProcessor' :: CreateStreamProcessor -> Text
$sel:settings:CreateStreamProcessor' :: CreateStreamProcessor -> StreamProcessorSettings
$sel:name:CreateStreamProcessor' :: CreateStreamProcessor -> Text
$sel:output:CreateStreamProcessor' :: CreateStreamProcessor -> StreamProcessorOutput
$sel:input:CreateStreamProcessor' :: CreateStreamProcessor -> StreamProcessorInput
$sel:tags:CreateStreamProcessor' :: CreateStreamProcessor -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Input" Text -> StreamProcessorInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StreamProcessorInput
input),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Output" Text -> StreamProcessorOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StreamProcessorOutput
output),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Settings" Text -> StreamProcessorSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StreamProcessorSettings
settings),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateStreamProcessorResponse' 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:
--
-- 'streamProcessorArn', 'createStreamProcessorResponse_streamProcessorArn' - ARN for the newly create stream processor.
--
-- 'httpStatus', 'createStreamProcessorResponse_httpStatus' - The response's http status code.
newCreateStreamProcessorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateStreamProcessorResponse
newCreateStreamProcessorResponse :: Int -> CreateStreamProcessorResponse
newCreateStreamProcessorResponse Int
pHttpStatus_ =
  CreateStreamProcessorResponse' :: Maybe Text -> Int -> CreateStreamProcessorResponse
CreateStreamProcessorResponse'
    { $sel:streamProcessorArn:CreateStreamProcessorResponse' :: Maybe Text
streamProcessorArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateStreamProcessorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | ARN for the newly create stream processor.
createStreamProcessorResponse_streamProcessorArn :: Lens.Lens' CreateStreamProcessorResponse (Prelude.Maybe Prelude.Text)
createStreamProcessorResponse_streamProcessorArn :: (Maybe Text -> f (Maybe Text))
-> CreateStreamProcessorResponse -> f CreateStreamProcessorResponse
createStreamProcessorResponse_streamProcessorArn = (CreateStreamProcessorResponse -> Maybe Text)
-> (CreateStreamProcessorResponse
    -> Maybe Text -> CreateStreamProcessorResponse)
-> Lens
     CreateStreamProcessorResponse
     CreateStreamProcessorResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamProcessorResponse' {Maybe Text
streamProcessorArn :: Maybe Text
$sel:streamProcessorArn:CreateStreamProcessorResponse' :: CreateStreamProcessorResponse -> Maybe Text
streamProcessorArn} -> Maybe Text
streamProcessorArn) (\s :: CreateStreamProcessorResponse
s@CreateStreamProcessorResponse' {} Maybe Text
a -> CreateStreamProcessorResponse
s {$sel:streamProcessorArn:CreateStreamProcessorResponse' :: Maybe Text
streamProcessorArn = Maybe Text
a} :: CreateStreamProcessorResponse)

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

instance Prelude.NFData CreateStreamProcessorResponse