{-# 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.UpdateNetworkProfile
-- 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 the network profile.
module Amazonka.DeviceFarm.UpdateNetworkProfile
  ( -- * Creating a Request
    UpdateNetworkProfile (..),
    newUpdateNetworkProfile,

    -- * Request Lenses
    updateNetworkProfile_description,
    updateNetworkProfile_downlinkBandwidthBits,
    updateNetworkProfile_downlinkDelayMs,
    updateNetworkProfile_downlinkJitterMs,
    updateNetworkProfile_downlinkLossPercent,
    updateNetworkProfile_name,
    updateNetworkProfile_type,
    updateNetworkProfile_uplinkBandwidthBits,
    updateNetworkProfile_uplinkDelayMs,
    updateNetworkProfile_uplinkJitterMs,
    updateNetworkProfile_uplinkLossPercent,
    updateNetworkProfile_arn,

    -- * Destructuring the Response
    UpdateNetworkProfileResponse (..),
    newUpdateNetworkProfileResponse,

    -- * Response Lenses
    updateNetworkProfileResponse_networkProfile,
    updateNetworkProfileResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateNetworkProfile' smart constructor.
data UpdateNetworkProfile = UpdateNetworkProfile'
  { -- | The description of the network profile about which you are returning
    -- information.
    UpdateNetworkProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The data throughput rate in bits per second, as an integer from 0 to
    -- 104857600.
    UpdateNetworkProfile -> Maybe Integer
downlinkBandwidthBits :: Prelude.Maybe Prelude.Integer,
    -- | Delay time for all packets to destination in milliseconds as an integer
    -- from 0 to 2000.
    UpdateNetworkProfile -> Maybe Integer
downlinkDelayMs :: Prelude.Maybe Prelude.Integer,
    -- | Time variation in the delay of received packets in milliseconds as an
    -- integer from 0 to 2000.
    UpdateNetworkProfile -> Maybe Integer
downlinkJitterMs :: Prelude.Maybe Prelude.Integer,
    -- | Proportion of received packets that fail to arrive from 0 to 100
    -- percent.
    UpdateNetworkProfile -> Maybe Natural
downlinkLossPercent :: Prelude.Maybe Prelude.Natural,
    -- | The name of the network profile about which you are returning
    -- information.
    UpdateNetworkProfile -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of network profile to return information about. Valid values
    -- are listed here.
    UpdateNetworkProfile -> Maybe NetworkProfileType
type' :: Prelude.Maybe NetworkProfileType,
    -- | The data throughput rate in bits per second, as an integer from 0 to
    -- 104857600.
    UpdateNetworkProfile -> Maybe Integer
uplinkBandwidthBits :: Prelude.Maybe Prelude.Integer,
    -- | Delay time for all packets to destination in milliseconds as an integer
    -- from 0 to 2000.
    UpdateNetworkProfile -> Maybe Integer
uplinkDelayMs :: Prelude.Maybe Prelude.Integer,
    -- | Time variation in the delay of received packets in milliseconds as an
    -- integer from 0 to 2000.
    UpdateNetworkProfile -> Maybe Integer
uplinkJitterMs :: Prelude.Maybe Prelude.Integer,
    -- | Proportion of transmitted packets that fail to arrive from 0 to 100
    -- percent.
    UpdateNetworkProfile -> Maybe Natural
uplinkLossPercent :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the project for which you want to
    -- update network profile settings.
    UpdateNetworkProfile -> Text
arn :: Prelude.Text
  }
  deriving (UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
$c/= :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
== :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
$c== :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
Prelude.Eq, ReadPrec [UpdateNetworkProfile]
ReadPrec UpdateNetworkProfile
Int -> ReadS UpdateNetworkProfile
ReadS [UpdateNetworkProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateNetworkProfile]
$creadListPrec :: ReadPrec [UpdateNetworkProfile]
readPrec :: ReadPrec UpdateNetworkProfile
$creadPrec :: ReadPrec UpdateNetworkProfile
readList :: ReadS [UpdateNetworkProfile]
$creadList :: ReadS [UpdateNetworkProfile]
readsPrec :: Int -> ReadS UpdateNetworkProfile
$creadsPrec :: Int -> ReadS UpdateNetworkProfile
Prelude.Read, Int -> UpdateNetworkProfile -> ShowS
[UpdateNetworkProfile] -> ShowS
UpdateNetworkProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNetworkProfile] -> ShowS
$cshowList :: [UpdateNetworkProfile] -> ShowS
show :: UpdateNetworkProfile -> String
$cshow :: UpdateNetworkProfile -> String
showsPrec :: Int -> UpdateNetworkProfile -> ShowS
$cshowsPrec :: Int -> UpdateNetworkProfile -> ShowS
Prelude.Show, forall x. Rep UpdateNetworkProfile x -> UpdateNetworkProfile
forall x. UpdateNetworkProfile -> Rep UpdateNetworkProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateNetworkProfile x -> UpdateNetworkProfile
$cfrom :: forall x. UpdateNetworkProfile -> Rep UpdateNetworkProfile x
Prelude.Generic)

-- |
-- Create a value of 'UpdateNetworkProfile' 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:
--
-- 'description', 'updateNetworkProfile_description' - The description of the network profile about which you are returning
-- information.
--
-- 'downlinkBandwidthBits', 'updateNetworkProfile_downlinkBandwidthBits' - The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
--
-- 'downlinkDelayMs', 'updateNetworkProfile_downlinkDelayMs' - Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
--
-- 'downlinkJitterMs', 'updateNetworkProfile_downlinkJitterMs' - Time variation in the delay of received packets in milliseconds as an
-- integer from 0 to 2000.
--
-- 'downlinkLossPercent', 'updateNetworkProfile_downlinkLossPercent' - Proportion of received packets that fail to arrive from 0 to 100
-- percent.
--
-- 'name', 'updateNetworkProfile_name' - The name of the network profile about which you are returning
-- information.
--
-- 'type'', 'updateNetworkProfile_type' - The type of network profile to return information about. Valid values
-- are listed here.
--
-- 'uplinkBandwidthBits', 'updateNetworkProfile_uplinkBandwidthBits' - The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
--
-- 'uplinkDelayMs', 'updateNetworkProfile_uplinkDelayMs' - Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
--
-- 'uplinkJitterMs', 'updateNetworkProfile_uplinkJitterMs' - Time variation in the delay of received packets in milliseconds as an
-- integer from 0 to 2000.
--
-- 'uplinkLossPercent', 'updateNetworkProfile_uplinkLossPercent' - Proportion of transmitted packets that fail to arrive from 0 to 100
-- percent.
--
-- 'arn', 'updateNetworkProfile_arn' - The Amazon Resource Name (ARN) of the project for which you want to
-- update network profile settings.
newUpdateNetworkProfile ::
  -- | 'arn'
  Prelude.Text ->
  UpdateNetworkProfile
newUpdateNetworkProfile :: Text -> UpdateNetworkProfile
newUpdateNetworkProfile Text
pArn_ =
  UpdateNetworkProfile'
    { $sel:description:UpdateNetworkProfile' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkBandwidthBits:UpdateNetworkProfile' :: Maybe Integer
downlinkBandwidthBits = forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkDelayMs:UpdateNetworkProfile' :: Maybe Integer
downlinkDelayMs = forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkJitterMs:UpdateNetworkProfile' :: Maybe Integer
downlinkJitterMs = forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkLossPercent:UpdateNetworkProfile' :: Maybe Natural
downlinkLossPercent = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateNetworkProfile' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:type':UpdateNetworkProfile' :: Maybe NetworkProfileType
type' = forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkBandwidthBits:UpdateNetworkProfile' :: Maybe Integer
uplinkBandwidthBits = forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkDelayMs:UpdateNetworkProfile' :: Maybe Integer
uplinkDelayMs = forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkJitterMs:UpdateNetworkProfile' :: Maybe Integer
uplinkJitterMs = forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkLossPercent:UpdateNetworkProfile' :: Maybe Natural
uplinkLossPercent = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateNetworkProfile' :: Text
arn = Text
pArn_
    }

-- | The description of the network profile about which you are returning
-- information.
updateNetworkProfile_description :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_description :: Lens' UpdateNetworkProfile (Maybe Text)
updateNetworkProfile_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Text
description :: Maybe Text
$sel:description:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Text
a -> UpdateNetworkProfile
s {$sel:description:UpdateNetworkProfile' :: Maybe Text
description = Maybe Text
a} :: UpdateNetworkProfile)

-- | The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
updateNetworkProfile_downlinkBandwidthBits :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Integer)
updateNetworkProfile_downlinkBandwidthBits :: Lens' UpdateNetworkProfile (Maybe Integer)
updateNetworkProfile_downlinkBandwidthBits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Integer
downlinkBandwidthBits :: Maybe Integer
$sel:downlinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
downlinkBandwidthBits} -> Maybe Integer
downlinkBandwidthBits) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Integer
a -> UpdateNetworkProfile
s {$sel:downlinkBandwidthBits:UpdateNetworkProfile' :: Maybe Integer
downlinkBandwidthBits = Maybe Integer
a} :: UpdateNetworkProfile)

-- | Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
updateNetworkProfile_downlinkDelayMs :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Integer)
updateNetworkProfile_downlinkDelayMs :: Lens' UpdateNetworkProfile (Maybe Integer)
updateNetworkProfile_downlinkDelayMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Integer
downlinkDelayMs :: Maybe Integer
$sel:downlinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
downlinkDelayMs} -> Maybe Integer
downlinkDelayMs) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Integer
a -> UpdateNetworkProfile
s {$sel:downlinkDelayMs:UpdateNetworkProfile' :: Maybe Integer
downlinkDelayMs = Maybe Integer
a} :: UpdateNetworkProfile)

-- | Time variation in the delay of received packets in milliseconds as an
-- integer from 0 to 2000.
updateNetworkProfile_downlinkJitterMs :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Integer)
updateNetworkProfile_downlinkJitterMs :: Lens' UpdateNetworkProfile (Maybe Integer)
updateNetworkProfile_downlinkJitterMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Integer
downlinkJitterMs :: Maybe Integer
$sel:downlinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
downlinkJitterMs} -> Maybe Integer
downlinkJitterMs) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Integer
a -> UpdateNetworkProfile
s {$sel:downlinkJitterMs:UpdateNetworkProfile' :: Maybe Integer
downlinkJitterMs = Maybe Integer
a} :: UpdateNetworkProfile)

-- | Proportion of received packets that fail to arrive from 0 to 100
-- percent.
updateNetworkProfile_downlinkLossPercent :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Natural)
updateNetworkProfile_downlinkLossPercent :: Lens' UpdateNetworkProfile (Maybe Natural)
updateNetworkProfile_downlinkLossPercent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Natural
downlinkLossPercent :: Maybe Natural
$sel:downlinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
downlinkLossPercent} -> Maybe Natural
downlinkLossPercent) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Natural
a -> UpdateNetworkProfile
s {$sel:downlinkLossPercent:UpdateNetworkProfile' :: Maybe Natural
downlinkLossPercent = Maybe Natural
a} :: UpdateNetworkProfile)

-- | The name of the network profile about which you are returning
-- information.
updateNetworkProfile_name :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_name :: Lens' UpdateNetworkProfile (Maybe Text)
updateNetworkProfile_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Text
name :: Maybe Text
$sel:name:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Text
a -> UpdateNetworkProfile
s {$sel:name:UpdateNetworkProfile' :: Maybe Text
name = Maybe Text
a} :: UpdateNetworkProfile)

-- | The type of network profile to return information about. Valid values
-- are listed here.
updateNetworkProfile_type :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe NetworkProfileType)
updateNetworkProfile_type :: Lens' UpdateNetworkProfile (Maybe NetworkProfileType)
updateNetworkProfile_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe NetworkProfileType
type' :: Maybe NetworkProfileType
$sel:type':UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe NetworkProfileType
type'} -> Maybe NetworkProfileType
type') (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe NetworkProfileType
a -> UpdateNetworkProfile
s {$sel:type':UpdateNetworkProfile' :: Maybe NetworkProfileType
type' = Maybe NetworkProfileType
a} :: UpdateNetworkProfile)

-- | The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
updateNetworkProfile_uplinkBandwidthBits :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Integer)
updateNetworkProfile_uplinkBandwidthBits :: Lens' UpdateNetworkProfile (Maybe Integer)
updateNetworkProfile_uplinkBandwidthBits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Integer
uplinkBandwidthBits :: Maybe Integer
$sel:uplinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
uplinkBandwidthBits} -> Maybe Integer
uplinkBandwidthBits) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Integer
a -> UpdateNetworkProfile
s {$sel:uplinkBandwidthBits:UpdateNetworkProfile' :: Maybe Integer
uplinkBandwidthBits = Maybe Integer
a} :: UpdateNetworkProfile)

-- | Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
updateNetworkProfile_uplinkDelayMs :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Integer)
updateNetworkProfile_uplinkDelayMs :: Lens' UpdateNetworkProfile (Maybe Integer)
updateNetworkProfile_uplinkDelayMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Integer
uplinkDelayMs :: Maybe Integer
$sel:uplinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
uplinkDelayMs} -> Maybe Integer
uplinkDelayMs) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Integer
a -> UpdateNetworkProfile
s {$sel:uplinkDelayMs:UpdateNetworkProfile' :: Maybe Integer
uplinkDelayMs = Maybe Integer
a} :: UpdateNetworkProfile)

-- | Time variation in the delay of received packets in milliseconds as an
-- integer from 0 to 2000.
updateNetworkProfile_uplinkJitterMs :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Integer)
updateNetworkProfile_uplinkJitterMs :: Lens' UpdateNetworkProfile (Maybe Integer)
updateNetworkProfile_uplinkJitterMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Integer
uplinkJitterMs :: Maybe Integer
$sel:uplinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
uplinkJitterMs} -> Maybe Integer
uplinkJitterMs) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Integer
a -> UpdateNetworkProfile
s {$sel:uplinkJitterMs:UpdateNetworkProfile' :: Maybe Integer
uplinkJitterMs = Maybe Integer
a} :: UpdateNetworkProfile)

-- | Proportion of transmitted packets that fail to arrive from 0 to 100
-- percent.
updateNetworkProfile_uplinkLossPercent :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Natural)
updateNetworkProfile_uplinkLossPercent :: Lens' UpdateNetworkProfile (Maybe Natural)
updateNetworkProfile_uplinkLossPercent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Natural
uplinkLossPercent :: Maybe Natural
$sel:uplinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
uplinkLossPercent} -> Maybe Natural
uplinkLossPercent) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Natural
a -> UpdateNetworkProfile
s {$sel:uplinkLossPercent:UpdateNetworkProfile' :: Maybe Natural
uplinkLossPercent = Maybe Natural
a} :: UpdateNetworkProfile)

-- | The Amazon Resource Name (ARN) of the project for which you want to
-- update network profile settings.
updateNetworkProfile_arn :: Lens.Lens' UpdateNetworkProfile Prelude.Text
updateNetworkProfile_arn :: Lens' UpdateNetworkProfile Text
updateNetworkProfile_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Text
arn :: Text
$sel:arn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Text
arn} -> Text
arn) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Text
a -> UpdateNetworkProfile
s {$sel:arn:UpdateNetworkProfile' :: Text
arn = Text
a} :: UpdateNetworkProfile)

instance Core.AWSRequest UpdateNetworkProfile where
  type
    AWSResponse UpdateNetworkProfile =
      UpdateNetworkProfileResponse
  request :: (Service -> Service)
-> UpdateNetworkProfile -> Request UpdateNetworkProfile
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 UpdateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateNetworkProfile)))
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 NetworkProfile -> Int -> UpdateNetworkProfileResponse
UpdateNetworkProfileResponse'
            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
"networkProfile")
            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 UpdateNetworkProfile where
  hashWithSalt :: Int -> UpdateNetworkProfile -> Int
hashWithSalt Int
_salt UpdateNetworkProfile' {Maybe Integer
Maybe Natural
Maybe Text
Maybe NetworkProfileType
Text
arn :: Text
uplinkLossPercent :: Maybe Natural
uplinkJitterMs :: Maybe Integer
uplinkDelayMs :: Maybe Integer
uplinkBandwidthBits :: Maybe Integer
type' :: Maybe NetworkProfileType
name :: Maybe Text
downlinkLossPercent :: Maybe Natural
downlinkJitterMs :: Maybe Integer
downlinkDelayMs :: Maybe Integer
downlinkBandwidthBits :: Maybe Integer
description :: Maybe Text
$sel:arn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Text
$sel:uplinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
$sel:uplinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:uplinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:uplinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:type':UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe NetworkProfileType
$sel:name:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
$sel:downlinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
$sel:downlinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:downlinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:downlinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:description:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
downlinkBandwidthBits
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
downlinkDelayMs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
downlinkJitterMs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
downlinkLossPercent
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkProfileType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
uplinkBandwidthBits
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
uplinkDelayMs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
uplinkJitterMs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
uplinkLossPercent
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData UpdateNetworkProfile where
  rnf :: UpdateNetworkProfile -> ()
rnf UpdateNetworkProfile' {Maybe Integer
Maybe Natural
Maybe Text
Maybe NetworkProfileType
Text
arn :: Text
uplinkLossPercent :: Maybe Natural
uplinkJitterMs :: Maybe Integer
uplinkDelayMs :: Maybe Integer
uplinkBandwidthBits :: Maybe Integer
type' :: Maybe NetworkProfileType
name :: Maybe Text
downlinkLossPercent :: Maybe Natural
downlinkJitterMs :: Maybe Integer
downlinkDelayMs :: Maybe Integer
downlinkBandwidthBits :: Maybe Integer
description :: Maybe Text
$sel:arn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Text
$sel:uplinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
$sel:uplinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:uplinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:uplinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:type':UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe NetworkProfileType
$sel:name:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
$sel:downlinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
$sel:downlinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:downlinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:downlinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:description:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
..} =
    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 Integer
downlinkBandwidthBits
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
downlinkDelayMs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
downlinkJitterMs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
downlinkLossPercent
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkProfileType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
uplinkBandwidthBits
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
uplinkDelayMs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
uplinkJitterMs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
uplinkLossPercent
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn

instance Data.ToHeaders UpdateNetworkProfile where
  toHeaders :: UpdateNetworkProfile -> 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
"DeviceFarm_20150623.UpdateNetworkProfile" ::
                          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 UpdateNetworkProfile where
  toJSON :: UpdateNetworkProfile -> Value
toJSON UpdateNetworkProfile' {Maybe Integer
Maybe Natural
Maybe Text
Maybe NetworkProfileType
Text
arn :: Text
uplinkLossPercent :: Maybe Natural
uplinkJitterMs :: Maybe Integer
uplinkDelayMs :: Maybe Integer
uplinkBandwidthBits :: Maybe Integer
type' :: Maybe NetworkProfileType
name :: Maybe Text
downlinkLossPercent :: Maybe Natural
downlinkJitterMs :: Maybe Integer
downlinkDelayMs :: Maybe Integer
downlinkBandwidthBits :: Maybe Integer
description :: Maybe Text
$sel:arn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Text
$sel:uplinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
$sel:uplinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:uplinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:uplinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:type':UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe NetworkProfileType
$sel:name:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
$sel:downlinkLossPercent:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Natural
$sel:downlinkJitterMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:downlinkDelayMs:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:downlinkBandwidthBits:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Integer
$sel:description:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"downlinkBandwidthBits" 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 Integer
downlinkBandwidthBits,
            (Key
"downlinkDelayMs" 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 Integer
downlinkDelayMs,
            (Key
"downlinkJitterMs" 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 Integer
downlinkJitterMs,
            (Key
"downlinkLossPercent" 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 Natural
downlinkLossPercent,
            (Key
"name" 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
name,
            (Key
"type" 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 NetworkProfileType
type',
            (Key
"uplinkBandwidthBits" 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 Integer
uplinkBandwidthBits,
            (Key
"uplinkDelayMs" 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 Integer
uplinkDelayMs,
            (Key
"uplinkJitterMs" 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 Integer
uplinkJitterMs,
            (Key
"uplinkLossPercent" 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 Natural
uplinkLossPercent,
            forall a. a -> Maybe a
Prelude.Just (Key
"arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateNetworkProfileResponse' 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:
--
-- 'networkProfile', 'updateNetworkProfileResponse_networkProfile' - A list of the available network profiles.
--
-- 'httpStatus', 'updateNetworkProfileResponse_httpStatus' - The response's http status code.
newUpdateNetworkProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateNetworkProfileResponse
newUpdateNetworkProfileResponse :: Int -> UpdateNetworkProfileResponse
newUpdateNetworkProfileResponse Int
pHttpStatus_ =
  UpdateNetworkProfileResponse'
    { $sel:networkProfile:UpdateNetworkProfileResponse' :: Maybe NetworkProfile
networkProfile =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateNetworkProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of the available network profiles.
updateNetworkProfileResponse_networkProfile :: Lens.Lens' UpdateNetworkProfileResponse (Prelude.Maybe NetworkProfile)
updateNetworkProfileResponse_networkProfile :: Lens' UpdateNetworkProfileResponse (Maybe NetworkProfile)
updateNetworkProfileResponse_networkProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfileResponse' {Maybe NetworkProfile
networkProfile :: Maybe NetworkProfile
$sel:networkProfile:UpdateNetworkProfileResponse' :: UpdateNetworkProfileResponse -> Maybe NetworkProfile
networkProfile} -> Maybe NetworkProfile
networkProfile) (\s :: UpdateNetworkProfileResponse
s@UpdateNetworkProfileResponse' {} Maybe NetworkProfile
a -> UpdateNetworkProfileResponse
s {$sel:networkProfile:UpdateNetworkProfileResponse' :: Maybe NetworkProfile
networkProfile = Maybe NetworkProfile
a} :: UpdateNetworkProfileResponse)

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

instance Prelude.NFData UpdateNetworkProfileResponse where
  rnf :: UpdateNetworkProfileResponse -> ()
rnf UpdateNetworkProfileResponse' {Int
Maybe NetworkProfile
httpStatus :: Int
networkProfile :: Maybe NetworkProfile
$sel:httpStatus:UpdateNetworkProfileResponse' :: UpdateNetworkProfileResponse -> Int
$sel:networkProfile:UpdateNetworkProfileResponse' :: UpdateNetworkProfileResponse -> Maybe NetworkProfile
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkProfile
networkProfile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus