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

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

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

    -- * Response Lenses
    updateNetworkProfileResponse_networkProfile,
    updateNetworkProfileResponse_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

-- | /See:/ 'newUpdateNetworkProfile' smart constructor.
data UpdateNetworkProfile = UpdateNetworkProfile'
  { -- | 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,
    -- | 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,
    -- | The name of the network profile about which you are returning
    -- information.
    UpdateNetworkProfile -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Proportion of received packets that fail to arrive from 0 to 100
    -- percent.
    UpdateNetworkProfile -> Maybe Natural
downlinkLossPercent :: Prelude.Maybe Prelude.Natural,
    -- | The type of network profile to return information about. Valid values
    -- are listed here.
    UpdateNetworkProfile -> Maybe NetworkProfileType
type' :: Prelude.Maybe NetworkProfileType,
    -- | Delay time for all packets to destination in milliseconds as an integer
    -- from 0 to 2000.
    UpdateNetworkProfile -> Maybe Integer
uplinkDelayMs :: Prelude.Maybe Prelude.Integer,
    -- | The data throughput rate in bits per second, as an integer from 0 to
    -- 104857600.
    UpdateNetworkProfile -> Maybe Integer
uplinkBandwidthBits :: Prelude.Maybe Prelude.Integer,
    -- | The description of the network profile about which you are returning
    -- information.
    UpdateNetworkProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Delay time for all packets to destination in milliseconds as an integer
    -- from 0 to 2000.
    UpdateNetworkProfile -> Maybe Integer
downlinkDelayMs :: Prelude.Maybe Prelude.Integer,
    -- | The data throughput rate in bits per second, as an integer from 0 to
    -- 104857600.
    UpdateNetworkProfile -> Maybe Integer
downlinkBandwidthBits :: Prelude.Maybe Prelude.Integer,
    -- | 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
(UpdateNetworkProfile -> UpdateNetworkProfile -> Bool)
-> (UpdateNetworkProfile -> UpdateNetworkProfile -> Bool)
-> Eq UpdateNetworkProfile
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]
(Int -> ReadS UpdateNetworkProfile)
-> ReadS [UpdateNetworkProfile]
-> ReadPrec UpdateNetworkProfile
-> ReadPrec [UpdateNetworkProfile]
-> Read 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
(Int -> UpdateNetworkProfile -> ShowS)
-> (UpdateNetworkProfile -> String)
-> ([UpdateNetworkProfile] -> ShowS)
-> Show UpdateNetworkProfile
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. UpdateNetworkProfile -> Rep UpdateNetworkProfile x)
-> (forall x. Rep UpdateNetworkProfile x -> UpdateNetworkProfile)
-> Generic UpdateNetworkProfile
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:
--
-- '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.
--
-- 'downlinkJitterMs', 'updateNetworkProfile_downlinkJitterMs' - Time variation in the delay of received packets in milliseconds as an
-- integer from 0 to 2000.
--
-- 'name', 'updateNetworkProfile_name' - The name of the network profile about which you are returning
-- information.
--
-- 'downlinkLossPercent', 'updateNetworkProfile_downlinkLossPercent' - Proportion of received packets that fail to arrive from 0 to 100
-- percent.
--
-- 'type'', 'updateNetworkProfile_type' - The type of network profile to return information about. Valid values
-- are listed here.
--
-- 'uplinkDelayMs', 'updateNetworkProfile_uplinkDelayMs' - Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
--
-- 'uplinkBandwidthBits', 'updateNetworkProfile_uplinkBandwidthBits' - The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
--
-- 'description', 'updateNetworkProfile_description' - The description of the network profile about which you are returning
-- information.
--
-- 'downlinkDelayMs', 'updateNetworkProfile_downlinkDelayMs' - Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
--
-- 'downlinkBandwidthBits', 'updateNetworkProfile_downlinkBandwidthBits' - The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
--
-- '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' :: Maybe Integer
-> Maybe Natural
-> Maybe Integer
-> Maybe Text
-> Maybe Natural
-> Maybe NetworkProfileType
-> Maybe Integer
-> Maybe Integer
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Text
-> UpdateNetworkProfile
UpdateNetworkProfile'
    { $sel:uplinkJitterMs:UpdateNetworkProfile' :: Maybe Integer
uplinkJitterMs =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkLossPercent:UpdateNetworkProfile' :: Maybe Natural
uplinkLossPercent = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkJitterMs:UpdateNetworkProfile' :: Maybe Integer
downlinkJitterMs = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateNetworkProfile' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkLossPercent:UpdateNetworkProfile' :: Maybe Natural
downlinkLossPercent = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:type':UpdateNetworkProfile' :: Maybe NetworkProfileType
type' = Maybe NetworkProfileType
forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkDelayMs:UpdateNetworkProfile' :: Maybe Integer
uplinkDelayMs = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkBandwidthBits:UpdateNetworkProfile' :: Maybe Integer
uplinkBandwidthBits = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateNetworkProfile' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkDelayMs:UpdateNetworkProfile' :: Maybe Integer
downlinkDelayMs = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkBandwidthBits:UpdateNetworkProfile' :: Maybe Integer
downlinkBandwidthBits = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateNetworkProfile' :: Text
arn = Text
pArn_
    }

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_uplinkJitterMs = (UpdateNetworkProfile -> Maybe Integer)
-> (UpdateNetworkProfile -> Maybe Integer -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Integer)
     (Maybe Integer)
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 :: (Maybe Natural -> f (Maybe Natural))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_uplinkLossPercent = (UpdateNetworkProfile -> Maybe Natural)
-> (UpdateNetworkProfile -> Maybe Natural -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Natural)
     (Maybe Natural)
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)

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_downlinkJitterMs = (UpdateNetworkProfile -> Maybe Integer)
-> (UpdateNetworkProfile -> Maybe Integer -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Integer)
     (Maybe Integer)
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)

-- | The name of the network profile about which you are returning
-- information.
updateNetworkProfile_name :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_name :: (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_name = (UpdateNetworkProfile -> Maybe Text)
-> (UpdateNetworkProfile -> Maybe Text -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile UpdateNetworkProfile (Maybe Text) (Maybe Text)
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)

-- | Proportion of received packets that fail to arrive from 0 to 100
-- percent.
updateNetworkProfile_downlinkLossPercent :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Natural)
updateNetworkProfile_downlinkLossPercent :: (Maybe Natural -> f (Maybe Natural))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_downlinkLossPercent = (UpdateNetworkProfile -> Maybe Natural)
-> (UpdateNetworkProfile -> Maybe Natural -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Natural)
     (Maybe Natural)
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 type of network profile to return information about. Valid values
-- are listed here.
updateNetworkProfile_type :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe NetworkProfileType)
updateNetworkProfile_type :: (Maybe NetworkProfileType -> f (Maybe NetworkProfileType))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_type = (UpdateNetworkProfile -> Maybe NetworkProfileType)
-> (UpdateNetworkProfile
    -> Maybe NetworkProfileType -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe NetworkProfileType)
     (Maybe NetworkProfileType)
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)

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_uplinkDelayMs = (UpdateNetworkProfile -> Maybe Integer)
-> (UpdateNetworkProfile -> Maybe Integer -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Integer)
     (Maybe Integer)
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)

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_uplinkBandwidthBits = (UpdateNetworkProfile -> Maybe Integer)
-> (UpdateNetworkProfile -> Maybe Integer -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Integer)
     (Maybe Integer)
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)

-- | The description of the network profile about which you are returning
-- information.
updateNetworkProfile_description :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_description :: (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_description = (UpdateNetworkProfile -> Maybe Text)
-> (UpdateNetworkProfile -> Maybe Text -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile UpdateNetworkProfile (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_downlinkDelayMs = (UpdateNetworkProfile -> Maybe Integer)
-> (UpdateNetworkProfile -> Maybe Integer -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Integer)
     (Maybe Integer)
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)

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_downlinkBandwidthBits = (UpdateNetworkProfile -> Maybe Integer)
-> (UpdateNetworkProfile -> Maybe Integer -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe Integer)
     (Maybe Integer)
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)

-- | 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 :: (Text -> f Text) -> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_arn = (UpdateNetworkProfile -> Text)
-> (UpdateNetworkProfile -> Text -> UpdateNetworkProfile)
-> Lens UpdateNetworkProfile UpdateNetworkProfile Text Text
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 :: UpdateNetworkProfile -> Request UpdateNetworkProfile
request = Service -> UpdateNetworkProfile -> Request UpdateNetworkProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateNetworkProfile)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateNetworkProfile))
-> Logger
-> Service
-> Proxy UpdateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateNetworkProfile)))
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 NetworkProfile -> Int -> UpdateNetworkProfileResponse
UpdateNetworkProfileResponse'
            (Maybe NetworkProfile -> Int -> UpdateNetworkProfileResponse)
-> Either String (Maybe NetworkProfile)
-> Either String (Int -> UpdateNetworkProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe NetworkProfile)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"networkProfile")
            Either String (Int -> UpdateNetworkProfileResponse)
-> Either String Int -> Either String UpdateNetworkProfileResponse
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 UpdateNetworkProfile

instance Prelude.NFData UpdateNetworkProfile

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

instance Core.ToQuery UpdateNetworkProfile where
  toQuery :: UpdateNetworkProfile -> QueryString
toQuery = QueryString -> UpdateNetworkProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(UpdateNetworkProfileResponse
 -> UpdateNetworkProfileResponse -> Bool)
-> (UpdateNetworkProfileResponse
    -> UpdateNetworkProfileResponse -> Bool)
-> Eq UpdateNetworkProfileResponse
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]
(Int -> ReadS UpdateNetworkProfileResponse)
-> ReadS [UpdateNetworkProfileResponse]
-> ReadPrec UpdateNetworkProfileResponse
-> ReadPrec [UpdateNetworkProfileResponse]
-> Read 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
(Int -> UpdateNetworkProfileResponse -> ShowS)
-> (UpdateNetworkProfileResponse -> String)
-> ([UpdateNetworkProfileResponse] -> ShowS)
-> Show UpdateNetworkProfileResponse
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.
 UpdateNetworkProfileResponse -> Rep UpdateNetworkProfileResponse x)
-> (forall x.
    Rep UpdateNetworkProfileResponse x -> UpdateNetworkProfileResponse)
-> Generic UpdateNetworkProfileResponse
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' :: Maybe NetworkProfile -> Int -> UpdateNetworkProfileResponse
UpdateNetworkProfileResponse'
    { $sel:networkProfile:UpdateNetworkProfileResponse' :: Maybe NetworkProfile
networkProfile =
        Maybe 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 :: (Maybe NetworkProfile -> f (Maybe NetworkProfile))
-> UpdateNetworkProfileResponse -> f UpdateNetworkProfileResponse
updateNetworkProfileResponse_networkProfile = (UpdateNetworkProfileResponse -> Maybe NetworkProfile)
-> (UpdateNetworkProfileResponse
    -> Maybe NetworkProfile -> UpdateNetworkProfileResponse)
-> Lens
     UpdateNetworkProfileResponse
     UpdateNetworkProfileResponse
     (Maybe NetworkProfile)
     (Maybe 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 :: (Int -> f Int)
-> UpdateNetworkProfileResponse -> f UpdateNetworkProfileResponse
updateNetworkProfileResponse_httpStatus = (UpdateNetworkProfileResponse -> Int)
-> (UpdateNetworkProfileResponse
    -> Int -> UpdateNetworkProfileResponse)
-> Lens
     UpdateNetworkProfileResponse UpdateNetworkProfileResponse Int Int
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