{-# 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-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)
--
-- 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_notification,
    updateJob_forwardingAddressId,
    updateJob_addressId,
    updateJob_shippingOption,
    updateJob_resources,
    updateJob_onDeviceServiceConfiguration,
    updateJob_description,
    updateJob_roleARN,
    updateJob_snowballCapacityPreference,
    updateJob_jobId,

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

    -- * Response Lenses
    updateJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 new or updated Notification object.
    UpdateJob -> Maybe Notification
notification :: Prelude.Maybe Notification,
    -- | 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 ID of the updated Address object.
    UpdateJob -> Maybe Text
addressId :: Prelude.Maybe Prelude.Text,
    -- | The updated shipping option value of this job\'s ShippingDetails object.
    UpdateJob -> Maybe ShippingOption
shippingOption :: Prelude.Maybe ShippingOption,
    -- | The updated @JobResource@ object, or the updated JobResource object.
    UpdateJob -> Maybe JobResource
resources :: Prelude.Maybe JobResource,
    -- | Specifies the service or services on the Snow Family device that your
    -- transferred data will be exported from or imported into. AWS Snow Family
    -- supports Amazon S3 and NFS (Network File System).
    UpdateJob -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration :: Prelude.Maybe OnDeviceServiceConfiguration,
    -- | The updated description of this job\'s JobMetadata object.
    UpdateJob -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | 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>AWS
    -- Identity and Access Management (IAM) API action.
    UpdateJob -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | 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
(UpdateJob -> UpdateJob -> Bool)
-> (UpdateJob -> UpdateJob -> Bool) -> Eq UpdateJob
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]
(Int -> ReadS UpdateJob)
-> ReadS [UpdateJob]
-> ReadPrec UpdateJob
-> ReadPrec [UpdateJob]
-> Read 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
(Int -> UpdateJob -> ShowS)
-> (UpdateJob -> String)
-> ([UpdateJob] -> ShowS)
-> Show UpdateJob
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. UpdateJob -> Rep UpdateJob x)
-> (forall x. Rep UpdateJob x -> UpdateJob) -> Generic UpdateJob
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:
--
-- 'notification', 'updateJob_notification' - The new or updated Notification object.
--
-- 'forwardingAddressId', 'updateJob_forwardingAddressId' - The updated ID for the forwarding address for a job. This field is not
-- supported in most regions.
--
-- 'addressId', 'updateJob_addressId' - The ID of the updated Address object.
--
-- 'shippingOption', 'updateJob_shippingOption' - The updated shipping option value of this job\'s ShippingDetails object.
--
-- 'resources', 'updateJob_resources' - The updated @JobResource@ object, or the updated JobResource 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. AWS Snow Family
-- supports Amazon S3 and NFS (Network File System).
--
-- 'description', 'updateJob_description' - The updated description of this job\'s JobMetadata 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>AWS
-- Identity and Access Management (IAM) API action.
--
-- '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' :: Maybe Notification
-> Maybe Text
-> Maybe Text
-> Maybe ShippingOption
-> Maybe JobResource
-> Maybe OnDeviceServiceConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe SnowballCapacity
-> Text
-> UpdateJob
UpdateJob'
    { $sel:notification:UpdateJob' :: Maybe Notification
notification = Maybe Notification
forall a. Maybe a
Prelude.Nothing,
      $sel:forwardingAddressId:UpdateJob' :: Maybe Text
forwardingAddressId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:addressId:UpdateJob' :: Maybe Text
addressId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shippingOption:UpdateJob' :: Maybe ShippingOption
shippingOption = Maybe ShippingOption
forall a. Maybe a
Prelude.Nothing,
      $sel:resources:UpdateJob' :: Maybe JobResource
resources = Maybe JobResource
forall a. Maybe a
Prelude.Nothing,
      $sel:onDeviceServiceConfiguration:UpdateJob' :: Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration = Maybe OnDeviceServiceConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateJob' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:UpdateJob' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snowballCapacityPreference:UpdateJob' :: Maybe SnowballCapacity
snowballCapacityPreference = Maybe SnowballCapacity
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:UpdateJob' :: Text
jobId = Text
pJobId_
    }

-- | The new or updated Notification object.
updateJob_notification :: Lens.Lens' UpdateJob (Prelude.Maybe Notification)
updateJob_notification :: (Maybe Notification -> f (Maybe Notification))
-> UpdateJob -> f UpdateJob
updateJob_notification = (UpdateJob -> Maybe Notification)
-> (UpdateJob -> Maybe Notification -> UpdateJob)
-> Lens
     UpdateJob UpdateJob (Maybe Notification) (Maybe 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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> UpdateJob -> f UpdateJob
updateJob_forwardingAddressId = (UpdateJob -> Maybe Text)
-> (UpdateJob -> Maybe Text -> UpdateJob)
-> Lens UpdateJob UpdateJob (Maybe Text) (Maybe Text)
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 ID of the updated Address object.
updateJob_addressId :: Lens.Lens' UpdateJob (Prelude.Maybe Prelude.Text)
updateJob_addressId :: (Maybe Text -> f (Maybe Text)) -> UpdateJob -> f UpdateJob
updateJob_addressId = (UpdateJob -> Maybe Text)
-> (UpdateJob -> Maybe Text -> UpdateJob)
-> Lens UpdateJob UpdateJob (Maybe Text) (Maybe Text)
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 shipping option value of this job\'s ShippingDetails object.
updateJob_shippingOption :: Lens.Lens' UpdateJob (Prelude.Maybe ShippingOption)
updateJob_shippingOption :: (Maybe ShippingOption -> f (Maybe ShippingOption))
-> UpdateJob -> f UpdateJob
updateJob_shippingOption = (UpdateJob -> Maybe ShippingOption)
-> (UpdateJob -> Maybe ShippingOption -> UpdateJob)
-> Lens
     UpdateJob UpdateJob (Maybe ShippingOption) (Maybe 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 @JobResource@ object, or the updated JobResource object.
updateJob_resources :: Lens.Lens' UpdateJob (Prelude.Maybe JobResource)
updateJob_resources :: (Maybe JobResource -> f (Maybe JobResource))
-> UpdateJob -> f UpdateJob
updateJob_resources = (UpdateJob -> Maybe JobResource)
-> (UpdateJob -> Maybe JobResource -> UpdateJob)
-> Lens UpdateJob UpdateJob (Maybe JobResource) (Maybe JobResource)
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)

-- | Specifies the service or services on the Snow Family device that your
-- transferred data will be exported from or imported into. AWS Snow Family
-- supports Amazon S3 and NFS (Network File System).
updateJob_onDeviceServiceConfiguration :: Lens.Lens' UpdateJob (Prelude.Maybe OnDeviceServiceConfiguration)
updateJob_onDeviceServiceConfiguration :: (Maybe OnDeviceServiceConfiguration
 -> f (Maybe OnDeviceServiceConfiguration))
-> UpdateJob -> f UpdateJob
updateJob_onDeviceServiceConfiguration = (UpdateJob -> Maybe OnDeviceServiceConfiguration)
-> (UpdateJob -> Maybe OnDeviceServiceConfiguration -> UpdateJob)
-> Lens
     UpdateJob
     UpdateJob
     (Maybe OnDeviceServiceConfiguration)
     (Maybe 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 description of this job\'s JobMetadata object.
updateJob_description :: Lens.Lens' UpdateJob (Prelude.Maybe Prelude.Text)
updateJob_description :: (Maybe Text -> f (Maybe Text)) -> UpdateJob -> f UpdateJob
updateJob_description = (UpdateJob -> Maybe Text)
-> (UpdateJob -> Maybe Text -> UpdateJob)
-> Lens UpdateJob UpdateJob (Maybe Text) (Maybe Text)
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 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>AWS
-- Identity and Access Management (IAM) API action.
updateJob_roleARN :: Lens.Lens' UpdateJob (Prelude.Maybe Prelude.Text)
updateJob_roleARN :: (Maybe Text -> f (Maybe Text)) -> UpdateJob -> f UpdateJob
updateJob_roleARN = (UpdateJob -> Maybe Text)
-> (UpdateJob -> Maybe Text -> UpdateJob)
-> Lens UpdateJob UpdateJob (Maybe Text) (Maybe Text)
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 @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 :: (Maybe SnowballCapacity -> f (Maybe SnowballCapacity))
-> UpdateJob -> f UpdateJob
updateJob_snowballCapacityPreference = (UpdateJob -> Maybe SnowballCapacity)
-> (UpdateJob -> Maybe SnowballCapacity -> UpdateJob)
-> Lens
     UpdateJob
     UpdateJob
     (Maybe SnowballCapacity)
     (Maybe SnowballCapacity)
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 :: (Text -> f Text) -> UpdateJob -> f UpdateJob
updateJob_jobId = (UpdateJob -> Text)
-> (UpdateJob -> Text -> UpdateJob)
-> Lens UpdateJob UpdateJob Text Text
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 :: UpdateJob -> Request UpdateJob
request = Service -> UpdateJob -> Request UpdateJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateJob)))
response =
    (Int
 -> ResponseHeaders -> () -> Either String (AWSResponse UpdateJob))
-> Logger
-> Service
-> Proxy UpdateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateJob)))
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 ->
          Int -> UpdateJobResponse
UpdateJobResponse'
            (Int -> UpdateJobResponse)
-> Either String Int -> Either String UpdateJobResponse
forall (f :: * -> *) a b. Functor 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 UpdateJob

instance Prelude.NFData UpdateJob

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

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

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

instance Core.ToQuery UpdateJob where
  toQuery :: UpdateJob -> QueryString
toQuery = QueryString -> UpdateJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(UpdateJobResponse -> UpdateJobResponse -> Bool)
-> (UpdateJobResponse -> UpdateJobResponse -> Bool)
-> Eq UpdateJobResponse
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]
(Int -> ReadS UpdateJobResponse)
-> ReadS [UpdateJobResponse]
-> ReadPrec UpdateJobResponse
-> ReadPrec [UpdateJobResponse]
-> Read 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
(Int -> UpdateJobResponse -> ShowS)
-> (UpdateJobResponse -> String)
-> ([UpdateJobResponse] -> ShowS)
-> Show UpdateJobResponse
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. UpdateJobResponse -> Rep UpdateJobResponse x)
-> (forall x. Rep UpdateJobResponse x -> UpdateJobResponse)
-> Generic UpdateJobResponse
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' :: Int -> UpdateJobResponse
UpdateJobResponse' {$sel:httpStatus:UpdateJobResponse' :: Int
httpStatus = Int
pHttpStatus_}

-- | The response's http status code.
updateJobResponse_httpStatus :: Lens.Lens' UpdateJobResponse Prelude.Int
updateJobResponse_httpStatus :: (Int -> f Int) -> UpdateJobResponse -> f UpdateJobResponse
updateJobResponse_httpStatus = (UpdateJobResponse -> Int)
-> (UpdateJobResponse -> Int -> UpdateJobResponse)
-> Lens UpdateJobResponse UpdateJobResponse Int Int
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