{-# 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.MediaPackage.CreateHarvestJob
-- 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 new HarvestJob record.
module Amazonka.MediaPackage.CreateHarvestJob
  ( -- * Creating a Request
    CreateHarvestJob (..),
    newCreateHarvestJob,

    -- * Request Lenses
    createHarvestJob_s3Destination,
    createHarvestJob_endTime,
    createHarvestJob_originEndpointId,
    createHarvestJob_startTime,
    createHarvestJob_id,

    -- * Destructuring the Response
    CreateHarvestJobResponse (..),
    newCreateHarvestJobResponse,

    -- * Response Lenses
    createHarvestJobResponse_status,
    createHarvestJobResponse_originEndpointId,
    createHarvestJobResponse_startTime,
    createHarvestJobResponse_arn,
    createHarvestJobResponse_createdAt,
    createHarvestJobResponse_channelId,
    createHarvestJobResponse_s3Destination,
    createHarvestJobResponse_endTime,
    createHarvestJobResponse_id,
    createHarvestJobResponse_httpStatus,
  )
where

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

-- | Configuration parameters used to create a new HarvestJob.
--
-- /See:/ 'newCreateHarvestJob' smart constructor.
data CreateHarvestJob = CreateHarvestJob'
  { CreateHarvestJob -> S3Destination
s3Destination :: S3Destination,
    -- | The end of the time-window which will be harvested
    CreateHarvestJob -> Text
endTime :: Prelude.Text,
    -- | The ID of the OriginEndpoint that the HarvestJob will harvest from. This
    -- cannot be changed after the HarvestJob is submitted.
    CreateHarvestJob -> Text
originEndpointId :: Prelude.Text,
    -- | The start of the time-window which will be harvested
    CreateHarvestJob -> Text
startTime :: Prelude.Text,
    -- | The ID of the HarvestJob. The ID must be unique within the region and it
    -- cannot be changed after the HarvestJob is submitted
    CreateHarvestJob -> Text
id :: Prelude.Text
  }
  deriving (CreateHarvestJob -> CreateHarvestJob -> Bool
(CreateHarvestJob -> CreateHarvestJob -> Bool)
-> (CreateHarvestJob -> CreateHarvestJob -> Bool)
-> Eq CreateHarvestJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHarvestJob -> CreateHarvestJob -> Bool
$c/= :: CreateHarvestJob -> CreateHarvestJob -> Bool
== :: CreateHarvestJob -> CreateHarvestJob -> Bool
$c== :: CreateHarvestJob -> CreateHarvestJob -> Bool
Prelude.Eq, ReadPrec [CreateHarvestJob]
ReadPrec CreateHarvestJob
Int -> ReadS CreateHarvestJob
ReadS [CreateHarvestJob]
(Int -> ReadS CreateHarvestJob)
-> ReadS [CreateHarvestJob]
-> ReadPrec CreateHarvestJob
-> ReadPrec [CreateHarvestJob]
-> Read CreateHarvestJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHarvestJob]
$creadListPrec :: ReadPrec [CreateHarvestJob]
readPrec :: ReadPrec CreateHarvestJob
$creadPrec :: ReadPrec CreateHarvestJob
readList :: ReadS [CreateHarvestJob]
$creadList :: ReadS [CreateHarvestJob]
readsPrec :: Int -> ReadS CreateHarvestJob
$creadsPrec :: Int -> ReadS CreateHarvestJob
Prelude.Read, Int -> CreateHarvestJob -> ShowS
[CreateHarvestJob] -> ShowS
CreateHarvestJob -> String
(Int -> CreateHarvestJob -> ShowS)
-> (CreateHarvestJob -> String)
-> ([CreateHarvestJob] -> ShowS)
-> Show CreateHarvestJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHarvestJob] -> ShowS
$cshowList :: [CreateHarvestJob] -> ShowS
show :: CreateHarvestJob -> String
$cshow :: CreateHarvestJob -> String
showsPrec :: Int -> CreateHarvestJob -> ShowS
$cshowsPrec :: Int -> CreateHarvestJob -> ShowS
Prelude.Show, (forall x. CreateHarvestJob -> Rep CreateHarvestJob x)
-> (forall x. Rep CreateHarvestJob x -> CreateHarvestJob)
-> Generic CreateHarvestJob
forall x. Rep CreateHarvestJob x -> CreateHarvestJob
forall x. CreateHarvestJob -> Rep CreateHarvestJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHarvestJob x -> CreateHarvestJob
$cfrom :: forall x. CreateHarvestJob -> Rep CreateHarvestJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateHarvestJob' 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:
--
-- 's3Destination', 'createHarvestJob_s3Destination' - Undocumented member.
--
-- 'endTime', 'createHarvestJob_endTime' - The end of the time-window which will be harvested
--
-- 'originEndpointId', 'createHarvestJob_originEndpointId' - The ID of the OriginEndpoint that the HarvestJob will harvest from. This
-- cannot be changed after the HarvestJob is submitted.
--
-- 'startTime', 'createHarvestJob_startTime' - The start of the time-window which will be harvested
--
-- 'id', 'createHarvestJob_id' - The ID of the HarvestJob. The ID must be unique within the region and it
-- cannot be changed after the HarvestJob is submitted
newCreateHarvestJob ::
  -- | 's3Destination'
  S3Destination ->
  -- | 'endTime'
  Prelude.Text ->
  -- | 'originEndpointId'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  CreateHarvestJob
newCreateHarvestJob :: S3Destination -> Text -> Text -> Text -> Text -> CreateHarvestJob
newCreateHarvestJob
  S3Destination
pS3Destination_
  Text
pEndTime_
  Text
pOriginEndpointId_
  Text
pStartTime_
  Text
pId_ =
    CreateHarvestJob' :: S3Destination -> Text -> Text -> Text -> Text -> CreateHarvestJob
CreateHarvestJob'
      { $sel:s3Destination:CreateHarvestJob' :: S3Destination
s3Destination = S3Destination
pS3Destination_,
        $sel:endTime:CreateHarvestJob' :: Text
endTime = Text
pEndTime_,
        $sel:originEndpointId:CreateHarvestJob' :: Text
originEndpointId = Text
pOriginEndpointId_,
        $sel:startTime:CreateHarvestJob' :: Text
startTime = Text
pStartTime_,
        $sel:id:CreateHarvestJob' :: Text
id = Text
pId_
      }

-- | Undocumented member.
createHarvestJob_s3Destination :: Lens.Lens' CreateHarvestJob S3Destination
createHarvestJob_s3Destination :: (S3Destination -> f S3Destination)
-> CreateHarvestJob -> f CreateHarvestJob
createHarvestJob_s3Destination = (CreateHarvestJob -> S3Destination)
-> (CreateHarvestJob -> S3Destination -> CreateHarvestJob)
-> Lens
     CreateHarvestJob CreateHarvestJob S3Destination S3Destination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJob' {S3Destination
s3Destination :: S3Destination
$sel:s3Destination:CreateHarvestJob' :: CreateHarvestJob -> S3Destination
s3Destination} -> S3Destination
s3Destination) (\s :: CreateHarvestJob
s@CreateHarvestJob' {} S3Destination
a -> CreateHarvestJob
s {$sel:s3Destination:CreateHarvestJob' :: S3Destination
s3Destination = S3Destination
a} :: CreateHarvestJob)

-- | The end of the time-window which will be harvested
createHarvestJob_endTime :: Lens.Lens' CreateHarvestJob Prelude.Text
createHarvestJob_endTime :: (Text -> f Text) -> CreateHarvestJob -> f CreateHarvestJob
createHarvestJob_endTime = (CreateHarvestJob -> Text)
-> (CreateHarvestJob -> Text -> CreateHarvestJob)
-> Lens CreateHarvestJob CreateHarvestJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJob' {Text
endTime :: Text
$sel:endTime:CreateHarvestJob' :: CreateHarvestJob -> Text
endTime} -> Text
endTime) (\s :: CreateHarvestJob
s@CreateHarvestJob' {} Text
a -> CreateHarvestJob
s {$sel:endTime:CreateHarvestJob' :: Text
endTime = Text
a} :: CreateHarvestJob)

-- | The ID of the OriginEndpoint that the HarvestJob will harvest from. This
-- cannot be changed after the HarvestJob is submitted.
createHarvestJob_originEndpointId :: Lens.Lens' CreateHarvestJob Prelude.Text
createHarvestJob_originEndpointId :: (Text -> f Text) -> CreateHarvestJob -> f CreateHarvestJob
createHarvestJob_originEndpointId = (CreateHarvestJob -> Text)
-> (CreateHarvestJob -> Text -> CreateHarvestJob)
-> Lens CreateHarvestJob CreateHarvestJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJob' {Text
originEndpointId :: Text
$sel:originEndpointId:CreateHarvestJob' :: CreateHarvestJob -> Text
originEndpointId} -> Text
originEndpointId) (\s :: CreateHarvestJob
s@CreateHarvestJob' {} Text
a -> CreateHarvestJob
s {$sel:originEndpointId:CreateHarvestJob' :: Text
originEndpointId = Text
a} :: CreateHarvestJob)

-- | The start of the time-window which will be harvested
createHarvestJob_startTime :: Lens.Lens' CreateHarvestJob Prelude.Text
createHarvestJob_startTime :: (Text -> f Text) -> CreateHarvestJob -> f CreateHarvestJob
createHarvestJob_startTime = (CreateHarvestJob -> Text)
-> (CreateHarvestJob -> Text -> CreateHarvestJob)
-> Lens CreateHarvestJob CreateHarvestJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJob' {Text
startTime :: Text
$sel:startTime:CreateHarvestJob' :: CreateHarvestJob -> Text
startTime} -> Text
startTime) (\s :: CreateHarvestJob
s@CreateHarvestJob' {} Text
a -> CreateHarvestJob
s {$sel:startTime:CreateHarvestJob' :: Text
startTime = Text
a} :: CreateHarvestJob)

-- | The ID of the HarvestJob. The ID must be unique within the region and it
-- cannot be changed after the HarvestJob is submitted
createHarvestJob_id :: Lens.Lens' CreateHarvestJob Prelude.Text
createHarvestJob_id :: (Text -> f Text) -> CreateHarvestJob -> f CreateHarvestJob
createHarvestJob_id = (CreateHarvestJob -> Text)
-> (CreateHarvestJob -> Text -> CreateHarvestJob)
-> Lens CreateHarvestJob CreateHarvestJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJob' {Text
id :: Text
$sel:id:CreateHarvestJob' :: CreateHarvestJob -> Text
id} -> Text
id) (\s :: CreateHarvestJob
s@CreateHarvestJob' {} Text
a -> CreateHarvestJob
s {$sel:id:CreateHarvestJob' :: Text
id = Text
a} :: CreateHarvestJob)

instance Core.AWSRequest CreateHarvestJob where
  type
    AWSResponse CreateHarvestJob =
      CreateHarvestJobResponse
  request :: CreateHarvestJob -> Request CreateHarvestJob
request = Service -> CreateHarvestJob -> Request CreateHarvestJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateHarvestJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateHarvestJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateHarvestJob))
-> Logger
-> Service
-> Proxy CreateHarvestJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateHarvestJob)))
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 Status
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe S3Destination
-> Maybe Text
-> Maybe Text
-> Int
-> CreateHarvestJobResponse
CreateHarvestJobResponse'
            (Maybe Status
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe S3Destination
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateHarvestJobResponse)
-> Either String (Maybe Status)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe S3Destination
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Status)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe S3Destination
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateHarvestJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe S3Destination
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"originEndpointId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe S3Destination
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateHarvestJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe S3Destination
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"startTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe S3Destination
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateHarvestJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe S3Destination
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"arn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe S3Destination
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateHarvestJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe S3Destination
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"createdAt")
            Either
  String
  (Maybe Text
   -> Maybe S3Destination
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateHarvestJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe S3Destination
      -> Maybe Text -> Maybe Text -> Int -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"channelId")
            Either
  String
  (Maybe S3Destination
   -> Maybe Text -> Maybe Text -> Int -> CreateHarvestJobResponse)
-> Either String (Maybe S3Destination)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe S3Destination)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"s3Destination")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> CreateHarvestJobResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"endTime")
            Either String (Maybe Text -> Int -> CreateHarvestJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateHarvestJobResponse)
forall (f :: * -> *) a b. Applicative f => 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
"id")
            Either String (Int -> CreateHarvestJobResponse)
-> Either String Int -> Either String CreateHarvestJobResponse
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 CreateHarvestJob

instance Prelude.NFData CreateHarvestJob

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

instance Core.ToJSON CreateHarvestJob where
  toJSON :: CreateHarvestJob -> Value
toJSON CreateHarvestJob' {Text
S3Destination
id :: Text
startTime :: Text
originEndpointId :: Text
endTime :: Text
s3Destination :: S3Destination
$sel:id:CreateHarvestJob' :: CreateHarvestJob -> Text
$sel:startTime:CreateHarvestJob' :: CreateHarvestJob -> Text
$sel:originEndpointId:CreateHarvestJob' :: CreateHarvestJob -> Text
$sel:endTime:CreateHarvestJob' :: CreateHarvestJob -> Text
$sel:s3Destination:CreateHarvestJob' :: CreateHarvestJob -> S3Destination
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"s3Destination" Text -> S3Destination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3Destination
s3Destination),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"endTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endTime),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"originEndpointId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
originEndpointId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"startTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
startTime),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)
          ]
      )

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

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

-- | /See:/ 'newCreateHarvestJobResponse' smart constructor.
data CreateHarvestJobResponse = CreateHarvestJobResponse'
  { -- | The current status of the HarvestJob. Consider setting up a CloudWatch
    -- Event to listen for HarvestJobs as they succeed or fail. In the event of
    -- failure, the CloudWatch Event will include an explanation of why the
    -- HarvestJob failed.
    CreateHarvestJobResponse -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The ID of the OriginEndpoint that the HarvestJob will harvest from. This
    -- cannot be changed after the HarvestJob is submitted.
    CreateHarvestJobResponse -> Maybe Text
originEndpointId :: Prelude.Maybe Prelude.Text,
    -- | The start of the time-window which will be harvested.
    CreateHarvestJobResponse -> Maybe Text
startTime :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) assigned to the HarvestJob.
    CreateHarvestJobResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time the HarvestJob was submitted
    CreateHarvestJobResponse -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Channel that the HarvestJob will harvest from.
    CreateHarvestJobResponse -> Maybe Text
channelId :: Prelude.Maybe Prelude.Text,
    CreateHarvestJobResponse -> Maybe S3Destination
s3Destination :: Prelude.Maybe S3Destination,
    -- | The end of the time-window which will be harvested.
    CreateHarvestJobResponse -> Maybe Text
endTime :: Prelude.Maybe Prelude.Text,
    -- | The ID of the HarvestJob. The ID must be unique within the region and it
    -- cannot be changed after the HarvestJob is submitted.
    CreateHarvestJobResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateHarvestJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateHarvestJobResponse -> CreateHarvestJobResponse -> Bool
(CreateHarvestJobResponse -> CreateHarvestJobResponse -> Bool)
-> (CreateHarvestJobResponse -> CreateHarvestJobResponse -> Bool)
-> Eq CreateHarvestJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHarvestJobResponse -> CreateHarvestJobResponse -> Bool
$c/= :: CreateHarvestJobResponse -> CreateHarvestJobResponse -> Bool
== :: CreateHarvestJobResponse -> CreateHarvestJobResponse -> Bool
$c== :: CreateHarvestJobResponse -> CreateHarvestJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateHarvestJobResponse]
ReadPrec CreateHarvestJobResponse
Int -> ReadS CreateHarvestJobResponse
ReadS [CreateHarvestJobResponse]
(Int -> ReadS CreateHarvestJobResponse)
-> ReadS [CreateHarvestJobResponse]
-> ReadPrec CreateHarvestJobResponse
-> ReadPrec [CreateHarvestJobResponse]
-> Read CreateHarvestJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHarvestJobResponse]
$creadListPrec :: ReadPrec [CreateHarvestJobResponse]
readPrec :: ReadPrec CreateHarvestJobResponse
$creadPrec :: ReadPrec CreateHarvestJobResponse
readList :: ReadS [CreateHarvestJobResponse]
$creadList :: ReadS [CreateHarvestJobResponse]
readsPrec :: Int -> ReadS CreateHarvestJobResponse
$creadsPrec :: Int -> ReadS CreateHarvestJobResponse
Prelude.Read, Int -> CreateHarvestJobResponse -> ShowS
[CreateHarvestJobResponse] -> ShowS
CreateHarvestJobResponse -> String
(Int -> CreateHarvestJobResponse -> ShowS)
-> (CreateHarvestJobResponse -> String)
-> ([CreateHarvestJobResponse] -> ShowS)
-> Show CreateHarvestJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHarvestJobResponse] -> ShowS
$cshowList :: [CreateHarvestJobResponse] -> ShowS
show :: CreateHarvestJobResponse -> String
$cshow :: CreateHarvestJobResponse -> String
showsPrec :: Int -> CreateHarvestJobResponse -> ShowS
$cshowsPrec :: Int -> CreateHarvestJobResponse -> ShowS
Prelude.Show, (forall x.
 CreateHarvestJobResponse -> Rep CreateHarvestJobResponse x)
-> (forall x.
    Rep CreateHarvestJobResponse x -> CreateHarvestJobResponse)
-> Generic CreateHarvestJobResponse
forall x.
Rep CreateHarvestJobResponse x -> CreateHarvestJobResponse
forall x.
CreateHarvestJobResponse -> Rep CreateHarvestJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateHarvestJobResponse x -> CreateHarvestJobResponse
$cfrom :: forall x.
CreateHarvestJobResponse -> Rep CreateHarvestJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateHarvestJobResponse' 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:
--
-- 'status', 'createHarvestJobResponse_status' - The current status of the HarvestJob. Consider setting up a CloudWatch
-- Event to listen for HarvestJobs as they succeed or fail. In the event of
-- failure, the CloudWatch Event will include an explanation of why the
-- HarvestJob failed.
--
-- 'originEndpointId', 'createHarvestJobResponse_originEndpointId' - The ID of the OriginEndpoint that the HarvestJob will harvest from. This
-- cannot be changed after the HarvestJob is submitted.
--
-- 'startTime', 'createHarvestJobResponse_startTime' - The start of the time-window which will be harvested.
--
-- 'arn', 'createHarvestJobResponse_arn' - The Amazon Resource Name (ARN) assigned to the HarvestJob.
--
-- 'createdAt', 'createHarvestJobResponse_createdAt' - The time the HarvestJob was submitted
--
-- 'channelId', 'createHarvestJobResponse_channelId' - The ID of the Channel that the HarvestJob will harvest from.
--
-- 's3Destination', 'createHarvestJobResponse_s3Destination' - Undocumented member.
--
-- 'endTime', 'createHarvestJobResponse_endTime' - The end of the time-window which will be harvested.
--
-- 'id', 'createHarvestJobResponse_id' - The ID of the HarvestJob. The ID must be unique within the region and it
-- cannot be changed after the HarvestJob is submitted.
--
-- 'httpStatus', 'createHarvestJobResponse_httpStatus' - The response's http status code.
newCreateHarvestJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateHarvestJobResponse
newCreateHarvestJobResponse :: Int -> CreateHarvestJobResponse
newCreateHarvestJobResponse Int
pHttpStatus_ =
  CreateHarvestJobResponse' :: Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe S3Destination
-> Maybe Text
-> Maybe Text
-> Int
-> CreateHarvestJobResponse
CreateHarvestJobResponse'
    { $sel:status:CreateHarvestJobResponse' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
      $sel:originEndpointId:CreateHarvestJobResponse' :: Maybe Text
originEndpointId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:CreateHarvestJobResponse' :: Maybe Text
startTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateHarvestJobResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CreateHarvestJobResponse' :: Maybe Text
createdAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:channelId:CreateHarvestJobResponse' :: Maybe Text
channelId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Destination:CreateHarvestJobResponse' :: Maybe S3Destination
s3Destination = Maybe S3Destination
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:CreateHarvestJobResponse' :: Maybe Text
endTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateHarvestJobResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateHarvestJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current status of the HarvestJob. Consider setting up a CloudWatch
-- Event to listen for HarvestJobs as they succeed or fail. In the event of
-- failure, the CloudWatch Event will include an explanation of why the
-- HarvestJob failed.
createHarvestJobResponse_status :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Status)
createHarvestJobResponse_status :: (Maybe Status -> f (Maybe Status))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_status = (CreateHarvestJobResponse -> Maybe Status)
-> (CreateHarvestJobResponse
    -> Maybe Status -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Status)
     (Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Status
status :: Maybe Status
$sel:status:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Status
status} -> Maybe Status
status) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Status
a -> CreateHarvestJobResponse
s {$sel:status:CreateHarvestJobResponse' :: Maybe Status
status = Maybe Status
a} :: CreateHarvestJobResponse)

-- | The ID of the OriginEndpoint that the HarvestJob will harvest from. This
-- cannot be changed after the HarvestJob is submitted.
createHarvestJobResponse_originEndpointId :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Prelude.Text)
createHarvestJobResponse_originEndpointId :: (Maybe Text -> f (Maybe Text))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_originEndpointId = (CreateHarvestJobResponse -> Maybe Text)
-> (CreateHarvestJobResponse
    -> Maybe Text -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Text
originEndpointId :: Maybe Text
$sel:originEndpointId:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Text
originEndpointId} -> Maybe Text
originEndpointId) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Text
a -> CreateHarvestJobResponse
s {$sel:originEndpointId:CreateHarvestJobResponse' :: Maybe Text
originEndpointId = Maybe Text
a} :: CreateHarvestJobResponse)

-- | The start of the time-window which will be harvested.
createHarvestJobResponse_startTime :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Prelude.Text)
createHarvestJobResponse_startTime :: (Maybe Text -> f (Maybe Text))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_startTime = (CreateHarvestJobResponse -> Maybe Text)
-> (CreateHarvestJobResponse
    -> Maybe Text -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Text
startTime :: Maybe Text
$sel:startTime:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Text
startTime} -> Maybe Text
startTime) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Text
a -> CreateHarvestJobResponse
s {$sel:startTime:CreateHarvestJobResponse' :: Maybe Text
startTime = Maybe Text
a} :: CreateHarvestJobResponse)

-- | The Amazon Resource Name (ARN) assigned to the HarvestJob.
createHarvestJobResponse_arn :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Prelude.Text)
createHarvestJobResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_arn = (CreateHarvestJobResponse -> Maybe Text)
-> (CreateHarvestJobResponse
    -> Maybe Text -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Text
a -> CreateHarvestJobResponse
s {$sel:arn:CreateHarvestJobResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateHarvestJobResponse)

-- | The time the HarvestJob was submitted
createHarvestJobResponse_createdAt :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Prelude.Text)
createHarvestJobResponse_createdAt :: (Maybe Text -> f (Maybe Text))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_createdAt = (CreateHarvestJobResponse -> Maybe Text)
-> (CreateHarvestJobResponse
    -> Maybe Text -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Text
a -> CreateHarvestJobResponse
s {$sel:createdAt:CreateHarvestJobResponse' :: Maybe Text
createdAt = Maybe Text
a} :: CreateHarvestJobResponse)

-- | The ID of the Channel that the HarvestJob will harvest from.
createHarvestJobResponse_channelId :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Prelude.Text)
createHarvestJobResponse_channelId :: (Maybe Text -> f (Maybe Text))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_channelId = (CreateHarvestJobResponse -> Maybe Text)
-> (CreateHarvestJobResponse
    -> Maybe Text -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Text
channelId :: Maybe Text
$sel:channelId:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Text
channelId} -> Maybe Text
channelId) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Text
a -> CreateHarvestJobResponse
s {$sel:channelId:CreateHarvestJobResponse' :: Maybe Text
channelId = Maybe Text
a} :: CreateHarvestJobResponse)

-- | Undocumented member.
createHarvestJobResponse_s3Destination :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe S3Destination)
createHarvestJobResponse_s3Destination :: (Maybe S3Destination -> f (Maybe S3Destination))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_s3Destination = (CreateHarvestJobResponse -> Maybe S3Destination)
-> (CreateHarvestJobResponse
    -> Maybe S3Destination -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe S3Destination)
     (Maybe S3Destination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe S3Destination
s3Destination :: Maybe S3Destination
$sel:s3Destination:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe S3Destination
s3Destination} -> Maybe S3Destination
s3Destination) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe S3Destination
a -> CreateHarvestJobResponse
s {$sel:s3Destination:CreateHarvestJobResponse' :: Maybe S3Destination
s3Destination = Maybe S3Destination
a} :: CreateHarvestJobResponse)

-- | The end of the time-window which will be harvested.
createHarvestJobResponse_endTime :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Prelude.Text)
createHarvestJobResponse_endTime :: (Maybe Text -> f (Maybe Text))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_endTime = (CreateHarvestJobResponse -> Maybe Text)
-> (CreateHarvestJobResponse
    -> Maybe Text -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Text
endTime :: Maybe Text
$sel:endTime:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Text
endTime} -> Maybe Text
endTime) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Text
a -> CreateHarvestJobResponse
s {$sel:endTime:CreateHarvestJobResponse' :: Maybe Text
endTime = Maybe Text
a} :: CreateHarvestJobResponse)

-- | The ID of the HarvestJob. The ID must be unique within the region and it
-- cannot be changed after the HarvestJob is submitted.
createHarvestJobResponse_id :: Lens.Lens' CreateHarvestJobResponse (Prelude.Maybe Prelude.Text)
createHarvestJobResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateHarvestJobResponse -> f CreateHarvestJobResponse
createHarvestJobResponse_id = (CreateHarvestJobResponse -> Maybe Text)
-> (CreateHarvestJobResponse
    -> Maybe Text -> CreateHarvestJobResponse)
-> Lens
     CreateHarvestJobResponse
     CreateHarvestJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHarvestJobResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateHarvestJobResponse' :: CreateHarvestJobResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateHarvestJobResponse
s@CreateHarvestJobResponse' {} Maybe Text
a -> CreateHarvestJobResponse
s {$sel:id:CreateHarvestJobResponse' :: Maybe Text
id = Maybe Text
a} :: CreateHarvestJobResponse)

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

instance Prelude.NFData CreateHarvestJobResponse