{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Snowball.Types.SnowconeDeviceConfiguration
-- 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)
module Amazonka.Snowball.Types.SnowconeDeviceConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Snowball.Types.WirelessConnection

-- | Specifies the device configuration for an AWS Snowcone job.
--
-- /See:/ 'newSnowconeDeviceConfiguration' smart constructor.
data SnowconeDeviceConfiguration = SnowconeDeviceConfiguration'
  { -- | Configures the wireless connection for the AWS Snowcone device.
    SnowconeDeviceConfiguration -> Maybe WirelessConnection
wirelessConnection :: Prelude.Maybe WirelessConnection
  }
  deriving (SnowconeDeviceConfiguration -> SnowconeDeviceConfiguration -> Bool
(SnowconeDeviceConfiguration
 -> SnowconeDeviceConfiguration -> Bool)
-> (SnowconeDeviceConfiguration
    -> SnowconeDeviceConfiguration -> Bool)
-> Eq SnowconeDeviceConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnowconeDeviceConfiguration -> SnowconeDeviceConfiguration -> Bool
$c/= :: SnowconeDeviceConfiguration -> SnowconeDeviceConfiguration -> Bool
== :: SnowconeDeviceConfiguration -> SnowconeDeviceConfiguration -> Bool
$c== :: SnowconeDeviceConfiguration -> SnowconeDeviceConfiguration -> Bool
Prelude.Eq, ReadPrec [SnowconeDeviceConfiguration]
ReadPrec SnowconeDeviceConfiguration
Int -> ReadS SnowconeDeviceConfiguration
ReadS [SnowconeDeviceConfiguration]
(Int -> ReadS SnowconeDeviceConfiguration)
-> ReadS [SnowconeDeviceConfiguration]
-> ReadPrec SnowconeDeviceConfiguration
-> ReadPrec [SnowconeDeviceConfiguration]
-> Read SnowconeDeviceConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnowconeDeviceConfiguration]
$creadListPrec :: ReadPrec [SnowconeDeviceConfiguration]
readPrec :: ReadPrec SnowconeDeviceConfiguration
$creadPrec :: ReadPrec SnowconeDeviceConfiguration
readList :: ReadS [SnowconeDeviceConfiguration]
$creadList :: ReadS [SnowconeDeviceConfiguration]
readsPrec :: Int -> ReadS SnowconeDeviceConfiguration
$creadsPrec :: Int -> ReadS SnowconeDeviceConfiguration
Prelude.Read, Int -> SnowconeDeviceConfiguration -> ShowS
[SnowconeDeviceConfiguration] -> ShowS
SnowconeDeviceConfiguration -> String
(Int -> SnowconeDeviceConfiguration -> ShowS)
-> (SnowconeDeviceConfiguration -> String)
-> ([SnowconeDeviceConfiguration] -> ShowS)
-> Show SnowconeDeviceConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnowconeDeviceConfiguration] -> ShowS
$cshowList :: [SnowconeDeviceConfiguration] -> ShowS
show :: SnowconeDeviceConfiguration -> String
$cshow :: SnowconeDeviceConfiguration -> String
showsPrec :: Int -> SnowconeDeviceConfiguration -> ShowS
$cshowsPrec :: Int -> SnowconeDeviceConfiguration -> ShowS
Prelude.Show, (forall x.
 SnowconeDeviceConfiguration -> Rep SnowconeDeviceConfiguration x)
-> (forall x.
    Rep SnowconeDeviceConfiguration x -> SnowconeDeviceConfiguration)
-> Generic SnowconeDeviceConfiguration
forall x.
Rep SnowconeDeviceConfiguration x -> SnowconeDeviceConfiguration
forall x.
SnowconeDeviceConfiguration -> Rep SnowconeDeviceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SnowconeDeviceConfiguration x -> SnowconeDeviceConfiguration
$cfrom :: forall x.
SnowconeDeviceConfiguration -> Rep SnowconeDeviceConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'SnowconeDeviceConfiguration' 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:
--
-- 'wirelessConnection', 'snowconeDeviceConfiguration_wirelessConnection' - Configures the wireless connection for the AWS Snowcone device.
newSnowconeDeviceConfiguration ::
  SnowconeDeviceConfiguration
newSnowconeDeviceConfiguration :: SnowconeDeviceConfiguration
newSnowconeDeviceConfiguration =
  SnowconeDeviceConfiguration' :: Maybe WirelessConnection -> SnowconeDeviceConfiguration
SnowconeDeviceConfiguration'
    { $sel:wirelessConnection:SnowconeDeviceConfiguration' :: Maybe WirelessConnection
wirelessConnection =
        Maybe WirelessConnection
forall a. Maybe a
Prelude.Nothing
    }

-- | Configures the wireless connection for the AWS Snowcone device.
snowconeDeviceConfiguration_wirelessConnection :: Lens.Lens' SnowconeDeviceConfiguration (Prelude.Maybe WirelessConnection)
snowconeDeviceConfiguration_wirelessConnection :: (Maybe WirelessConnection -> f (Maybe WirelessConnection))
-> SnowconeDeviceConfiguration -> f SnowconeDeviceConfiguration
snowconeDeviceConfiguration_wirelessConnection = (SnowconeDeviceConfiguration -> Maybe WirelessConnection)
-> (SnowconeDeviceConfiguration
    -> Maybe WirelessConnection -> SnowconeDeviceConfiguration)
-> Lens
     SnowconeDeviceConfiguration
     SnowconeDeviceConfiguration
     (Maybe WirelessConnection)
     (Maybe WirelessConnection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnowconeDeviceConfiguration' {Maybe WirelessConnection
wirelessConnection :: Maybe WirelessConnection
$sel:wirelessConnection:SnowconeDeviceConfiguration' :: SnowconeDeviceConfiguration -> Maybe WirelessConnection
wirelessConnection} -> Maybe WirelessConnection
wirelessConnection) (\s :: SnowconeDeviceConfiguration
s@SnowconeDeviceConfiguration' {} Maybe WirelessConnection
a -> SnowconeDeviceConfiguration
s {$sel:wirelessConnection:SnowconeDeviceConfiguration' :: Maybe WirelessConnection
wirelessConnection = Maybe WirelessConnection
a} :: SnowconeDeviceConfiguration)

instance Core.FromJSON SnowconeDeviceConfiguration where
  parseJSON :: Value -> Parser SnowconeDeviceConfiguration
parseJSON =
    String
-> (Object -> Parser SnowconeDeviceConfiguration)
-> Value
-> Parser SnowconeDeviceConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SnowconeDeviceConfiguration"
      ( \Object
x ->
          Maybe WirelessConnection -> SnowconeDeviceConfiguration
SnowconeDeviceConfiguration'
            (Maybe WirelessConnection -> SnowconeDeviceConfiguration)
-> Parser (Maybe WirelessConnection)
-> Parser SnowconeDeviceConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe WirelessConnection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WirelessConnection")
      )

instance Prelude.Hashable SnowconeDeviceConfiguration

instance Prelude.NFData SnowconeDeviceConfiguration

instance Core.ToJSON SnowconeDeviceConfiguration where
  toJSON :: SnowconeDeviceConfiguration -> Value
toJSON SnowconeDeviceConfiguration' {Maybe WirelessConnection
wirelessConnection :: Maybe WirelessConnection
$sel:wirelessConnection:SnowconeDeviceConfiguration' :: SnowconeDeviceConfiguration -> Maybe WirelessConnection
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"WirelessConnection" Text -> WirelessConnection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (WirelessConnection -> Pair)
-> Maybe WirelessConnection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WirelessConnection
wirelessConnection
          ]
      )