{-# 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.Snowball.UpdateJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- While a job\'s @JobState@ value is @New@, you can update some of the
-- information associated with a job. Once the job changes to a different
-- job state, usually within 60 minutes of the job being created, this
-- action is no longer available.
module Amazonka.Snowball.UpdateJob
  ( -- * Creating a Request
    UpdateJob (..),
    newUpdateJob,

    -- * Request Lenses
    updateJob_addressId,
    updateJob_description,
    updateJob_forwardingAddressId,
    updateJob_notification,
    updateJob_onDeviceServiceConfiguration,
    updateJob_resources,
    updateJob_roleARN,
    updateJob_shippingOption,
    updateJob_snowballCapacityPreference,
    updateJob_jobId,

    -- * Destructuring the Response
    UpdateJobResponse (..),
    newUpdateJobResponse,

    -- * Response Lenses
    updateJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Snowball.Types

-- | /See:/ 'newUpdateJob' smart constructor.
data UpdateJob = UpdateJob'
  { -- | The ID of the updated Address object.
    UpdateJob -> Maybe Text
addressId :: Prelude.Maybe Prelude.Text,
    -- | The updated description of this job\'s JobMetadata object.
    UpdateJob -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The updated ID for the forwarding address for a job. This field is not
    -- supported in most regions.
    UpdateJob -> Maybe Text
forwardingAddressId :: Prelude.Maybe Prelude.Text,
    -- | The new or updated Notification object.
    UpdateJob -> Maybe Notification
notification :: Prelude.Maybe Notification,
    -- | Specifies the service or services on the Snow Family device that your
    -- transferred data will be exported from or imported into. Amazon Web
    -- Services Snow Family supports Amazon S3 and NFS (Network File System)
    -- and the Amazon Web Services Storage Gateway service Tape Gateway type.
    UpdateJob -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration :: Prelude.Maybe OnDeviceServiceConfiguration,
    -- | The updated @JobResource@ object, or the updated JobResource object.
    UpdateJob -> Maybe JobResource
resources :: Prelude.Maybe JobResource,
    -- | The new role Amazon Resource Name (ARN) that you want to associate with
    -- this job. To create a role ARN, use the
    -- <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html CreateRole>Identity
    -- and Access Management (IAM) API action.
    UpdateJob -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The updated shipping option value of this job\'s ShippingDetails object.
    UpdateJob -> Maybe ShippingOption
shippingOption :: Prelude.Maybe ShippingOption,
    -- | The updated @SnowballCapacityPreference@ of this job\'s JobMetadata
    -- object. The 50 TB Snowballs are only available in the US regions.
    --
    -- For more information, see
    -- \"https:\/\/docs.aws.amazon.com\/snowball\/latest\/snowcone-guide\/snow-device-types.html\"
    -- (Snow Family Devices and Capacity) in the /Snowcone User Guide/ or
    -- \"https:\/\/docs.aws.amazon.com\/snowball\/latest\/developer-guide\/snow-device-types.html\"
    -- (Snow Family Devices and Capacity) in the /Snowcone User Guide/.
    UpdateJob -> Maybe SnowballCapacity
snowballCapacityPreference :: Prelude.Maybe SnowballCapacity,
    -- | The job ID of the job that you want to update, for example
    -- @JID123e4567-e89b-12d3-a456-426655440000@.
    UpdateJob -> Text
jobId :: Prelude.Text
  }
  deriving (UpdateJob -> UpdateJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateJob -> UpdateJob -> Bool
$c/= :: UpdateJob -> UpdateJob -> Bool
== :: UpdateJob -> UpdateJob -> Bool
$c== :: UpdateJob -> UpdateJob -> Bool
Prelude.Eq, ReadPrec [UpdateJob]
ReadPrec UpdateJob
Int -> ReadS UpdateJob
ReadS [UpdateJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateJob]
$creadListPrec :: ReadPrec [UpdateJob]
readPrec :: ReadPrec UpdateJob
$creadPrec :: ReadPrec UpdateJob
readList :: ReadS [UpdateJob]
$creadList :: ReadS [UpdateJob]
readsPrec :: Int -> ReadS UpdateJob
$creadsPrec :: Int -> ReadS UpdateJob
Prelude.Read, Int -> UpdateJob -> ShowS
[UpdateJob] -> ShowS
UpdateJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateJob] -> ShowS
$cshowList :: [UpdateJob] -> ShowS
show :: UpdateJob -> String
$cshow :: UpdateJob -> String
showsPrec :: Int -> UpdateJob -> ShowS
$cshowsPrec :: Int -> UpdateJob -> ShowS
Prelude.Show, forall x. Rep UpdateJob x -> UpdateJob
forall x. UpdateJob -> Rep UpdateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateJob x -> UpdateJob
$cfrom :: forall x. UpdateJob -> Rep UpdateJob x
Prelude.Generic)

-- |
-- Create a value of 'UpdateJob' 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:
--
-- 'addressId', 'updateJob_addressId' - The ID of the updated Address object.
--
-- 'description', 'updateJob_description' - The updated description of this job\'s JobMetadata object.
--
-- 'forwardingAddressId', 'updateJob_forwardingAddressId' - The updated ID for the forwarding address for a job. This field is not
-- supported in most regions.
--
-- 'notification', 'updateJob_notification' - The new or updated Notification object.
--
-- 'onDeviceServiceConfiguration', 'updateJob_onDeviceServiceConfiguration' - Specifies the service or services on the Snow Family device that your
-- transferred data will be exported from or imported into. Amazon Web
-- Services Snow Family supports Amazon S3 and NFS (Network File System)
-- and the Amazon Web Services Storage Gateway service Tape Gateway type.
--
-- 'resources', 'updateJob_resources' - The updated @JobResource@ object, or the updated JobResource object.
--
-- 'roleARN', 'updateJob_roleARN' - The new role Amazon Resource Name (ARN) that you want to associate with
-- this job. To create a role ARN, use the
-- <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html CreateRole>Identity
-- and Access Management (IAM) API action.
--
-- 'shippingOption', 'updateJob_shippingOption' - The updated shipping option value of this job\'s ShippingDetails object.
--
-- 'snowballCapacityPreference', 'updateJob_snowballCapacityPreference' - The updated @SnowballCapacityPreference@ of this job\'s JobMetadata
-- object. The 50 TB Snowballs are only available in the US regions.
--
-- For more information, see
-- \"https:\/\/docs.aws.amazon.com\/snowball\/latest\/snowcone-guide\/snow-device-types.html\"
-- (Snow Family Devices and Capacity) in the /Snowcone User Guide/ or
-- \"https:\/\/docs.aws.amazon.com\/snowball\/latest\/developer-guide\/snow-device-types.html\"
-- (Snow Family Devices and Capacity) in the /Snowcone User Guide/.
--
-- 'jobId', 'updateJob_jobId' - The job ID of the job that you want to update, for example
-- @JID123e4567-e89b-12d3-a456-426655440000@.
newUpdateJob ::
  -- | 'jobId'
  Prelude.Text ->
  UpdateJob
newUpdateJob :: Text -> UpdateJob
newUpdateJob Text
pJobId_ =
  UpdateJob'
    { $sel:addressId:UpdateJob' :: Maybe Text
addressId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateJob' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:forwardingAddressId:UpdateJob' :: Maybe Text
forwardingAddressId = forall a. Maybe a
Prelude.Nothing,
      $sel:notification:UpdateJob' :: Maybe Notification
notification = forall a. Maybe a
Prelude.Nothing,
      $sel:onDeviceServiceConfiguration:UpdateJob' :: Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:resources:UpdateJob' :: Maybe JobResource
resources = forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:UpdateJob' :: Maybe Text
roleARN = forall a. Maybe a
Prelude.Nothing,
      $sel:shippingOption:UpdateJob' :: Maybe ShippingOption
shippingOption = forall a. Maybe a
Prelude.Nothing,
      $sel:snowballCapacityPreference:UpdateJob' :: Maybe SnowballCapacity
snowballCapacityPreference = forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:UpdateJob' :: Text
jobId = Text
pJobId_
    }

-- | The ID of the updated Address object.
updateJob_addressId :: Lens.Lens' UpdateJob (Prelude.Maybe Prelude.Text)
updateJob_addressId :: Lens' UpdateJob (Maybe Text)
updateJob_addressId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe Text
addressId :: Maybe Text
$sel:addressId:UpdateJob' :: UpdateJob -> Maybe Text
addressId} -> Maybe Text
addressId) (\s :: UpdateJob
s@UpdateJob' {} Maybe Text
a -> UpdateJob
s {$sel:addressId:UpdateJob' :: Maybe Text
addressId = Maybe Text
a} :: UpdateJob)

-- | The updated description of this job\'s JobMetadata object.
updateJob_description :: Lens.Lens' UpdateJob (Prelude.Maybe Prelude.Text)
updateJob_description :: Lens' UpdateJob (Maybe Text)
updateJob_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe Text
description :: Maybe Text
$sel:description:UpdateJob' :: UpdateJob -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateJob
s@UpdateJob' {} Maybe Text
a -> UpdateJob
s {$sel:description:UpdateJob' :: Maybe Text
description = Maybe Text
a} :: UpdateJob)

-- | The updated ID for the forwarding address for a job. This field is not
-- supported in most regions.
updateJob_forwardingAddressId :: Lens.Lens' UpdateJob (Prelude.Maybe Prelude.Text)
updateJob_forwardingAddressId :: Lens' UpdateJob (Maybe Text)
updateJob_forwardingAddressId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe Text
forwardingAddressId :: Maybe Text
$sel:forwardingAddressId:UpdateJob' :: UpdateJob -> Maybe Text
forwardingAddressId} -> Maybe Text
forwardingAddressId) (\s :: UpdateJob
s@UpdateJob' {} Maybe Text
a -> UpdateJob
s {$sel:forwardingAddressId:UpdateJob' :: Maybe Text
forwardingAddressId = Maybe Text
a} :: UpdateJob)

-- | The new or updated Notification object.
updateJob_notification :: Lens.Lens' UpdateJob (Prelude.Maybe Notification)
updateJob_notification :: Lens' UpdateJob (Maybe Notification)
updateJob_notification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe Notification
notification :: Maybe Notification
$sel:notification:UpdateJob' :: UpdateJob -> Maybe Notification
notification} -> Maybe Notification
notification) (\s :: UpdateJob
s@UpdateJob' {} Maybe Notification
a -> UpdateJob
s {$sel:notification:UpdateJob' :: Maybe Notification
notification = Maybe Notification
a} :: UpdateJob)

-- | Specifies the service or services on the Snow Family device that your
-- transferred data will be exported from or imported into. Amazon Web
-- Services Snow Family supports Amazon S3 and NFS (Network File System)
-- and the Amazon Web Services Storage Gateway service Tape Gateway type.
updateJob_onDeviceServiceConfiguration :: Lens.Lens' UpdateJob (Prelude.Maybe OnDeviceServiceConfiguration)
updateJob_onDeviceServiceConfiguration :: Lens' UpdateJob (Maybe OnDeviceServiceConfiguration)
updateJob_onDeviceServiceConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
$sel:onDeviceServiceConfiguration:UpdateJob' :: UpdateJob -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration} -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration) (\s :: UpdateJob
s@UpdateJob' {} Maybe OnDeviceServiceConfiguration
a -> UpdateJob
s {$sel:onDeviceServiceConfiguration:UpdateJob' :: Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration = Maybe OnDeviceServiceConfiguration
a} :: UpdateJob)

-- | The updated @JobResource@ object, or the updated JobResource object.
updateJob_resources :: Lens.Lens' UpdateJob (Prelude.Maybe JobResource)
updateJob_resources :: Lens' UpdateJob (Maybe JobResource)
updateJob_resources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe JobResource
resources :: Maybe JobResource
$sel:resources:UpdateJob' :: UpdateJob -> Maybe JobResource
resources} -> Maybe JobResource
resources) (\s :: UpdateJob
s@UpdateJob' {} Maybe JobResource
a -> UpdateJob
s {$sel:resources:UpdateJob' :: Maybe JobResource
resources = Maybe JobResource
a} :: UpdateJob)

-- | The new role Amazon Resource Name (ARN) that you want to associate with
-- this job. To create a role ARN, use the
-- <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html CreateRole>Identity
-- and Access Management (IAM) API action.
updateJob_roleARN :: Lens.Lens' UpdateJob (Prelude.Maybe Prelude.Text)
updateJob_roleARN :: Lens' UpdateJob (Maybe Text)
updateJob_roleARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:UpdateJob' :: UpdateJob -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: UpdateJob
s@UpdateJob' {} Maybe Text
a -> UpdateJob
s {$sel:roleARN:UpdateJob' :: Maybe Text
roleARN = Maybe Text
a} :: UpdateJob)

-- | The updated shipping option value of this job\'s ShippingDetails object.
updateJob_shippingOption :: Lens.Lens' UpdateJob (Prelude.Maybe ShippingOption)
updateJob_shippingOption :: Lens' UpdateJob (Maybe ShippingOption)
updateJob_shippingOption = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe ShippingOption
shippingOption :: Maybe ShippingOption
$sel:shippingOption:UpdateJob' :: UpdateJob -> Maybe ShippingOption
shippingOption} -> Maybe ShippingOption
shippingOption) (\s :: UpdateJob
s@UpdateJob' {} Maybe ShippingOption
a -> UpdateJob
s {$sel:shippingOption:UpdateJob' :: Maybe ShippingOption
shippingOption = Maybe ShippingOption
a} :: UpdateJob)

-- | The updated @SnowballCapacityPreference@ of this job\'s JobMetadata
-- object. The 50 TB Snowballs are only available in the US regions.
--
-- For more information, see
-- \"https:\/\/docs.aws.amazon.com\/snowball\/latest\/snowcone-guide\/snow-device-types.html\"
-- (Snow Family Devices and Capacity) in the /Snowcone User Guide/ or
-- \"https:\/\/docs.aws.amazon.com\/snowball\/latest\/developer-guide\/snow-device-types.html\"
-- (Snow Family Devices and Capacity) in the /Snowcone User Guide/.
updateJob_snowballCapacityPreference :: Lens.Lens' UpdateJob (Prelude.Maybe SnowballCapacity)
updateJob_snowballCapacityPreference :: Lens' UpdateJob (Maybe SnowballCapacity)
updateJob_snowballCapacityPreference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Maybe SnowballCapacity
snowballCapacityPreference :: Maybe SnowballCapacity
$sel:snowballCapacityPreference:UpdateJob' :: UpdateJob -> Maybe SnowballCapacity
snowballCapacityPreference} -> Maybe SnowballCapacity
snowballCapacityPreference) (\s :: UpdateJob
s@UpdateJob' {} Maybe SnowballCapacity
a -> UpdateJob
s {$sel:snowballCapacityPreference:UpdateJob' :: Maybe SnowballCapacity
snowballCapacityPreference = Maybe SnowballCapacity
a} :: UpdateJob)

-- | The job ID of the job that you want to update, for example
-- @JID123e4567-e89b-12d3-a456-426655440000@.
updateJob_jobId :: Lens.Lens' UpdateJob Prelude.Text
updateJob_jobId :: Lens' UpdateJob Text
updateJob_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJob' {Text
jobId :: Text
$sel:jobId:UpdateJob' :: UpdateJob -> Text
jobId} -> Text
jobId) (\s :: UpdateJob
s@UpdateJob' {} Text
a -> UpdateJob
s {$sel:jobId:UpdateJob' :: Text
jobId = Text
a} :: UpdateJob)

instance Core.AWSRequest UpdateJob where
  type AWSResponse UpdateJob = UpdateJobResponse
  request :: (Service -> Service) -> UpdateJob -> Request UpdateJob
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateJob)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateJobResponse
UpdateJobResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateJob where
  hashWithSalt :: Int -> UpdateJob -> Int
hashWithSalt Int
_salt UpdateJob' {Maybe Text
Maybe Notification
Maybe ShippingOption
Maybe SnowballCapacity
Maybe OnDeviceServiceConfiguration
Maybe JobResource
Text
jobId :: Text
snowballCapacityPreference :: Maybe SnowballCapacity
shippingOption :: Maybe ShippingOption
roleARN :: Maybe Text
resources :: Maybe JobResource
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
notification :: Maybe Notification
forwardingAddressId :: Maybe Text
description :: Maybe Text
addressId :: Maybe Text
$sel:jobId:UpdateJob' :: UpdateJob -> Text
$sel:snowballCapacityPreference:UpdateJob' :: UpdateJob -> Maybe SnowballCapacity
$sel:shippingOption:UpdateJob' :: UpdateJob -> Maybe ShippingOption
$sel:roleARN:UpdateJob' :: UpdateJob -> Maybe Text
$sel:resources:UpdateJob' :: UpdateJob -> Maybe JobResource
$sel:onDeviceServiceConfiguration:UpdateJob' :: UpdateJob -> Maybe OnDeviceServiceConfiguration
$sel:notification:UpdateJob' :: UpdateJob -> Maybe Notification
$sel:forwardingAddressId:UpdateJob' :: UpdateJob -> Maybe Text
$sel:description:UpdateJob' :: UpdateJob -> Maybe Text
$sel:addressId:UpdateJob' :: UpdateJob -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
addressId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
forwardingAddressId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Notification
notification
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobResource
resources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ShippingOption
shippingOption
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SnowballCapacity
snowballCapacityPreference
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId

instance Prelude.NFData UpdateJob where
  rnf :: UpdateJob -> ()
rnf UpdateJob' {Maybe Text
Maybe Notification
Maybe ShippingOption
Maybe SnowballCapacity
Maybe OnDeviceServiceConfiguration
Maybe JobResource
Text
jobId :: Text
snowballCapacityPreference :: Maybe SnowballCapacity
shippingOption :: Maybe ShippingOption
roleARN :: Maybe Text
resources :: Maybe JobResource
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
notification :: Maybe Notification
forwardingAddressId :: Maybe Text
description :: Maybe Text
addressId :: Maybe Text
$sel:jobId:UpdateJob' :: UpdateJob -> Text
$sel:snowballCapacityPreference:UpdateJob' :: UpdateJob -> Maybe SnowballCapacity
$sel:shippingOption:UpdateJob' :: UpdateJob -> Maybe ShippingOption
$sel:roleARN:UpdateJob' :: UpdateJob -> Maybe Text
$sel:resources:UpdateJob' :: UpdateJob -> Maybe JobResource
$sel:onDeviceServiceConfiguration:UpdateJob' :: UpdateJob -> Maybe OnDeviceServiceConfiguration
$sel:notification:UpdateJob' :: UpdateJob -> Maybe Notification
$sel:forwardingAddressId:UpdateJob' :: UpdateJob -> Maybe Text
$sel:description:UpdateJob' :: UpdateJob -> Maybe Text
$sel:addressId:UpdateJob' :: UpdateJob -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
addressId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
forwardingAddressId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Notification
notification
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobResource
resources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ShippingOption
shippingOption
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SnowballCapacity
snowballCapacityPreference
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId

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

instance Data.ToJSON UpdateJob where
  toJSON :: UpdateJob -> Value
toJSON UpdateJob' {Maybe Text
Maybe Notification
Maybe ShippingOption
Maybe SnowballCapacity
Maybe OnDeviceServiceConfiguration
Maybe JobResource
Text
jobId :: Text
snowballCapacityPreference :: Maybe SnowballCapacity
shippingOption :: Maybe ShippingOption
roleARN :: Maybe Text
resources :: Maybe JobResource
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
notification :: Maybe Notification
forwardingAddressId :: Maybe Text
description :: Maybe Text
addressId :: Maybe Text
$sel:jobId:UpdateJob' :: UpdateJob -> Text
$sel:snowballCapacityPreference:UpdateJob' :: UpdateJob -> Maybe SnowballCapacity
$sel:shippingOption:UpdateJob' :: UpdateJob -> Maybe ShippingOption
$sel:roleARN:UpdateJob' :: UpdateJob -> Maybe Text
$sel:resources:UpdateJob' :: UpdateJob -> Maybe JobResource
$sel:onDeviceServiceConfiguration:UpdateJob' :: UpdateJob -> Maybe OnDeviceServiceConfiguration
$sel:notification:UpdateJob' :: UpdateJob -> Maybe Notification
$sel:forwardingAddressId:UpdateJob' :: UpdateJob -> Maybe Text
$sel:description:UpdateJob' :: UpdateJob -> Maybe Text
$sel:addressId:UpdateJob' :: UpdateJob -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AddressId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
addressId,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"ForwardingAddressId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
forwardingAddressId,
            (Key
"Notification" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Notification
notification,
            (Key
"OnDeviceServiceConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration,
            (Key
"Resources" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobResource
resources,
            (Key
"RoleARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleARN,
            (Key
"ShippingOption" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ShippingOption
shippingOption,
            (Key
"SnowballCapacityPreference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SnowballCapacity
snowballCapacityPreference,
            forall a. a -> Maybe a
Prelude.Just (Key
"JobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateJobResponse' 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:
--
-- 'httpStatus', 'updateJobResponse_httpStatus' - The response's http status code.
newUpdateJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateJobResponse
newUpdateJobResponse :: Int -> UpdateJobResponse
newUpdateJobResponse Int
pHttpStatus_ =
  UpdateJobResponse' {$sel:httpStatus:UpdateJobResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData UpdateJobResponse where
  rnf :: UpdateJobResponse -> ()
rnf UpdateJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateJobResponse' :: UpdateJobResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus