{-# 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.CreateNetworkProfile
-- 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)
--
-- Creates a network profile.
module Amazonka.DeviceFarm.CreateNetworkProfile
  ( -- * Creating a Request
    CreateNetworkProfile (..),
    newCreateNetworkProfile,

    -- * Request Lenses
    createNetworkProfile_uplinkJitterMs,
    createNetworkProfile_uplinkLossPercent,
    createNetworkProfile_downlinkJitterMs,
    createNetworkProfile_downlinkLossPercent,
    createNetworkProfile_type,
    createNetworkProfile_uplinkDelayMs,
    createNetworkProfile_uplinkBandwidthBits,
    createNetworkProfile_description,
    createNetworkProfile_downlinkDelayMs,
    createNetworkProfile_downlinkBandwidthBits,
    createNetworkProfile_projectArn,
    createNetworkProfile_name,

    -- * Destructuring the Response
    CreateNetworkProfileResponse (..),
    newCreateNetworkProfileResponse,

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

-- |
-- Create a value of 'CreateNetworkProfile' 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', 'createNetworkProfile_uplinkJitterMs' - Time variation in the delay of received packets in milliseconds as an
-- integer from 0 to 2000.
--
-- 'uplinkLossPercent', 'createNetworkProfile_uplinkLossPercent' - Proportion of transmitted packets that fail to arrive from 0 to 100
-- percent.
--
-- 'downlinkJitterMs', 'createNetworkProfile_downlinkJitterMs' - Time variation in the delay of received packets in milliseconds as an
-- integer from 0 to 2000.
--
-- 'downlinkLossPercent', 'createNetworkProfile_downlinkLossPercent' - Proportion of received packets that fail to arrive from 0 to 100
-- percent.
--
-- 'type'', 'createNetworkProfile_type' - The type of network profile to create. Valid values are listed here.
--
-- 'uplinkDelayMs', 'createNetworkProfile_uplinkDelayMs' - Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
--
-- 'uplinkBandwidthBits', 'createNetworkProfile_uplinkBandwidthBits' - The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
--
-- 'description', 'createNetworkProfile_description' - The description of the network profile.
--
-- 'downlinkDelayMs', 'createNetworkProfile_downlinkDelayMs' - Delay time for all packets to destination in milliseconds as an integer
-- from 0 to 2000.
--
-- 'downlinkBandwidthBits', 'createNetworkProfile_downlinkBandwidthBits' - The data throughput rate in bits per second, as an integer from 0 to
-- 104857600.
--
-- 'projectArn', 'createNetworkProfile_projectArn' - The Amazon Resource Name (ARN) of the project for which you want to
-- create a network profile.
--
-- 'name', 'createNetworkProfile_name' - The name for the new network profile.
newCreateNetworkProfile ::
  -- | 'projectArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  CreateNetworkProfile
newCreateNetworkProfile :: Text -> Text -> CreateNetworkProfile
newCreateNetworkProfile Text
pProjectArn_ Text
pName_ =
  CreateNetworkProfile' :: Maybe Integer
-> Maybe Natural
-> Maybe Integer
-> Maybe Natural
-> Maybe NetworkProfileType
-> Maybe Integer
-> Maybe Integer
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Text
-> Text
-> CreateNetworkProfile
CreateNetworkProfile'
    { $sel:uplinkJitterMs:CreateNetworkProfile' :: Maybe Integer
uplinkJitterMs =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkLossPercent:CreateNetworkProfile' :: Maybe Natural
uplinkLossPercent = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkJitterMs:CreateNetworkProfile' :: Maybe Integer
downlinkJitterMs = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkLossPercent:CreateNetworkProfile' :: Maybe Natural
downlinkLossPercent = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:type':CreateNetworkProfile' :: Maybe NetworkProfileType
type' = Maybe NetworkProfileType
forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkDelayMs:CreateNetworkProfile' :: Maybe Integer
uplinkDelayMs = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:uplinkBandwidthBits:CreateNetworkProfile' :: Maybe Integer
uplinkBandwidthBits = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateNetworkProfile' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkDelayMs:CreateNetworkProfile' :: Maybe Integer
downlinkDelayMs = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:downlinkBandwidthBits:CreateNetworkProfile' :: Maybe Integer
downlinkBandwidthBits = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:projectArn:CreateNetworkProfile' :: Text
projectArn = Text
pProjectArn_,
      $sel:name:CreateNetworkProfile' :: Text
name = Text
pName_
    }

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

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

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

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

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

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

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

-- | The description of the network profile.
createNetworkProfile_description :: Lens.Lens' CreateNetworkProfile (Prelude.Maybe Prelude.Text)
createNetworkProfile_description :: (Maybe Text -> f (Maybe Text))
-> CreateNetworkProfile -> f CreateNetworkProfile
createNetworkProfile_description = (CreateNetworkProfile -> Maybe Text)
-> (CreateNetworkProfile -> Maybe Text -> CreateNetworkProfile)
-> Lens
     CreateNetworkProfile CreateNetworkProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Maybe Text
description :: Maybe Text
$sel:description:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Maybe Text
a -> CreateNetworkProfile
s {$sel:description:CreateNetworkProfile' :: Maybe Text
description = Maybe Text
a} :: CreateNetworkProfile)

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

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

-- | The Amazon Resource Name (ARN) of the project for which you want to
-- create a network profile.
createNetworkProfile_projectArn :: Lens.Lens' CreateNetworkProfile Prelude.Text
createNetworkProfile_projectArn :: (Text -> f Text) -> CreateNetworkProfile -> f CreateNetworkProfile
createNetworkProfile_projectArn = (CreateNetworkProfile -> Text)
-> (CreateNetworkProfile -> Text -> CreateNetworkProfile)
-> Lens CreateNetworkProfile CreateNetworkProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Text
projectArn :: Text
$sel:projectArn:CreateNetworkProfile' :: CreateNetworkProfile -> Text
projectArn} -> Text
projectArn) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Text
a -> CreateNetworkProfile
s {$sel:projectArn:CreateNetworkProfile' :: Text
projectArn = Text
a} :: CreateNetworkProfile)

-- | The name for the new network profile.
createNetworkProfile_name :: Lens.Lens' CreateNetworkProfile Prelude.Text
createNetworkProfile_name :: (Text -> f Text) -> CreateNetworkProfile -> f CreateNetworkProfile
createNetworkProfile_name = (CreateNetworkProfile -> Text)
-> (CreateNetworkProfile -> Text -> CreateNetworkProfile)
-> Lens CreateNetworkProfile CreateNetworkProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Text
name :: Text
$sel:name:CreateNetworkProfile' :: CreateNetworkProfile -> Text
name} -> Text
name) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Text
a -> CreateNetworkProfile
s {$sel:name:CreateNetworkProfile' :: Text
name = Text
a} :: CreateNetworkProfile)

instance Core.AWSRequest CreateNetworkProfile where
  type
    AWSResponse CreateNetworkProfile =
      CreateNetworkProfileResponse
  request :: CreateNetworkProfile -> Request CreateNetworkProfile
request = Service -> CreateNetworkProfile -> Request CreateNetworkProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNetworkProfile)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateNetworkProfile))
-> Logger
-> Service
-> Proxy CreateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNetworkProfile)))
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 -> CreateNetworkProfileResponse
CreateNetworkProfileResponse'
            (Maybe NetworkProfile -> Int -> CreateNetworkProfileResponse)
-> Either String (Maybe NetworkProfile)
-> Either String (Int -> CreateNetworkProfileResponse)
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 -> CreateNetworkProfileResponse)
-> Either String Int -> Either String CreateNetworkProfileResponse
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 CreateNetworkProfile

instance Prelude.NFData CreateNetworkProfile

instance Core.ToHeaders CreateNetworkProfile where
  toHeaders :: CreateNetworkProfile -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateNetworkProfile -> 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.CreateNetworkProfile" ::
                          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 CreateNetworkProfile where
  toJSON :: CreateNetworkProfile -> Value
toJSON CreateNetworkProfile' {Maybe Integer
Maybe Natural
Maybe Text
Maybe NetworkProfileType
Text
name :: Text
projectArn :: Text
downlinkBandwidthBits :: Maybe Integer
downlinkDelayMs :: Maybe Integer
description :: Maybe Text
uplinkBandwidthBits :: Maybe Integer
uplinkDelayMs :: Maybe Integer
type' :: Maybe NetworkProfileType
downlinkLossPercent :: Maybe Natural
downlinkJitterMs :: Maybe Integer
uplinkLossPercent :: Maybe Natural
uplinkJitterMs :: Maybe Integer
$sel:name:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:projectArn:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:downlinkBandwidthBits:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Integer
$sel:downlinkDelayMs:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Integer
$sel:description:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
$sel:uplinkBandwidthBits:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Integer
$sel:uplinkDelayMs:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Integer
$sel:type':CreateNetworkProfile' :: CreateNetworkProfile -> Maybe NetworkProfileType
$sel:downlinkLossPercent:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Natural
$sel:downlinkJitterMs:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Integer
$sel:uplinkLossPercent:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Natural
$sel:uplinkJitterMs:CreateNetworkProfile' :: CreateNetworkProfile -> 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
"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
"projectArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
projectArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateNetworkProfileResponse' 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', 'createNetworkProfileResponse_networkProfile' - The network profile that is returned by the create network profile
-- request.
--
-- 'httpStatus', 'createNetworkProfileResponse_httpStatus' - The response's http status code.
newCreateNetworkProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateNetworkProfileResponse
newCreateNetworkProfileResponse :: Int -> CreateNetworkProfileResponse
newCreateNetworkProfileResponse Int
pHttpStatus_ =
  CreateNetworkProfileResponse' :: Maybe NetworkProfile -> Int -> CreateNetworkProfileResponse
CreateNetworkProfileResponse'
    { $sel:networkProfile:CreateNetworkProfileResponse' :: Maybe NetworkProfile
networkProfile =
        Maybe NetworkProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateNetworkProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The network profile that is returned by the create network profile
-- request.
createNetworkProfileResponse_networkProfile :: Lens.Lens' CreateNetworkProfileResponse (Prelude.Maybe NetworkProfile)
createNetworkProfileResponse_networkProfile :: (Maybe NetworkProfile -> f (Maybe NetworkProfile))
-> CreateNetworkProfileResponse -> f CreateNetworkProfileResponse
createNetworkProfileResponse_networkProfile = (CreateNetworkProfileResponse -> Maybe NetworkProfile)
-> (CreateNetworkProfileResponse
    -> Maybe NetworkProfile -> CreateNetworkProfileResponse)
-> Lens
     CreateNetworkProfileResponse
     CreateNetworkProfileResponse
     (Maybe NetworkProfile)
     (Maybe NetworkProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfileResponse' {Maybe NetworkProfile
networkProfile :: Maybe NetworkProfile
$sel:networkProfile:CreateNetworkProfileResponse' :: CreateNetworkProfileResponse -> Maybe NetworkProfile
networkProfile} -> Maybe NetworkProfile
networkProfile) (\s :: CreateNetworkProfileResponse
s@CreateNetworkProfileResponse' {} Maybe NetworkProfile
a -> CreateNetworkProfileResponse
s {$sel:networkProfile:CreateNetworkProfileResponse' :: Maybe NetworkProfile
networkProfile = Maybe NetworkProfile
a} :: CreateNetworkProfileResponse)

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

instance Prelude.NFData CreateNetworkProfileResponse