{-# 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.DeviceFarm.UpdateDevicePool
-- 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)
--
-- Modifies the name, description, and rules in a device pool given the
-- attributes and the pool ARN. Rule updates are all-or-nothing, meaning
-- they can only be updated as a whole (or not at all).
module Amazonka.DeviceFarm.UpdateDevicePool
  ( -- * Creating a Request
    UpdateDevicePool (..),
    newUpdateDevicePool,

    -- * Request Lenses
    updateDevicePool_rules,
    updateDevicePool_clearMaxDevices,
    updateDevicePool_name,
    updateDevicePool_maxDevices,
    updateDevicePool_description,
    updateDevicePool_arn,

    -- * Destructuring the Response
    UpdateDevicePoolResponse (..),
    newUpdateDevicePoolResponse,

    -- * Response Lenses
    updateDevicePoolResponse_devicePool,
    updateDevicePoolResponse_httpStatus,
  )
where

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

-- | Represents a request to the update device pool operation.
--
-- /See:/ 'newUpdateDevicePool' smart constructor.
data UpdateDevicePool = UpdateDevicePool'
  { -- | Represents the rules to modify for the device pool. Updating rules is
    -- optional. If you update rules for your request, the update replaces the
    -- existing rules.
    UpdateDevicePool -> Maybe [Rule]
rules :: Prelude.Maybe [Rule],
    -- | Sets whether the @maxDevices@ parameter applies to your device pool. If
    -- you set this parameter to @true@, the @maxDevices@ parameter does not
    -- apply, and Device Farm does not limit the number of devices that it adds
    -- to your device pool. In this case, Device Farm adds all available
    -- devices that meet the criteria specified in the @rules@ parameter.
    --
    -- If you use this parameter in your request, you cannot use the
    -- @maxDevices@ parameter in the same request.
    UpdateDevicePool -> Maybe Bool
clearMaxDevices :: Prelude.Maybe Prelude.Bool,
    -- | A string that represents the name of the device pool to update.
    UpdateDevicePool -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The number of devices that Device Farm can add to your device pool.
    -- Device Farm adds devices that are available and that meet the criteria
    -- that you assign for the @rules@ parameter. Depending on how many devices
    -- meet these constraints, your device pool might contain fewer devices
    -- than the value for this parameter.
    --
    -- By specifying the maximum number of devices, you can control the costs
    -- that you incur by running tests.
    --
    -- If you use this parameter in your request, you cannot use the
    -- @clearMaxDevices@ parameter in the same request.
    UpdateDevicePool -> Maybe Int
maxDevices :: Prelude.Maybe Prelude.Int,
    -- | A description of the device pool to update.
    UpdateDevicePool -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Device Farm device pool to update.
    UpdateDevicePool -> Text
arn :: Prelude.Text
  }
  deriving (UpdateDevicePool -> UpdateDevicePool -> Bool
(UpdateDevicePool -> UpdateDevicePool -> Bool)
-> (UpdateDevicePool -> UpdateDevicePool -> Bool)
-> Eq UpdateDevicePool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDevicePool -> UpdateDevicePool -> Bool
$c/= :: UpdateDevicePool -> UpdateDevicePool -> Bool
== :: UpdateDevicePool -> UpdateDevicePool -> Bool
$c== :: UpdateDevicePool -> UpdateDevicePool -> Bool
Prelude.Eq, ReadPrec [UpdateDevicePool]
ReadPrec UpdateDevicePool
Int -> ReadS UpdateDevicePool
ReadS [UpdateDevicePool]
(Int -> ReadS UpdateDevicePool)
-> ReadS [UpdateDevicePool]
-> ReadPrec UpdateDevicePool
-> ReadPrec [UpdateDevicePool]
-> Read UpdateDevicePool
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDevicePool]
$creadListPrec :: ReadPrec [UpdateDevicePool]
readPrec :: ReadPrec UpdateDevicePool
$creadPrec :: ReadPrec UpdateDevicePool
readList :: ReadS [UpdateDevicePool]
$creadList :: ReadS [UpdateDevicePool]
readsPrec :: Int -> ReadS UpdateDevicePool
$creadsPrec :: Int -> ReadS UpdateDevicePool
Prelude.Read, Int -> UpdateDevicePool -> ShowS
[UpdateDevicePool] -> ShowS
UpdateDevicePool -> String
(Int -> UpdateDevicePool -> ShowS)
-> (UpdateDevicePool -> String)
-> ([UpdateDevicePool] -> ShowS)
-> Show UpdateDevicePool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDevicePool] -> ShowS
$cshowList :: [UpdateDevicePool] -> ShowS
show :: UpdateDevicePool -> String
$cshow :: UpdateDevicePool -> String
showsPrec :: Int -> UpdateDevicePool -> ShowS
$cshowsPrec :: Int -> UpdateDevicePool -> ShowS
Prelude.Show, (forall x. UpdateDevicePool -> Rep UpdateDevicePool x)
-> (forall x. Rep UpdateDevicePool x -> UpdateDevicePool)
-> Generic UpdateDevicePool
forall x. Rep UpdateDevicePool x -> UpdateDevicePool
forall x. UpdateDevicePool -> Rep UpdateDevicePool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDevicePool x -> UpdateDevicePool
$cfrom :: forall x. UpdateDevicePool -> Rep UpdateDevicePool x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDevicePool' 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:
--
-- 'rules', 'updateDevicePool_rules' - Represents the rules to modify for the device pool. Updating rules is
-- optional. If you update rules for your request, the update replaces the
-- existing rules.
--
-- 'clearMaxDevices', 'updateDevicePool_clearMaxDevices' - Sets whether the @maxDevices@ parameter applies to your device pool. If
-- you set this parameter to @true@, the @maxDevices@ parameter does not
-- apply, and Device Farm does not limit the number of devices that it adds
-- to your device pool. In this case, Device Farm adds all available
-- devices that meet the criteria specified in the @rules@ parameter.
--
-- If you use this parameter in your request, you cannot use the
-- @maxDevices@ parameter in the same request.
--
-- 'name', 'updateDevicePool_name' - A string that represents the name of the device pool to update.
--
-- 'maxDevices', 'updateDevicePool_maxDevices' - The number of devices that Device Farm can add to your device pool.
-- Device Farm adds devices that are available and that meet the criteria
-- that you assign for the @rules@ parameter. Depending on how many devices
-- meet these constraints, your device pool might contain fewer devices
-- than the value for this parameter.
--
-- By specifying the maximum number of devices, you can control the costs
-- that you incur by running tests.
--
-- If you use this parameter in your request, you cannot use the
-- @clearMaxDevices@ parameter in the same request.
--
-- 'description', 'updateDevicePool_description' - A description of the device pool to update.
--
-- 'arn', 'updateDevicePool_arn' - The Amazon Resource Name (ARN) of the Device Farm device pool to update.
newUpdateDevicePool ::
  -- | 'arn'
  Prelude.Text ->
  UpdateDevicePool
newUpdateDevicePool :: Text -> UpdateDevicePool
newUpdateDevicePool Text
pArn_ =
  UpdateDevicePool' :: Maybe [Rule]
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Text
-> UpdateDevicePool
UpdateDevicePool'
    { $sel:rules:UpdateDevicePool' :: Maybe [Rule]
rules = Maybe [Rule]
forall a. Maybe a
Prelude.Nothing,
      $sel:clearMaxDevices:UpdateDevicePool' :: Maybe Bool
clearMaxDevices = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateDevicePool' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxDevices:UpdateDevicePool' :: Maybe Int
maxDevices = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateDevicePool' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateDevicePool' :: Text
arn = Text
pArn_
    }

-- | Represents the rules to modify for the device pool. Updating rules is
-- optional. If you update rules for your request, the update replaces the
-- existing rules.
updateDevicePool_rules :: Lens.Lens' UpdateDevicePool (Prelude.Maybe [Rule])
updateDevicePool_rules :: (Maybe [Rule] -> f (Maybe [Rule]))
-> UpdateDevicePool -> f UpdateDevicePool
updateDevicePool_rules = (UpdateDevicePool -> Maybe [Rule])
-> (UpdateDevicePool -> Maybe [Rule] -> UpdateDevicePool)
-> Lens
     UpdateDevicePool UpdateDevicePool (Maybe [Rule]) (Maybe [Rule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevicePool' {Maybe [Rule]
rules :: Maybe [Rule]
$sel:rules:UpdateDevicePool' :: UpdateDevicePool -> Maybe [Rule]
rules} -> Maybe [Rule]
rules) (\s :: UpdateDevicePool
s@UpdateDevicePool' {} Maybe [Rule]
a -> UpdateDevicePool
s {$sel:rules:UpdateDevicePool' :: Maybe [Rule]
rules = Maybe [Rule]
a} :: UpdateDevicePool) ((Maybe [Rule] -> f (Maybe [Rule]))
 -> UpdateDevicePool -> f UpdateDevicePool)
-> ((Maybe [Rule] -> f (Maybe [Rule]))
    -> Maybe [Rule] -> f (Maybe [Rule]))
-> (Maybe [Rule] -> f (Maybe [Rule]))
-> UpdateDevicePool
-> f UpdateDevicePool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Rule] [Rule] [Rule] [Rule]
-> Iso (Maybe [Rule]) (Maybe [Rule]) (Maybe [Rule]) (Maybe [Rule])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Rule] [Rule] [Rule] [Rule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Sets whether the @maxDevices@ parameter applies to your device pool. If
-- you set this parameter to @true@, the @maxDevices@ parameter does not
-- apply, and Device Farm does not limit the number of devices that it adds
-- to your device pool. In this case, Device Farm adds all available
-- devices that meet the criteria specified in the @rules@ parameter.
--
-- If you use this parameter in your request, you cannot use the
-- @maxDevices@ parameter in the same request.
updateDevicePool_clearMaxDevices :: Lens.Lens' UpdateDevicePool (Prelude.Maybe Prelude.Bool)
updateDevicePool_clearMaxDevices :: (Maybe Bool -> f (Maybe Bool))
-> UpdateDevicePool -> f UpdateDevicePool
updateDevicePool_clearMaxDevices = (UpdateDevicePool -> Maybe Bool)
-> (UpdateDevicePool -> Maybe Bool -> UpdateDevicePool)
-> Lens UpdateDevicePool UpdateDevicePool (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevicePool' {Maybe Bool
clearMaxDevices :: Maybe Bool
$sel:clearMaxDevices:UpdateDevicePool' :: UpdateDevicePool -> Maybe Bool
clearMaxDevices} -> Maybe Bool
clearMaxDevices) (\s :: UpdateDevicePool
s@UpdateDevicePool' {} Maybe Bool
a -> UpdateDevicePool
s {$sel:clearMaxDevices:UpdateDevicePool' :: Maybe Bool
clearMaxDevices = Maybe Bool
a} :: UpdateDevicePool)

-- | A string that represents the name of the device pool to update.
updateDevicePool_name :: Lens.Lens' UpdateDevicePool (Prelude.Maybe Prelude.Text)
updateDevicePool_name :: (Maybe Text -> f (Maybe Text))
-> UpdateDevicePool -> f UpdateDevicePool
updateDevicePool_name = (UpdateDevicePool -> Maybe Text)
-> (UpdateDevicePool -> Maybe Text -> UpdateDevicePool)
-> Lens UpdateDevicePool UpdateDevicePool (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevicePool' {Maybe Text
name :: Maybe Text
$sel:name:UpdateDevicePool' :: UpdateDevicePool -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateDevicePool
s@UpdateDevicePool' {} Maybe Text
a -> UpdateDevicePool
s {$sel:name:UpdateDevicePool' :: Maybe Text
name = Maybe Text
a} :: UpdateDevicePool)

-- | The number of devices that Device Farm can add to your device pool.
-- Device Farm adds devices that are available and that meet the criteria
-- that you assign for the @rules@ parameter. Depending on how many devices
-- meet these constraints, your device pool might contain fewer devices
-- than the value for this parameter.
--
-- By specifying the maximum number of devices, you can control the costs
-- that you incur by running tests.
--
-- If you use this parameter in your request, you cannot use the
-- @clearMaxDevices@ parameter in the same request.
updateDevicePool_maxDevices :: Lens.Lens' UpdateDevicePool (Prelude.Maybe Prelude.Int)
updateDevicePool_maxDevices :: (Maybe Int -> f (Maybe Int))
-> UpdateDevicePool -> f UpdateDevicePool
updateDevicePool_maxDevices = (UpdateDevicePool -> Maybe Int)
-> (UpdateDevicePool -> Maybe Int -> UpdateDevicePool)
-> Lens UpdateDevicePool UpdateDevicePool (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevicePool' {Maybe Int
maxDevices :: Maybe Int
$sel:maxDevices:UpdateDevicePool' :: UpdateDevicePool -> Maybe Int
maxDevices} -> Maybe Int
maxDevices) (\s :: UpdateDevicePool
s@UpdateDevicePool' {} Maybe Int
a -> UpdateDevicePool
s {$sel:maxDevices:UpdateDevicePool' :: Maybe Int
maxDevices = Maybe Int
a} :: UpdateDevicePool)

-- | A description of the device pool to update.
updateDevicePool_description :: Lens.Lens' UpdateDevicePool (Prelude.Maybe Prelude.Text)
updateDevicePool_description :: (Maybe Text -> f (Maybe Text))
-> UpdateDevicePool -> f UpdateDevicePool
updateDevicePool_description = (UpdateDevicePool -> Maybe Text)
-> (UpdateDevicePool -> Maybe Text -> UpdateDevicePool)
-> Lens UpdateDevicePool UpdateDevicePool (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevicePool' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDevicePool' :: UpdateDevicePool -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDevicePool
s@UpdateDevicePool' {} Maybe Text
a -> UpdateDevicePool
s {$sel:description:UpdateDevicePool' :: Maybe Text
description = Maybe Text
a} :: UpdateDevicePool)

-- | The Amazon Resource Name (ARN) of the Device Farm device pool to update.
updateDevicePool_arn :: Lens.Lens' UpdateDevicePool Prelude.Text
updateDevicePool_arn :: (Text -> f Text) -> UpdateDevicePool -> f UpdateDevicePool
updateDevicePool_arn = (UpdateDevicePool -> Text)
-> (UpdateDevicePool -> Text -> UpdateDevicePool)
-> Lens UpdateDevicePool UpdateDevicePool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevicePool' {Text
arn :: Text
$sel:arn:UpdateDevicePool' :: UpdateDevicePool -> Text
arn} -> Text
arn) (\s :: UpdateDevicePool
s@UpdateDevicePool' {} Text
a -> UpdateDevicePool
s {$sel:arn:UpdateDevicePool' :: Text
arn = Text
a} :: UpdateDevicePool)

instance Core.AWSRequest UpdateDevicePool where
  type
    AWSResponse UpdateDevicePool =
      UpdateDevicePoolResponse
  request :: UpdateDevicePool -> Request UpdateDevicePool
request = Service -> UpdateDevicePool -> Request UpdateDevicePool
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateDevicePool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDevicePool)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateDevicePool))
-> Logger
-> Service
-> Proxy UpdateDevicePool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDevicePool)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe DevicePool -> Int -> UpdateDevicePoolResponse
UpdateDevicePoolResponse'
            (Maybe DevicePool -> Int -> UpdateDevicePoolResponse)
-> Either String (Maybe DevicePool)
-> Either String (Int -> UpdateDevicePoolResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DevicePool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"devicePool")
            Either String (Int -> UpdateDevicePoolResponse)
-> Either String Int -> Either String UpdateDevicePoolResponse
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 UpdateDevicePool

instance Prelude.NFData UpdateDevicePool

instance Core.ToHeaders UpdateDevicePool where
  toHeaders :: UpdateDevicePool -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateDevicePool -> 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
"DeviceFarm_20150623.UpdateDevicePool" ::
                          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 UpdateDevicePool where
  toJSON :: UpdateDevicePool -> Value
toJSON UpdateDevicePool' {Maybe Bool
Maybe Int
Maybe [Rule]
Maybe Text
Text
arn :: Text
description :: Maybe Text
maxDevices :: Maybe Int
name :: Maybe Text
clearMaxDevices :: Maybe Bool
rules :: Maybe [Rule]
$sel:arn:UpdateDevicePool' :: UpdateDevicePool -> Text
$sel:description:UpdateDevicePool' :: UpdateDevicePool -> Maybe Text
$sel:maxDevices:UpdateDevicePool' :: UpdateDevicePool -> Maybe Int
$sel:name:UpdateDevicePool' :: UpdateDevicePool -> Maybe Text
$sel:clearMaxDevices:UpdateDevicePool' :: UpdateDevicePool -> Maybe Bool
$sel:rules:UpdateDevicePool' :: UpdateDevicePool -> Maybe [Rule]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"rules" Text -> [Rule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Rule] -> Pair) -> Maybe [Rule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Rule]
rules,
            (Text
"clearMaxDevices" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
clearMaxDevices,
            (Text
"name" 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
name,
            (Text
"maxDevices" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxDevices,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
          ]
      )

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

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

-- | Represents the result of an update device pool request.
--
-- /See:/ 'newUpdateDevicePoolResponse' smart constructor.
data UpdateDevicePoolResponse = UpdateDevicePoolResponse'
  { -- | The device pool you just updated.
    UpdateDevicePoolResponse -> Maybe DevicePool
devicePool :: Prelude.Maybe DevicePool,
    -- | The response's http status code.
    UpdateDevicePoolResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateDevicePoolResponse -> UpdateDevicePoolResponse -> Bool
(UpdateDevicePoolResponse -> UpdateDevicePoolResponse -> Bool)
-> (UpdateDevicePoolResponse -> UpdateDevicePoolResponse -> Bool)
-> Eq UpdateDevicePoolResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDevicePoolResponse -> UpdateDevicePoolResponse -> Bool
$c/= :: UpdateDevicePoolResponse -> UpdateDevicePoolResponse -> Bool
== :: UpdateDevicePoolResponse -> UpdateDevicePoolResponse -> Bool
$c== :: UpdateDevicePoolResponse -> UpdateDevicePoolResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDevicePoolResponse]
ReadPrec UpdateDevicePoolResponse
Int -> ReadS UpdateDevicePoolResponse
ReadS [UpdateDevicePoolResponse]
(Int -> ReadS UpdateDevicePoolResponse)
-> ReadS [UpdateDevicePoolResponse]
-> ReadPrec UpdateDevicePoolResponse
-> ReadPrec [UpdateDevicePoolResponse]
-> Read UpdateDevicePoolResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDevicePoolResponse]
$creadListPrec :: ReadPrec [UpdateDevicePoolResponse]
readPrec :: ReadPrec UpdateDevicePoolResponse
$creadPrec :: ReadPrec UpdateDevicePoolResponse
readList :: ReadS [UpdateDevicePoolResponse]
$creadList :: ReadS [UpdateDevicePoolResponse]
readsPrec :: Int -> ReadS UpdateDevicePoolResponse
$creadsPrec :: Int -> ReadS UpdateDevicePoolResponse
Prelude.Read, Int -> UpdateDevicePoolResponse -> ShowS
[UpdateDevicePoolResponse] -> ShowS
UpdateDevicePoolResponse -> String
(Int -> UpdateDevicePoolResponse -> ShowS)
-> (UpdateDevicePoolResponse -> String)
-> ([UpdateDevicePoolResponse] -> ShowS)
-> Show UpdateDevicePoolResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDevicePoolResponse] -> ShowS
$cshowList :: [UpdateDevicePoolResponse] -> ShowS
show :: UpdateDevicePoolResponse -> String
$cshow :: UpdateDevicePoolResponse -> String
showsPrec :: Int -> UpdateDevicePoolResponse -> ShowS
$cshowsPrec :: Int -> UpdateDevicePoolResponse -> ShowS
Prelude.Show, (forall x.
 UpdateDevicePoolResponse -> Rep UpdateDevicePoolResponse x)
-> (forall x.
    Rep UpdateDevicePoolResponse x -> UpdateDevicePoolResponse)
-> Generic UpdateDevicePoolResponse
forall x.
Rep UpdateDevicePoolResponse x -> UpdateDevicePoolResponse
forall x.
UpdateDevicePoolResponse -> Rep UpdateDevicePoolResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDevicePoolResponse x -> UpdateDevicePoolResponse
$cfrom :: forall x.
UpdateDevicePoolResponse -> Rep UpdateDevicePoolResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDevicePoolResponse' 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:
--
-- 'devicePool', 'updateDevicePoolResponse_devicePool' - The device pool you just updated.
--
-- 'httpStatus', 'updateDevicePoolResponse_httpStatus' - The response's http status code.
newUpdateDevicePoolResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateDevicePoolResponse
newUpdateDevicePoolResponse :: Int -> UpdateDevicePoolResponse
newUpdateDevicePoolResponse Int
pHttpStatus_ =
  UpdateDevicePoolResponse' :: Maybe DevicePool -> Int -> UpdateDevicePoolResponse
UpdateDevicePoolResponse'
    { $sel:devicePool:UpdateDevicePoolResponse' :: Maybe DevicePool
devicePool =
        Maybe DevicePool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateDevicePoolResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The device pool you just updated.
updateDevicePoolResponse_devicePool :: Lens.Lens' UpdateDevicePoolResponse (Prelude.Maybe DevicePool)
updateDevicePoolResponse_devicePool :: (Maybe DevicePool -> f (Maybe DevicePool))
-> UpdateDevicePoolResponse -> f UpdateDevicePoolResponse
updateDevicePoolResponse_devicePool = (UpdateDevicePoolResponse -> Maybe DevicePool)
-> (UpdateDevicePoolResponse
    -> Maybe DevicePool -> UpdateDevicePoolResponse)
-> Lens
     UpdateDevicePoolResponse
     UpdateDevicePoolResponse
     (Maybe DevicePool)
     (Maybe DevicePool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevicePoolResponse' {Maybe DevicePool
devicePool :: Maybe DevicePool
$sel:devicePool:UpdateDevicePoolResponse' :: UpdateDevicePoolResponse -> Maybe DevicePool
devicePool} -> Maybe DevicePool
devicePool) (\s :: UpdateDevicePoolResponse
s@UpdateDevicePoolResponse' {} Maybe DevicePool
a -> UpdateDevicePoolResponse
s {$sel:devicePool:UpdateDevicePoolResponse' :: Maybe DevicePool
devicePool = Maybe DevicePool
a} :: UpdateDevicePoolResponse)

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

instance Prelude.NFData UpdateDevicePoolResponse