{-# 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.DataExchange.CreateJob
-- 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)
--
-- This operation creates a job.
module Amazonka.DataExchange.CreateJob
  ( -- * Creating a Request
    CreateJob (..),
    newCreateJob,

    -- * Request Lenses
    createJob_type,
    createJob_details,

    -- * Destructuring the Response
    CreateJobResponse (..),
    newCreateJobResponse,

    -- * Response Lenses
    createJobResponse_state,
    createJobResponse_arn,
    createJobResponse_createdAt,
    createJobResponse_details,
    createJobResponse_id,
    createJobResponse_type,
    createJobResponse_updatedAt,
    createJobResponse_errors,
    createJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataExchange.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

-- | The request body for CreateJob.
--
-- /See:/ 'newCreateJob' smart constructor.
data CreateJob = CreateJob'
  { -- | The type of job to be created.
    CreateJob -> Type
type' :: Type,
    -- | The details for the CreateJob request.
    CreateJob -> RequestDetails
details :: RequestDetails
  }
  deriving (CreateJob -> CreateJob -> Bool
(CreateJob -> CreateJob -> Bool)
-> (CreateJob -> CreateJob -> Bool) -> Eq CreateJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJob -> CreateJob -> Bool
$c/= :: CreateJob -> CreateJob -> Bool
== :: CreateJob -> CreateJob -> Bool
$c== :: CreateJob -> CreateJob -> Bool
Prelude.Eq, ReadPrec [CreateJob]
ReadPrec CreateJob
Int -> ReadS CreateJob
ReadS [CreateJob]
(Int -> ReadS CreateJob)
-> ReadS [CreateJob]
-> ReadPrec CreateJob
-> ReadPrec [CreateJob]
-> Read CreateJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJob]
$creadListPrec :: ReadPrec [CreateJob]
readPrec :: ReadPrec CreateJob
$creadPrec :: ReadPrec CreateJob
readList :: ReadS [CreateJob]
$creadList :: ReadS [CreateJob]
readsPrec :: Int -> ReadS CreateJob
$creadsPrec :: Int -> ReadS CreateJob
Prelude.Read, Int -> CreateJob -> ShowS
[CreateJob] -> ShowS
CreateJob -> String
(Int -> CreateJob -> ShowS)
-> (CreateJob -> String)
-> ([CreateJob] -> ShowS)
-> Show CreateJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJob] -> ShowS
$cshowList :: [CreateJob] -> ShowS
show :: CreateJob -> String
$cshow :: CreateJob -> String
showsPrec :: Int -> CreateJob -> ShowS
$cshowsPrec :: Int -> CreateJob -> ShowS
Prelude.Show, (forall x. CreateJob -> Rep CreateJob x)
-> (forall x. Rep CreateJob x -> CreateJob) -> Generic CreateJob
forall x. Rep CreateJob x -> CreateJob
forall x. CreateJob -> Rep CreateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJob x -> CreateJob
$cfrom :: forall x. CreateJob -> Rep CreateJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateJob' 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:
--
-- 'type'', 'createJob_type' - The type of job to be created.
--
-- 'details', 'createJob_details' - The details for the CreateJob request.
newCreateJob ::
  -- | 'type''
  Type ->
  -- | 'details'
  RequestDetails ->
  CreateJob
newCreateJob :: Type -> RequestDetails -> CreateJob
newCreateJob Type
pType_ RequestDetails
pDetails_ =
  CreateJob' :: Type -> RequestDetails -> CreateJob
CreateJob' {$sel:type':CreateJob' :: Type
type' = Type
pType_, $sel:details:CreateJob' :: RequestDetails
details = RequestDetails
pDetails_}

-- | The type of job to be created.
createJob_type :: Lens.Lens' CreateJob Type
createJob_type :: (Type -> f Type) -> CreateJob -> f CreateJob
createJob_type = (CreateJob -> Type)
-> (CreateJob -> Type -> CreateJob)
-> Lens CreateJob CreateJob Type Type
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Type
type' :: Type
$sel:type':CreateJob' :: CreateJob -> Type
type'} -> Type
type') (\s :: CreateJob
s@CreateJob' {} Type
a -> CreateJob
s {$sel:type':CreateJob' :: Type
type' = Type
a} :: CreateJob)

-- | The details for the CreateJob request.
createJob_details :: Lens.Lens' CreateJob RequestDetails
createJob_details :: (RequestDetails -> f RequestDetails) -> CreateJob -> f CreateJob
createJob_details = (CreateJob -> RequestDetails)
-> (CreateJob -> RequestDetails -> CreateJob)
-> Lens CreateJob CreateJob RequestDetails RequestDetails
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {RequestDetails
details :: RequestDetails
$sel:details:CreateJob' :: CreateJob -> RequestDetails
details} -> RequestDetails
details) (\s :: CreateJob
s@CreateJob' {} RequestDetails
a -> CreateJob
s {$sel:details:CreateJob' :: RequestDetails
details = RequestDetails
a} :: CreateJob)

instance Core.AWSRequest CreateJob where
  type AWSResponse CreateJob = CreateJobResponse
  request :: CreateJob -> Request CreateJob
request = Service -> CreateJob -> Request CreateJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateJob))
-> Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
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 State
-> Maybe Text
-> Maybe POSIX
-> Maybe ResponseDetails
-> Maybe Text
-> Maybe Type
-> Maybe POSIX
-> Maybe [JobError]
-> Int
-> CreateJobResponse
CreateJobResponse'
            (Maybe State
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe ResponseDetails
 -> Maybe Text
 -> Maybe Type
 -> Maybe POSIX
 -> Maybe [JobError]
 -> Int
 -> CreateJobResponse)
-> Either String (Maybe State)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe ResponseDetails
      -> Maybe Text
      -> Maybe Type
      -> Maybe POSIX
      -> Maybe [JobError]
      -> Int
      -> CreateJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe State)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"State")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe ResponseDetails
   -> Maybe Text
   -> Maybe Type
   -> Maybe POSIX
   -> Maybe [JobError]
   -> Int
   -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe ResponseDetails
      -> Maybe Text
      -> Maybe Type
      -> Maybe POSIX
      -> Maybe [JobError]
      -> Int
      -> CreateJobResponse)
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 POSIX
   -> Maybe ResponseDetails
   -> Maybe Text
   -> Maybe Type
   -> Maybe POSIX
   -> Maybe [JobError]
   -> Int
   -> CreateJobResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe ResponseDetails
      -> Maybe Text
      -> Maybe Type
      -> Maybe POSIX
      -> Maybe [JobError]
      -> Int
      -> CreateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedAt")
            Either
  String
  (Maybe ResponseDetails
   -> Maybe Text
   -> Maybe Type
   -> Maybe POSIX
   -> Maybe [JobError]
   -> Int
   -> CreateJobResponse)
-> Either String (Maybe ResponseDetails)
-> Either
     String
     (Maybe Text
      -> Maybe Type
      -> Maybe POSIX
      -> Maybe [JobError]
      -> Int
      -> CreateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ResponseDetails)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Details")
            Either
  String
  (Maybe Text
   -> Maybe Type
   -> Maybe POSIX
   -> Maybe [JobError]
   -> Int
   -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Type
      -> Maybe POSIX -> Maybe [JobError] -> Int -> CreateJobResponse)
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
  (Maybe Type
   -> Maybe POSIX -> Maybe [JobError] -> Int -> CreateJobResponse)
-> Either String (Maybe Type)
-> Either
     String
     (Maybe POSIX -> Maybe [JobError] -> Int -> CreateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Type)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Type")
            Either
  String
  (Maybe POSIX -> Maybe [JobError] -> Int -> CreateJobResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe [JobError] -> Int -> CreateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UpdatedAt")
            Either String (Maybe [JobError] -> Int -> CreateJobResponse)
-> Either String (Maybe [JobError])
-> Either String (Int -> CreateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [JobError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe (Maybe [JobError]))
-> Maybe [JobError] -> Either String (Maybe [JobError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [JobError]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateJobResponse)
-> Either String Int -> Either String CreateJobResponse
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 CreateJob

instance Prelude.NFData CreateJob

instance Core.ToHeaders CreateJob where
  toHeaders :: CreateJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateJob -> 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 CreateJob where
  toJSON :: CreateJob -> Value
toJSON CreateJob' {RequestDetails
Type
details :: RequestDetails
type' :: Type
$sel:details:CreateJob' :: CreateJob -> RequestDetails
$sel:type':CreateJob' :: CreateJob -> Type
..} =
    [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
"Type" Text -> Type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Type
type'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Details" Text -> RequestDetails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RequestDetails
details)
          ]
      )

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

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

-- | /See:/ 'newCreateJobResponse' smart constructor.
data CreateJobResponse = CreateJobResponse'
  { -- | The state of the job.
    CreateJobResponse -> Maybe State
state :: Prelude.Maybe State,
    -- | The ARN for the job.
    CreateJobResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the job was created, in ISO 8601 format.
    CreateJobResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Details about the job.
    CreateJobResponse -> Maybe ResponseDetails
details :: Prelude.Maybe ResponseDetails,
    -- | The unique identifier for the job.
    CreateJobResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The job type.
    CreateJobResponse -> Maybe Type
type' :: Prelude.Maybe Type,
    -- | The date and time that the job was last updated, in ISO 8601 format.
    CreateJobResponse -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | The errors associated with jobs.
    CreateJobResponse -> Maybe [JobError]
errors :: Prelude.Maybe [JobError],
    -- | The response's http status code.
    CreateJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateJobResponse -> CreateJobResponse -> Bool
(CreateJobResponse -> CreateJobResponse -> Bool)
-> (CreateJobResponse -> CreateJobResponse -> Bool)
-> Eq CreateJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobResponse -> CreateJobResponse -> Bool
$c/= :: CreateJobResponse -> CreateJobResponse -> Bool
== :: CreateJobResponse -> CreateJobResponse -> Bool
$c== :: CreateJobResponse -> CreateJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateJobResponse]
ReadPrec CreateJobResponse
Int -> ReadS CreateJobResponse
ReadS [CreateJobResponse]
(Int -> ReadS CreateJobResponse)
-> ReadS [CreateJobResponse]
-> ReadPrec CreateJobResponse
-> ReadPrec [CreateJobResponse]
-> Read CreateJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobResponse]
$creadListPrec :: ReadPrec [CreateJobResponse]
readPrec :: ReadPrec CreateJobResponse
$creadPrec :: ReadPrec CreateJobResponse
readList :: ReadS [CreateJobResponse]
$creadList :: ReadS [CreateJobResponse]
readsPrec :: Int -> ReadS CreateJobResponse
$creadsPrec :: Int -> ReadS CreateJobResponse
Prelude.Read, Int -> CreateJobResponse -> ShowS
[CreateJobResponse] -> ShowS
CreateJobResponse -> String
(Int -> CreateJobResponse -> ShowS)
-> (CreateJobResponse -> String)
-> ([CreateJobResponse] -> ShowS)
-> Show CreateJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobResponse] -> ShowS
$cshowList :: [CreateJobResponse] -> ShowS
show :: CreateJobResponse -> String
$cshow :: CreateJobResponse -> String
showsPrec :: Int -> CreateJobResponse -> ShowS
$cshowsPrec :: Int -> CreateJobResponse -> ShowS
Prelude.Show, (forall x. CreateJobResponse -> Rep CreateJobResponse x)
-> (forall x. Rep CreateJobResponse x -> CreateJobResponse)
-> Generic CreateJobResponse
forall x. Rep CreateJobResponse x -> CreateJobResponse
forall x. CreateJobResponse -> Rep CreateJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJobResponse x -> CreateJobResponse
$cfrom :: forall x. CreateJobResponse -> Rep CreateJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateJobResponse' 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:
--
-- 'state', 'createJobResponse_state' - The state of the job.
--
-- 'arn', 'createJobResponse_arn' - The ARN for the job.
--
-- 'createdAt', 'createJobResponse_createdAt' - The date and time that the job was created, in ISO 8601 format.
--
-- 'details', 'createJobResponse_details' - Details about the job.
--
-- 'id', 'createJobResponse_id' - The unique identifier for the job.
--
-- 'type'', 'createJobResponse_type' - The job type.
--
-- 'updatedAt', 'createJobResponse_updatedAt' - The date and time that the job was last updated, in ISO 8601 format.
--
-- 'errors', 'createJobResponse_errors' - The errors associated with jobs.
--
-- 'httpStatus', 'createJobResponse_httpStatus' - The response's http status code.
newCreateJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateJobResponse
newCreateJobResponse :: Int -> CreateJobResponse
newCreateJobResponse Int
pHttpStatus_ =
  CreateJobResponse' :: Maybe State
-> Maybe Text
-> Maybe POSIX
-> Maybe ResponseDetails
-> Maybe Text
-> Maybe Type
-> Maybe POSIX
-> Maybe [JobError]
-> Int
-> CreateJobResponse
CreateJobResponse'
    { $sel:state:CreateJobResponse' :: Maybe State
state = Maybe State
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateJobResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CreateJobResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:details:CreateJobResponse' :: Maybe ResponseDetails
details = Maybe ResponseDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateJobResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':CreateJobResponse' :: Maybe Type
type' = Maybe Type
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:CreateJobResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:errors:CreateJobResponse' :: Maybe [JobError]
errors = Maybe [JobError]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The state of the job.
createJobResponse_state :: Lens.Lens' CreateJobResponse (Prelude.Maybe State)
createJobResponse_state :: (Maybe State -> f (Maybe State))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_state = (CreateJobResponse -> Maybe State)
-> (CreateJobResponse -> Maybe State -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe State) (Maybe State)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe State
state :: Maybe State
$sel:state:CreateJobResponse' :: CreateJobResponse -> Maybe State
state} -> Maybe State
state) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe State
a -> CreateJobResponse
s {$sel:state:CreateJobResponse' :: Maybe State
state = Maybe State
a} :: CreateJobResponse)

-- | The ARN for the job.
createJobResponse_arn :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.Text)
createJobResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_arn = (CreateJobResponse -> Maybe Text)
-> (CreateJobResponse -> Maybe Text -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateJobResponse' :: CreateJobResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Text
a -> CreateJobResponse
s {$sel:arn:CreateJobResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateJobResponse)

-- | The date and time that the job was created, in ISO 8601 format.
createJobResponse_createdAt :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.UTCTime)
createJobResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_createdAt = (CreateJobResponse -> Maybe POSIX)
-> (CreateJobResponse -> Maybe POSIX -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:CreateJobResponse' :: CreateJobResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe POSIX
a -> CreateJobResponse
s {$sel:createdAt:CreateJobResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: CreateJobResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateJobResponse -> f CreateJobResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateJobResponse
-> f CreateJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Details about the job.
createJobResponse_details :: Lens.Lens' CreateJobResponse (Prelude.Maybe ResponseDetails)
createJobResponse_details :: (Maybe ResponseDetails -> f (Maybe ResponseDetails))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_details = (CreateJobResponse -> Maybe ResponseDetails)
-> (CreateJobResponse
    -> Maybe ResponseDetails -> CreateJobResponse)
-> Lens
     CreateJobResponse
     CreateJobResponse
     (Maybe ResponseDetails)
     (Maybe ResponseDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe ResponseDetails
details :: Maybe ResponseDetails
$sel:details:CreateJobResponse' :: CreateJobResponse -> Maybe ResponseDetails
details} -> Maybe ResponseDetails
details) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe ResponseDetails
a -> CreateJobResponse
s {$sel:details:CreateJobResponse' :: Maybe ResponseDetails
details = Maybe ResponseDetails
a} :: CreateJobResponse)

-- | The unique identifier for the job.
createJobResponse_id :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.Text)
createJobResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_id = (CreateJobResponse -> Maybe Text)
-> (CreateJobResponse -> Maybe Text -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateJobResponse' :: CreateJobResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Text
a -> CreateJobResponse
s {$sel:id:CreateJobResponse' :: Maybe Text
id = Maybe Text
a} :: CreateJobResponse)

-- | The job type.
createJobResponse_type :: Lens.Lens' CreateJobResponse (Prelude.Maybe Type)
createJobResponse_type :: (Maybe Type -> f (Maybe Type))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_type = (CreateJobResponse -> Maybe Type)
-> (CreateJobResponse -> Maybe Type -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe Type) (Maybe Type)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Type
type' :: Maybe Type
$sel:type':CreateJobResponse' :: CreateJobResponse -> Maybe Type
type'} -> Maybe Type
type') (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Type
a -> CreateJobResponse
s {$sel:type':CreateJobResponse' :: Maybe Type
type' = Maybe Type
a} :: CreateJobResponse)

-- | The date and time that the job was last updated, in ISO 8601 format.
createJobResponse_updatedAt :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.UTCTime)
createJobResponse_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_updatedAt = (CreateJobResponse -> Maybe POSIX)
-> (CreateJobResponse -> Maybe POSIX -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:CreateJobResponse' :: CreateJobResponse -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe POSIX
a -> CreateJobResponse
s {$sel:updatedAt:CreateJobResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: CreateJobResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateJobResponse -> f CreateJobResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateJobResponse
-> f CreateJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The errors associated with jobs.
createJobResponse_errors :: Lens.Lens' CreateJobResponse (Prelude.Maybe [JobError])
createJobResponse_errors :: (Maybe [JobError] -> f (Maybe [JobError]))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_errors = (CreateJobResponse -> Maybe [JobError])
-> (CreateJobResponse -> Maybe [JobError] -> CreateJobResponse)
-> Lens
     CreateJobResponse
     CreateJobResponse
     (Maybe [JobError])
     (Maybe [JobError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe [JobError]
errors :: Maybe [JobError]
$sel:errors:CreateJobResponse' :: CreateJobResponse -> Maybe [JobError]
errors} -> Maybe [JobError]
errors) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe [JobError]
a -> CreateJobResponse
s {$sel:errors:CreateJobResponse' :: Maybe [JobError]
errors = Maybe [JobError]
a} :: CreateJobResponse) ((Maybe [JobError] -> f (Maybe [JobError]))
 -> CreateJobResponse -> f CreateJobResponse)
-> ((Maybe [JobError] -> f (Maybe [JobError]))
    -> Maybe [JobError] -> f (Maybe [JobError]))
-> (Maybe [JobError] -> f (Maybe [JobError]))
-> CreateJobResponse
-> f CreateJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [JobError] [JobError] [JobError] [JobError]
-> Iso
     (Maybe [JobError])
     (Maybe [JobError])
     (Maybe [JobError])
     (Maybe [JobError])
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 [JobError] [JobError] [JobError] [JobError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateJobResponse