{-# 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.Batch.UpdateJobQueue
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a job queue.
module Amazonka.Batch.UpdateJobQueue
  ( -- * Creating a Request
    UpdateJobQueue (..),
    newUpdateJobQueue,

    -- * Request Lenses
    updateJobQueue_computeEnvironmentOrder,
    updateJobQueue_priority,
    updateJobQueue_schedulingPolicyArn,
    updateJobQueue_state,
    updateJobQueue_jobQueue,

    -- * Destructuring the Response
    UpdateJobQueueResponse (..),
    newUpdateJobQueueResponse,

    -- * Response Lenses
    updateJobQueueResponse_jobQueueArn,
    updateJobQueueResponse_jobQueueName,
    updateJobQueueResponse_httpStatus,
  )
where

import Amazonka.Batch.Types
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

-- | Contains the parameters for @UpdateJobQueue@.
--
-- /See:/ 'newUpdateJobQueue' smart constructor.
data UpdateJobQueue = UpdateJobQueue'
  { -- | Details the set of compute environments mapped to a job queue and their
    -- order relative to each other. This is one of the parameters used by the
    -- job scheduler to determine which compute environment runs a given job.
    -- Compute environments must be in the @VALID@ state before you can
    -- associate them with a job queue. All of the compute environments must be
    -- either EC2 (@EC2@ or @SPOT@) or Fargate (@FARGATE@ or @FARGATE_SPOT@).
    -- EC2 and Fargate compute environments can\'t be mixed.
    --
    -- All compute environments that are associated with a job queue must share
    -- the same architecture. Batch doesn\'t support mixing compute environment
    -- architecture types in a single job queue.
    UpdateJobQueue -> Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder :: Prelude.Maybe [ComputeEnvironmentOrder],
    -- | The priority of the job queue. Job queues with a higher priority (or a
    -- higher integer value for the @priority@ parameter) are evaluated first
    -- when associated with the same compute environment. Priority is
    -- determined in descending order. For example, a job queue with a priority
    -- value of @10@ is given scheduling preference over a job queue with a
    -- priority value of @1@. All of the compute environments must be either
    -- EC2 (@EC2@ or @SPOT@) or Fargate (@FARGATE@ or @FARGATE_SPOT@). EC2 and
    -- Fargate compute environments can\'t be mixed.
    UpdateJobQueue -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
    -- | Amazon Resource Name (ARN) of the fair share scheduling policy. Once a
    -- job queue is created, the fair share scheduling policy can be replaced
    -- but not removed. The format is
    -- @aws:@/@Partition@/@:batch:@/@Region@/@:@/@Account@/@:scheduling-policy\/@/@Name@/@ @.
    -- For example,
    -- @aws:aws:batch:us-west-2:123456789012:scheduling-policy\/MySchedulingPolicy@.
    UpdateJobQueue -> Maybe Text
schedulingPolicyArn :: Prelude.Maybe Prelude.Text,
    -- | Describes the queue\'s ability to accept new jobs. If the job queue
    -- state is @ENABLED@, it can accept jobs. If the job queue state is
    -- @DISABLED@, new jobs can\'t be added to the queue, but jobs already in
    -- the queue can finish.
    UpdateJobQueue -> Maybe JQState
state :: Prelude.Maybe JQState,
    -- | The name or the Amazon Resource Name (ARN) of the job queue.
    UpdateJobQueue -> Text
jobQueue :: Prelude.Text
  }
  deriving (UpdateJobQueue -> UpdateJobQueue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateJobQueue -> UpdateJobQueue -> Bool
$c/= :: UpdateJobQueue -> UpdateJobQueue -> Bool
== :: UpdateJobQueue -> UpdateJobQueue -> Bool
$c== :: UpdateJobQueue -> UpdateJobQueue -> Bool
Prelude.Eq, ReadPrec [UpdateJobQueue]
ReadPrec UpdateJobQueue
Int -> ReadS UpdateJobQueue
ReadS [UpdateJobQueue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateJobQueue]
$creadListPrec :: ReadPrec [UpdateJobQueue]
readPrec :: ReadPrec UpdateJobQueue
$creadPrec :: ReadPrec UpdateJobQueue
readList :: ReadS [UpdateJobQueue]
$creadList :: ReadS [UpdateJobQueue]
readsPrec :: Int -> ReadS UpdateJobQueue
$creadsPrec :: Int -> ReadS UpdateJobQueue
Prelude.Read, Int -> UpdateJobQueue -> ShowS
[UpdateJobQueue] -> ShowS
UpdateJobQueue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateJobQueue] -> ShowS
$cshowList :: [UpdateJobQueue] -> ShowS
show :: UpdateJobQueue -> String
$cshow :: UpdateJobQueue -> String
showsPrec :: Int -> UpdateJobQueue -> ShowS
$cshowsPrec :: Int -> UpdateJobQueue -> ShowS
Prelude.Show, forall x. Rep UpdateJobQueue x -> UpdateJobQueue
forall x. UpdateJobQueue -> Rep UpdateJobQueue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateJobQueue x -> UpdateJobQueue
$cfrom :: forall x. UpdateJobQueue -> Rep UpdateJobQueue x
Prelude.Generic)

-- |
-- Create a value of 'UpdateJobQueue' 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:
--
-- 'computeEnvironmentOrder', 'updateJobQueue_computeEnvironmentOrder' - Details the set of compute environments mapped to a job queue and their
-- order relative to each other. This is one of the parameters used by the
-- job scheduler to determine which compute environment runs a given job.
-- Compute environments must be in the @VALID@ state before you can
-- associate them with a job queue. All of the compute environments must be
-- either EC2 (@EC2@ or @SPOT@) or Fargate (@FARGATE@ or @FARGATE_SPOT@).
-- EC2 and Fargate compute environments can\'t be mixed.
--
-- All compute environments that are associated with a job queue must share
-- the same architecture. Batch doesn\'t support mixing compute environment
-- architecture types in a single job queue.
--
-- 'priority', 'updateJobQueue_priority' - The priority of the job queue. Job queues with a higher priority (or a
-- higher integer value for the @priority@ parameter) are evaluated first
-- when associated with the same compute environment. Priority is
-- determined in descending order. For example, a job queue with a priority
-- value of @10@ is given scheduling preference over a job queue with a
-- priority value of @1@. All of the compute environments must be either
-- EC2 (@EC2@ or @SPOT@) or Fargate (@FARGATE@ or @FARGATE_SPOT@). EC2 and
-- Fargate compute environments can\'t be mixed.
--
-- 'schedulingPolicyArn', 'updateJobQueue_schedulingPolicyArn' - Amazon Resource Name (ARN) of the fair share scheduling policy. Once a
-- job queue is created, the fair share scheduling policy can be replaced
-- but not removed. The format is
-- @aws:@/@Partition@/@:batch:@/@Region@/@:@/@Account@/@:scheduling-policy\/@/@Name@/@ @.
-- For example,
-- @aws:aws:batch:us-west-2:123456789012:scheduling-policy\/MySchedulingPolicy@.
--
-- 'state', 'updateJobQueue_state' - Describes the queue\'s ability to accept new jobs. If the job queue
-- state is @ENABLED@, it can accept jobs. If the job queue state is
-- @DISABLED@, new jobs can\'t be added to the queue, but jobs already in
-- the queue can finish.
--
-- 'jobQueue', 'updateJobQueue_jobQueue' - The name or the Amazon Resource Name (ARN) of the job queue.
newUpdateJobQueue ::
  -- | 'jobQueue'
  Prelude.Text ->
  UpdateJobQueue
newUpdateJobQueue :: Text -> UpdateJobQueue
newUpdateJobQueue Text
pJobQueue_ =
  UpdateJobQueue'
    { $sel:computeEnvironmentOrder:UpdateJobQueue' :: Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder =
        forall a. Maybe a
Prelude.Nothing,
      $sel:priority:UpdateJobQueue' :: Maybe Int
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:schedulingPolicyArn:UpdateJobQueue' :: Maybe Text
schedulingPolicyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:state:UpdateJobQueue' :: Maybe JQState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:jobQueue:UpdateJobQueue' :: Text
jobQueue = Text
pJobQueue_
    }

-- | Details the set of compute environments mapped to a job queue and their
-- order relative to each other. This is one of the parameters used by the
-- job scheduler to determine which compute environment runs a given job.
-- Compute environments must be in the @VALID@ state before you can
-- associate them with a job queue. All of the compute environments must be
-- either EC2 (@EC2@ or @SPOT@) or Fargate (@FARGATE@ or @FARGATE_SPOT@).
-- EC2 and Fargate compute environments can\'t be mixed.
--
-- All compute environments that are associated with a job queue must share
-- the same architecture. Batch doesn\'t support mixing compute environment
-- architecture types in a single job queue.
updateJobQueue_computeEnvironmentOrder :: Lens.Lens' UpdateJobQueue (Prelude.Maybe [ComputeEnvironmentOrder])
updateJobQueue_computeEnvironmentOrder :: Lens' UpdateJobQueue (Maybe [ComputeEnvironmentOrder])
updateJobQueue_computeEnvironmentOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobQueue' {Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder :: Maybe [ComputeEnvironmentOrder]
$sel:computeEnvironmentOrder:UpdateJobQueue' :: UpdateJobQueue -> Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder} -> Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder) (\s :: UpdateJobQueue
s@UpdateJobQueue' {} Maybe [ComputeEnvironmentOrder]
a -> UpdateJobQueue
s {$sel:computeEnvironmentOrder:UpdateJobQueue' :: Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder = Maybe [ComputeEnvironmentOrder]
a} :: UpdateJobQueue) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The priority of the job queue. Job queues with a higher priority (or a
-- higher integer value for the @priority@ parameter) are evaluated first
-- when associated with the same compute environment. Priority is
-- determined in descending order. For example, a job queue with a priority
-- value of @10@ is given scheduling preference over a job queue with a
-- priority value of @1@. All of the compute environments must be either
-- EC2 (@EC2@ or @SPOT@) or Fargate (@FARGATE@ or @FARGATE_SPOT@). EC2 and
-- Fargate compute environments can\'t be mixed.
updateJobQueue_priority :: Lens.Lens' UpdateJobQueue (Prelude.Maybe Prelude.Int)
updateJobQueue_priority :: Lens' UpdateJobQueue (Maybe Int)
updateJobQueue_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobQueue' {Maybe Int
priority :: Maybe Int
$sel:priority:UpdateJobQueue' :: UpdateJobQueue -> Maybe Int
priority} -> Maybe Int
priority) (\s :: UpdateJobQueue
s@UpdateJobQueue' {} Maybe Int
a -> UpdateJobQueue
s {$sel:priority:UpdateJobQueue' :: Maybe Int
priority = Maybe Int
a} :: UpdateJobQueue)

-- | Amazon Resource Name (ARN) of the fair share scheduling policy. Once a
-- job queue is created, the fair share scheduling policy can be replaced
-- but not removed. The format is
-- @aws:@/@Partition@/@:batch:@/@Region@/@:@/@Account@/@:scheduling-policy\/@/@Name@/@ @.
-- For example,
-- @aws:aws:batch:us-west-2:123456789012:scheduling-policy\/MySchedulingPolicy@.
updateJobQueue_schedulingPolicyArn :: Lens.Lens' UpdateJobQueue (Prelude.Maybe Prelude.Text)
updateJobQueue_schedulingPolicyArn :: Lens' UpdateJobQueue (Maybe Text)
updateJobQueue_schedulingPolicyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobQueue' {Maybe Text
schedulingPolicyArn :: Maybe Text
$sel:schedulingPolicyArn:UpdateJobQueue' :: UpdateJobQueue -> Maybe Text
schedulingPolicyArn} -> Maybe Text
schedulingPolicyArn) (\s :: UpdateJobQueue
s@UpdateJobQueue' {} Maybe Text
a -> UpdateJobQueue
s {$sel:schedulingPolicyArn:UpdateJobQueue' :: Maybe Text
schedulingPolicyArn = Maybe Text
a} :: UpdateJobQueue)

-- | Describes the queue\'s ability to accept new jobs. If the job queue
-- state is @ENABLED@, it can accept jobs. If the job queue state is
-- @DISABLED@, new jobs can\'t be added to the queue, but jobs already in
-- the queue can finish.
updateJobQueue_state :: Lens.Lens' UpdateJobQueue (Prelude.Maybe JQState)
updateJobQueue_state :: Lens' UpdateJobQueue (Maybe JQState)
updateJobQueue_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobQueue' {Maybe JQState
state :: Maybe JQState
$sel:state:UpdateJobQueue' :: UpdateJobQueue -> Maybe JQState
state} -> Maybe JQState
state) (\s :: UpdateJobQueue
s@UpdateJobQueue' {} Maybe JQState
a -> UpdateJobQueue
s {$sel:state:UpdateJobQueue' :: Maybe JQState
state = Maybe JQState
a} :: UpdateJobQueue)

-- | The name or the Amazon Resource Name (ARN) of the job queue.
updateJobQueue_jobQueue :: Lens.Lens' UpdateJobQueue Prelude.Text
updateJobQueue_jobQueue :: Lens' UpdateJobQueue Text
updateJobQueue_jobQueue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobQueue' {Text
jobQueue :: Text
$sel:jobQueue:UpdateJobQueue' :: UpdateJobQueue -> Text
jobQueue} -> Text
jobQueue) (\s :: UpdateJobQueue
s@UpdateJobQueue' {} Text
a -> UpdateJobQueue
s {$sel:jobQueue:UpdateJobQueue' :: Text
jobQueue = Text
a} :: UpdateJobQueue)

instance Core.AWSRequest UpdateJobQueue where
  type
    AWSResponse UpdateJobQueue =
      UpdateJobQueueResponse
  request :: (Service -> Service) -> UpdateJobQueue -> Request UpdateJobQueue
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 UpdateJobQueue
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateJobQueue)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Int -> UpdateJobQueueResponse
UpdateJobQueueResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"jobQueueArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"jobQueueName")
            forall (f :: * -> *) a b. Applicative f => 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 UpdateJobQueue where
  hashWithSalt :: Int -> UpdateJobQueue -> Int
hashWithSalt Int
_salt UpdateJobQueue' {Maybe Int
Maybe [ComputeEnvironmentOrder]
Maybe Text
Maybe JQState
Text
jobQueue :: Text
state :: Maybe JQState
schedulingPolicyArn :: Maybe Text
priority :: Maybe Int
computeEnvironmentOrder :: Maybe [ComputeEnvironmentOrder]
$sel:jobQueue:UpdateJobQueue' :: UpdateJobQueue -> Text
$sel:state:UpdateJobQueue' :: UpdateJobQueue -> Maybe JQState
$sel:schedulingPolicyArn:UpdateJobQueue' :: UpdateJobQueue -> Maybe Text
$sel:priority:UpdateJobQueue' :: UpdateJobQueue -> Maybe Int
$sel:computeEnvironmentOrder:UpdateJobQueue' :: UpdateJobQueue -> Maybe [ComputeEnvironmentOrder]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schedulingPolicyArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JQState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobQueue

instance Prelude.NFData UpdateJobQueue where
  rnf :: UpdateJobQueue -> ()
rnf UpdateJobQueue' {Maybe Int
Maybe [ComputeEnvironmentOrder]
Maybe Text
Maybe JQState
Text
jobQueue :: Text
state :: Maybe JQState
schedulingPolicyArn :: Maybe Text
priority :: Maybe Int
computeEnvironmentOrder :: Maybe [ComputeEnvironmentOrder]
$sel:jobQueue:UpdateJobQueue' :: UpdateJobQueue -> Text
$sel:state:UpdateJobQueue' :: UpdateJobQueue -> Maybe JQState
$sel:schedulingPolicyArn:UpdateJobQueue' :: UpdateJobQueue -> Maybe Text
$sel:priority:UpdateJobQueue' :: UpdateJobQueue -> Maybe Int
$sel:computeEnvironmentOrder:UpdateJobQueue' :: UpdateJobQueue -> Maybe [ComputeEnvironmentOrder]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ComputeEnvironmentOrder]
computeEnvironmentOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schedulingPolicyArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JQState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobQueue

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

instance Data.ToJSON UpdateJobQueue where
  toJSON :: UpdateJobQueue -> Value
toJSON UpdateJobQueue' {Maybe Int
Maybe [ComputeEnvironmentOrder]
Maybe Text
Maybe JQState
Text
jobQueue :: Text
state :: Maybe JQState
schedulingPolicyArn :: Maybe Text
priority :: Maybe Int
computeEnvironmentOrder :: Maybe [ComputeEnvironmentOrder]
$sel:jobQueue:UpdateJobQueue' :: UpdateJobQueue -> Text
$sel:state:UpdateJobQueue' :: UpdateJobQueue -> Maybe JQState
$sel:schedulingPolicyArn:UpdateJobQueue' :: UpdateJobQueue -> Maybe Text
$sel:priority:UpdateJobQueue' :: UpdateJobQueue -> Maybe Int
$sel:computeEnvironmentOrder:UpdateJobQueue' :: UpdateJobQueue -> Maybe [ComputeEnvironmentOrder]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"computeEnvironmentOrder" 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 [ComputeEnvironmentOrder]
computeEnvironmentOrder,
            (Key
"priority" 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 Int
priority,
            (Key
"schedulingPolicyArn" 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
schedulingPolicyArn,
            (Key
"state" 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 JQState
state,
            forall a. a -> Maybe a
Prelude.Just (Key
"jobQueue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobQueue)
          ]
      )

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

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

-- | /See:/ 'newUpdateJobQueueResponse' smart constructor.
data UpdateJobQueueResponse = UpdateJobQueueResponse'
  { -- | The Amazon Resource Name (ARN) of the job queue.
    UpdateJobQueueResponse -> Maybe Text
jobQueueArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the job queue.
    UpdateJobQueueResponse -> Maybe Text
jobQueueName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateJobQueueResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateJobQueueResponse -> UpdateJobQueueResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateJobQueueResponse -> UpdateJobQueueResponse -> Bool
$c/= :: UpdateJobQueueResponse -> UpdateJobQueueResponse -> Bool
== :: UpdateJobQueueResponse -> UpdateJobQueueResponse -> Bool
$c== :: UpdateJobQueueResponse -> UpdateJobQueueResponse -> Bool
Prelude.Eq, ReadPrec [UpdateJobQueueResponse]
ReadPrec UpdateJobQueueResponse
Int -> ReadS UpdateJobQueueResponse
ReadS [UpdateJobQueueResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateJobQueueResponse]
$creadListPrec :: ReadPrec [UpdateJobQueueResponse]
readPrec :: ReadPrec UpdateJobQueueResponse
$creadPrec :: ReadPrec UpdateJobQueueResponse
readList :: ReadS [UpdateJobQueueResponse]
$creadList :: ReadS [UpdateJobQueueResponse]
readsPrec :: Int -> ReadS UpdateJobQueueResponse
$creadsPrec :: Int -> ReadS UpdateJobQueueResponse
Prelude.Read, Int -> UpdateJobQueueResponse -> ShowS
[UpdateJobQueueResponse] -> ShowS
UpdateJobQueueResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateJobQueueResponse] -> ShowS
$cshowList :: [UpdateJobQueueResponse] -> ShowS
show :: UpdateJobQueueResponse -> String
$cshow :: UpdateJobQueueResponse -> String
showsPrec :: Int -> UpdateJobQueueResponse -> ShowS
$cshowsPrec :: Int -> UpdateJobQueueResponse -> ShowS
Prelude.Show, forall x. Rep UpdateJobQueueResponse x -> UpdateJobQueueResponse
forall x. UpdateJobQueueResponse -> Rep UpdateJobQueueResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateJobQueueResponse x -> UpdateJobQueueResponse
$cfrom :: forall x. UpdateJobQueueResponse -> Rep UpdateJobQueueResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateJobQueueResponse' 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:
--
-- 'jobQueueArn', 'updateJobQueueResponse_jobQueueArn' - The Amazon Resource Name (ARN) of the job queue.
--
-- 'jobQueueName', 'updateJobQueueResponse_jobQueueName' - The name of the job queue.
--
-- 'httpStatus', 'updateJobQueueResponse_httpStatus' - The response's http status code.
newUpdateJobQueueResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateJobQueueResponse
newUpdateJobQueueResponse :: Int -> UpdateJobQueueResponse
newUpdateJobQueueResponse Int
pHttpStatus_ =
  UpdateJobQueueResponse'
    { $sel:jobQueueArn:UpdateJobQueueResponse' :: Maybe Text
jobQueueArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:jobQueueName:UpdateJobQueueResponse' :: Maybe Text
jobQueueName = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateJobQueueResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the job queue.
updateJobQueueResponse_jobQueueArn :: Lens.Lens' UpdateJobQueueResponse (Prelude.Maybe Prelude.Text)
updateJobQueueResponse_jobQueueArn :: Lens' UpdateJobQueueResponse (Maybe Text)
updateJobQueueResponse_jobQueueArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobQueueResponse' {Maybe Text
jobQueueArn :: Maybe Text
$sel:jobQueueArn:UpdateJobQueueResponse' :: UpdateJobQueueResponse -> Maybe Text
jobQueueArn} -> Maybe Text
jobQueueArn) (\s :: UpdateJobQueueResponse
s@UpdateJobQueueResponse' {} Maybe Text
a -> UpdateJobQueueResponse
s {$sel:jobQueueArn:UpdateJobQueueResponse' :: Maybe Text
jobQueueArn = Maybe Text
a} :: UpdateJobQueueResponse)

-- | The name of the job queue.
updateJobQueueResponse_jobQueueName :: Lens.Lens' UpdateJobQueueResponse (Prelude.Maybe Prelude.Text)
updateJobQueueResponse_jobQueueName :: Lens' UpdateJobQueueResponse (Maybe Text)
updateJobQueueResponse_jobQueueName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobQueueResponse' {Maybe Text
jobQueueName :: Maybe Text
$sel:jobQueueName:UpdateJobQueueResponse' :: UpdateJobQueueResponse -> Maybe Text
jobQueueName} -> Maybe Text
jobQueueName) (\s :: UpdateJobQueueResponse
s@UpdateJobQueueResponse' {} Maybe Text
a -> UpdateJobQueueResponse
s {$sel:jobQueueName:UpdateJobQueueResponse' :: Maybe Text
jobQueueName = Maybe Text
a} :: UpdateJobQueueResponse)

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

instance Prelude.NFData UpdateJobQueueResponse where
  rnf :: UpdateJobQueueResponse -> ()
rnf UpdateJobQueueResponse' {Int
Maybe Text
httpStatus :: Int
jobQueueName :: Maybe Text
jobQueueArn :: Maybe Text
$sel:httpStatus:UpdateJobQueueResponse' :: UpdateJobQueueResponse -> Int
$sel:jobQueueName:UpdateJobQueueResponse' :: UpdateJobQueueResponse -> Maybe Text
$sel:jobQueueArn:UpdateJobQueueResponse' :: UpdateJobQueueResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobQueueArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobQueueName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus