{-# 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.Glacier.InitiateJob
-- 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 initiates a job of the specified type, which can be a
-- select, an archival retrieval, or a vault retrieval. For more
-- information about using this operation, see the documentation for the
-- underlying REST API
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html Initiate a Job>.
module Amazonka.Glacier.InitiateJob
  ( -- * Creating a Request
    InitiateJob (..),
    newInitiateJob,

    -- * Request Lenses
    initiateJob_jobParameters,
    initiateJob_accountId,
    initiateJob_vaultName,

    -- * Destructuring the Response
    InitiateJobResponse (..),
    newInitiateJobResponse,

    -- * Response Lenses
    initiateJobResponse_jobId,
    initiateJobResponse_jobOutputPath,
    initiateJobResponse_location,
    initiateJobResponse_httpStatus,
  )
where

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

-- | Provides options for initiating an Amazon S3 Glacier job.
--
-- /See:/ 'newInitiateJob' smart constructor.
data InitiateJob = InitiateJob'
  { -- | Provides options for specifying job information.
    InitiateJob -> Maybe JobParameters
jobParameters :: Prelude.Maybe JobParameters,
    -- | The @AccountId@ value is the AWS account ID of the account that owns the
    -- vault. You can either specify an AWS account ID or optionally a single
    -- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
    -- ID associated with the credentials used to sign the request. If you use
    -- an account ID, do not include any hyphens (\'-\') in the ID.
    InitiateJob -> Text
accountId :: Prelude.Text,
    -- | The name of the vault.
    InitiateJob -> Text
vaultName :: Prelude.Text
  }
  deriving (InitiateJob -> InitiateJob -> Bool
(InitiateJob -> InitiateJob -> Bool)
-> (InitiateJob -> InitiateJob -> Bool) -> Eq InitiateJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InitiateJob -> InitiateJob -> Bool
$c/= :: InitiateJob -> InitiateJob -> Bool
== :: InitiateJob -> InitiateJob -> Bool
$c== :: InitiateJob -> InitiateJob -> Bool
Prelude.Eq, ReadPrec [InitiateJob]
ReadPrec InitiateJob
Int -> ReadS InitiateJob
ReadS [InitiateJob]
(Int -> ReadS InitiateJob)
-> ReadS [InitiateJob]
-> ReadPrec InitiateJob
-> ReadPrec [InitiateJob]
-> Read InitiateJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InitiateJob]
$creadListPrec :: ReadPrec [InitiateJob]
readPrec :: ReadPrec InitiateJob
$creadPrec :: ReadPrec InitiateJob
readList :: ReadS [InitiateJob]
$creadList :: ReadS [InitiateJob]
readsPrec :: Int -> ReadS InitiateJob
$creadsPrec :: Int -> ReadS InitiateJob
Prelude.Read, Int -> InitiateJob -> ShowS
[InitiateJob] -> ShowS
InitiateJob -> String
(Int -> InitiateJob -> ShowS)
-> (InitiateJob -> String)
-> ([InitiateJob] -> ShowS)
-> Show InitiateJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InitiateJob] -> ShowS
$cshowList :: [InitiateJob] -> ShowS
show :: InitiateJob -> String
$cshow :: InitiateJob -> String
showsPrec :: Int -> InitiateJob -> ShowS
$cshowsPrec :: Int -> InitiateJob -> ShowS
Prelude.Show, (forall x. InitiateJob -> Rep InitiateJob x)
-> (forall x. Rep InitiateJob x -> InitiateJob)
-> Generic InitiateJob
forall x. Rep InitiateJob x -> InitiateJob
forall x. InitiateJob -> Rep InitiateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InitiateJob x -> InitiateJob
$cfrom :: forall x. InitiateJob -> Rep InitiateJob x
Prelude.Generic)

-- |
-- Create a value of 'InitiateJob' 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:
--
-- 'jobParameters', 'initiateJob_jobParameters' - Provides options for specifying job information.
--
-- 'accountId', 'initiateJob_accountId' - The @AccountId@ value is the AWS account ID of the account that owns the
-- vault. You can either specify an AWS account ID or optionally a single
-- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
-- ID associated with the credentials used to sign the request. If you use
-- an account ID, do not include any hyphens (\'-\') in the ID.
--
-- 'vaultName', 'initiateJob_vaultName' - The name of the vault.
newInitiateJob ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'vaultName'
  Prelude.Text ->
  InitiateJob
newInitiateJob :: Text -> Text -> InitiateJob
newInitiateJob Text
pAccountId_ Text
pVaultName_ =
  InitiateJob' :: Maybe JobParameters -> Text -> Text -> InitiateJob
InitiateJob'
    { $sel:jobParameters:InitiateJob' :: Maybe JobParameters
jobParameters = Maybe JobParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:InitiateJob' :: Text
accountId = Text
pAccountId_,
      $sel:vaultName:InitiateJob' :: Text
vaultName = Text
pVaultName_
    }

-- | Provides options for specifying job information.
initiateJob_jobParameters :: Lens.Lens' InitiateJob (Prelude.Maybe JobParameters)
initiateJob_jobParameters :: (Maybe JobParameters -> f (Maybe JobParameters))
-> InitiateJob -> f InitiateJob
initiateJob_jobParameters = (InitiateJob -> Maybe JobParameters)
-> (InitiateJob -> Maybe JobParameters -> InitiateJob)
-> Lens
     InitiateJob InitiateJob (Maybe JobParameters) (Maybe JobParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateJob' {Maybe JobParameters
jobParameters :: Maybe JobParameters
$sel:jobParameters:InitiateJob' :: InitiateJob -> Maybe JobParameters
jobParameters} -> Maybe JobParameters
jobParameters) (\s :: InitiateJob
s@InitiateJob' {} Maybe JobParameters
a -> InitiateJob
s {$sel:jobParameters:InitiateJob' :: Maybe JobParameters
jobParameters = Maybe JobParameters
a} :: InitiateJob)

-- | The @AccountId@ value is the AWS account ID of the account that owns the
-- vault. You can either specify an AWS account ID or optionally a single
-- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
-- ID associated with the credentials used to sign the request. If you use
-- an account ID, do not include any hyphens (\'-\') in the ID.
initiateJob_accountId :: Lens.Lens' InitiateJob Prelude.Text
initiateJob_accountId :: (Text -> f Text) -> InitiateJob -> f InitiateJob
initiateJob_accountId = (InitiateJob -> Text)
-> (InitiateJob -> Text -> InitiateJob)
-> Lens InitiateJob InitiateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateJob' {Text
accountId :: Text
$sel:accountId:InitiateJob' :: InitiateJob -> Text
accountId} -> Text
accountId) (\s :: InitiateJob
s@InitiateJob' {} Text
a -> InitiateJob
s {$sel:accountId:InitiateJob' :: Text
accountId = Text
a} :: InitiateJob)

-- | The name of the vault.
initiateJob_vaultName :: Lens.Lens' InitiateJob Prelude.Text
initiateJob_vaultName :: (Text -> f Text) -> InitiateJob -> f InitiateJob
initiateJob_vaultName = (InitiateJob -> Text)
-> (InitiateJob -> Text -> InitiateJob)
-> Lens InitiateJob InitiateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateJob' {Text
vaultName :: Text
$sel:vaultName:InitiateJob' :: InitiateJob -> Text
vaultName} -> Text
vaultName) (\s :: InitiateJob
s@InitiateJob' {} Text
a -> InitiateJob
s {$sel:vaultName:InitiateJob' :: Text
vaultName = Text
a} :: InitiateJob)

instance Core.AWSRequest InitiateJob where
  type AWSResponse InitiateJob = InitiateJobResponse
  request :: InitiateJob -> Request InitiateJob
request =
    ByteString -> Request InitiateJob -> Request InitiateJob
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
      (Request InitiateJob -> Request InitiateJob)
-> (InitiateJob -> Request InitiateJob)
-> InitiateJob
-> Request InitiateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> InitiateJob -> Request InitiateJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy InitiateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse InitiateJob)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse InitiateJob))
-> Logger
-> Service
-> Proxy InitiateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse InitiateJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Int -> InitiateJobResponse
InitiateJobResponse'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Int -> InitiateJobResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> InitiateJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-job-id")
            Either
  String (Maybe Text -> Maybe Text -> Int -> InitiateJobResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> InitiateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-job-output-path")
            Either String (Maybe Text -> Int -> InitiateJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> InitiateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Location")
            Either String (Int -> InitiateJobResponse)
-> Either String Int -> Either String InitiateJobResponse
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 InitiateJob

instance Prelude.NFData InitiateJob

instance Core.ToHeaders InitiateJob where
  toHeaders :: InitiateJob -> ResponseHeaders
toHeaders = ResponseHeaders -> InitiateJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON InitiateJob where
  toJSON :: InitiateJob -> Value
toJSON InitiateJob' {Maybe JobParameters
Text
vaultName :: Text
accountId :: Text
jobParameters :: Maybe JobParameters
$sel:vaultName:InitiateJob' :: InitiateJob -> Text
$sel:accountId:InitiateJob' :: InitiateJob -> Text
$sel:jobParameters:InitiateJob' :: InitiateJob -> Maybe JobParameters
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"jobParameters" Text -> JobParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (JobParameters -> Pair) -> Maybe JobParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobParameters
jobParameters
          ]
      )

instance Core.ToPath InitiateJob where
  toPath :: InitiateJob -> ByteString
toPath InitiateJob' {Maybe JobParameters
Text
vaultName :: Text
accountId :: Text
jobParameters :: Maybe JobParameters
$sel:vaultName:InitiateJob' :: InitiateJob -> Text
$sel:accountId:InitiateJob' :: InitiateJob -> Text
$sel:jobParameters:InitiateJob' :: InitiateJob -> Maybe JobParameters
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
        ByteString
"/vaults/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
vaultName,
        ByteString
"/jobs"
      ]

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

-- | Contains the Amazon S3 Glacier response to your request.
--
-- /See:/ 'newInitiateJobResponse' smart constructor.
data InitiateJobResponse = InitiateJobResponse'
  { -- | The ID of the job.
    InitiateJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The path to the location of where the select results are stored.
    InitiateJobResponse -> Maybe Text
jobOutputPath :: Prelude.Maybe Prelude.Text,
    -- | The relative URI path of the job.
    InitiateJobResponse -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    InitiateJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (InitiateJobResponse -> InitiateJobResponse -> Bool
(InitiateJobResponse -> InitiateJobResponse -> Bool)
-> (InitiateJobResponse -> InitiateJobResponse -> Bool)
-> Eq InitiateJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InitiateJobResponse -> InitiateJobResponse -> Bool
$c/= :: InitiateJobResponse -> InitiateJobResponse -> Bool
== :: InitiateJobResponse -> InitiateJobResponse -> Bool
$c== :: InitiateJobResponse -> InitiateJobResponse -> Bool
Prelude.Eq, ReadPrec [InitiateJobResponse]
ReadPrec InitiateJobResponse
Int -> ReadS InitiateJobResponse
ReadS [InitiateJobResponse]
(Int -> ReadS InitiateJobResponse)
-> ReadS [InitiateJobResponse]
-> ReadPrec InitiateJobResponse
-> ReadPrec [InitiateJobResponse]
-> Read InitiateJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InitiateJobResponse]
$creadListPrec :: ReadPrec [InitiateJobResponse]
readPrec :: ReadPrec InitiateJobResponse
$creadPrec :: ReadPrec InitiateJobResponse
readList :: ReadS [InitiateJobResponse]
$creadList :: ReadS [InitiateJobResponse]
readsPrec :: Int -> ReadS InitiateJobResponse
$creadsPrec :: Int -> ReadS InitiateJobResponse
Prelude.Read, Int -> InitiateJobResponse -> ShowS
[InitiateJobResponse] -> ShowS
InitiateJobResponse -> String
(Int -> InitiateJobResponse -> ShowS)
-> (InitiateJobResponse -> String)
-> ([InitiateJobResponse] -> ShowS)
-> Show InitiateJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InitiateJobResponse] -> ShowS
$cshowList :: [InitiateJobResponse] -> ShowS
show :: InitiateJobResponse -> String
$cshow :: InitiateJobResponse -> String
showsPrec :: Int -> InitiateJobResponse -> ShowS
$cshowsPrec :: Int -> InitiateJobResponse -> ShowS
Prelude.Show, (forall x. InitiateJobResponse -> Rep InitiateJobResponse x)
-> (forall x. Rep InitiateJobResponse x -> InitiateJobResponse)
-> Generic InitiateJobResponse
forall x. Rep InitiateJobResponse x -> InitiateJobResponse
forall x. InitiateJobResponse -> Rep InitiateJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InitiateJobResponse x -> InitiateJobResponse
$cfrom :: forall x. InitiateJobResponse -> Rep InitiateJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'InitiateJobResponse' 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:
--
-- 'jobId', 'initiateJobResponse_jobId' - The ID of the job.
--
-- 'jobOutputPath', 'initiateJobResponse_jobOutputPath' - The path to the location of where the select results are stored.
--
-- 'location', 'initiateJobResponse_location' - The relative URI path of the job.
--
-- 'httpStatus', 'initiateJobResponse_httpStatus' - The response's http status code.
newInitiateJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  InitiateJobResponse
newInitiateJobResponse :: Int -> InitiateJobResponse
newInitiateJobResponse Int
pHttpStatus_ =
  InitiateJobResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> InitiateJobResponse
InitiateJobResponse'
    { $sel:jobId:InitiateJobResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobOutputPath:InitiateJobResponse' :: Maybe Text
jobOutputPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:InitiateJobResponse' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:InitiateJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the job.
initiateJobResponse_jobId :: Lens.Lens' InitiateJobResponse (Prelude.Maybe Prelude.Text)
initiateJobResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> InitiateJobResponse -> f InitiateJobResponse
initiateJobResponse_jobId = (InitiateJobResponse -> Maybe Text)
-> (InitiateJobResponse -> Maybe Text -> InitiateJobResponse)
-> Lens
     InitiateJobResponse InitiateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:InitiateJobResponse' :: InitiateJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: InitiateJobResponse
s@InitiateJobResponse' {} Maybe Text
a -> InitiateJobResponse
s {$sel:jobId:InitiateJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: InitiateJobResponse)

-- | The path to the location of where the select results are stored.
initiateJobResponse_jobOutputPath :: Lens.Lens' InitiateJobResponse (Prelude.Maybe Prelude.Text)
initiateJobResponse_jobOutputPath :: (Maybe Text -> f (Maybe Text))
-> InitiateJobResponse -> f InitiateJobResponse
initiateJobResponse_jobOutputPath = (InitiateJobResponse -> Maybe Text)
-> (InitiateJobResponse -> Maybe Text -> InitiateJobResponse)
-> Lens
     InitiateJobResponse InitiateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateJobResponse' {Maybe Text
jobOutputPath :: Maybe Text
$sel:jobOutputPath:InitiateJobResponse' :: InitiateJobResponse -> Maybe Text
jobOutputPath} -> Maybe Text
jobOutputPath) (\s :: InitiateJobResponse
s@InitiateJobResponse' {} Maybe Text
a -> InitiateJobResponse
s {$sel:jobOutputPath:InitiateJobResponse' :: Maybe Text
jobOutputPath = Maybe Text
a} :: InitiateJobResponse)

-- | The relative URI path of the job.
initiateJobResponse_location :: Lens.Lens' InitiateJobResponse (Prelude.Maybe Prelude.Text)
initiateJobResponse_location :: (Maybe Text -> f (Maybe Text))
-> InitiateJobResponse -> f InitiateJobResponse
initiateJobResponse_location = (InitiateJobResponse -> Maybe Text)
-> (InitiateJobResponse -> Maybe Text -> InitiateJobResponse)
-> Lens
     InitiateJobResponse InitiateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InitiateJobResponse' {Maybe Text
location :: Maybe Text
$sel:location:InitiateJobResponse' :: InitiateJobResponse -> Maybe Text
location} -> Maybe Text
location) (\s :: InitiateJobResponse
s@InitiateJobResponse' {} Maybe Text
a -> InitiateJobResponse
s {$sel:location:InitiateJobResponse' :: Maybe Text
location = Maybe Text
a} :: InitiateJobResponse)

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

instance Prelude.NFData InitiateJobResponse