{-# 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.CognitoIdentityProvider.Types.NewDeviceMetadataType
-- 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.CognitoIdentityProvider.Types.NewDeviceMetadataType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The new device metadata type.
--
-- /See:/ 'newNewDeviceMetadataType' smart constructor.
data NewDeviceMetadataType = NewDeviceMetadataType'
  { -- | The device group key.
    NewDeviceMetadataType -> Maybe Text
deviceGroupKey :: Prelude.Maybe Prelude.Text,
    -- | The device key.
    NewDeviceMetadataType -> Maybe Text
deviceKey :: Prelude.Maybe Prelude.Text
  }
  deriving (NewDeviceMetadataType -> NewDeviceMetadataType -> Bool
(NewDeviceMetadataType -> NewDeviceMetadataType -> Bool)
-> (NewDeviceMetadataType -> NewDeviceMetadataType -> Bool)
-> Eq NewDeviceMetadataType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewDeviceMetadataType -> NewDeviceMetadataType -> Bool
$c/= :: NewDeviceMetadataType -> NewDeviceMetadataType -> Bool
== :: NewDeviceMetadataType -> NewDeviceMetadataType -> Bool
$c== :: NewDeviceMetadataType -> NewDeviceMetadataType -> Bool
Prelude.Eq, ReadPrec [NewDeviceMetadataType]
ReadPrec NewDeviceMetadataType
Int -> ReadS NewDeviceMetadataType
ReadS [NewDeviceMetadataType]
(Int -> ReadS NewDeviceMetadataType)
-> ReadS [NewDeviceMetadataType]
-> ReadPrec NewDeviceMetadataType
-> ReadPrec [NewDeviceMetadataType]
-> Read NewDeviceMetadataType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewDeviceMetadataType]
$creadListPrec :: ReadPrec [NewDeviceMetadataType]
readPrec :: ReadPrec NewDeviceMetadataType
$creadPrec :: ReadPrec NewDeviceMetadataType
readList :: ReadS [NewDeviceMetadataType]
$creadList :: ReadS [NewDeviceMetadataType]
readsPrec :: Int -> ReadS NewDeviceMetadataType
$creadsPrec :: Int -> ReadS NewDeviceMetadataType
Prelude.Read, Int -> NewDeviceMetadataType -> ShowS
[NewDeviceMetadataType] -> ShowS
NewDeviceMetadataType -> String
(Int -> NewDeviceMetadataType -> ShowS)
-> (NewDeviceMetadataType -> String)
-> ([NewDeviceMetadataType] -> ShowS)
-> Show NewDeviceMetadataType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewDeviceMetadataType] -> ShowS
$cshowList :: [NewDeviceMetadataType] -> ShowS
show :: NewDeviceMetadataType -> String
$cshow :: NewDeviceMetadataType -> String
showsPrec :: Int -> NewDeviceMetadataType -> ShowS
$cshowsPrec :: Int -> NewDeviceMetadataType -> ShowS
Prelude.Show, (forall x. NewDeviceMetadataType -> Rep NewDeviceMetadataType x)
-> (forall x. Rep NewDeviceMetadataType x -> NewDeviceMetadataType)
-> Generic NewDeviceMetadataType
forall x. Rep NewDeviceMetadataType x -> NewDeviceMetadataType
forall x. NewDeviceMetadataType -> Rep NewDeviceMetadataType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NewDeviceMetadataType x -> NewDeviceMetadataType
$cfrom :: forall x. NewDeviceMetadataType -> Rep NewDeviceMetadataType x
Prelude.Generic)

-- |
-- Create a value of 'NewDeviceMetadataType' 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:
--
-- 'deviceGroupKey', 'newDeviceMetadataType_deviceGroupKey' - The device group key.
--
-- 'deviceKey', 'newDeviceMetadataType_deviceKey' - The device key.
newNewDeviceMetadataType ::
  NewDeviceMetadataType
newNewDeviceMetadataType :: NewDeviceMetadataType
newNewDeviceMetadataType =
  NewDeviceMetadataType' :: Maybe Text -> Maybe Text -> NewDeviceMetadataType
NewDeviceMetadataType'
    { $sel:deviceGroupKey:NewDeviceMetadataType' :: Maybe Text
deviceGroupKey =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceKey:NewDeviceMetadataType' :: Maybe Text
deviceKey = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The device group key.
newDeviceMetadataType_deviceGroupKey :: Lens.Lens' NewDeviceMetadataType (Prelude.Maybe Prelude.Text)
newDeviceMetadataType_deviceGroupKey :: (Maybe Text -> f (Maybe Text))
-> NewDeviceMetadataType -> f NewDeviceMetadataType
newDeviceMetadataType_deviceGroupKey = (NewDeviceMetadataType -> Maybe Text)
-> (NewDeviceMetadataType -> Maybe Text -> NewDeviceMetadataType)
-> Lens
     NewDeviceMetadataType
     NewDeviceMetadataType
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewDeviceMetadataType' {Maybe Text
deviceGroupKey :: Maybe Text
$sel:deviceGroupKey:NewDeviceMetadataType' :: NewDeviceMetadataType -> Maybe Text
deviceGroupKey} -> Maybe Text
deviceGroupKey) (\s :: NewDeviceMetadataType
s@NewDeviceMetadataType' {} Maybe Text
a -> NewDeviceMetadataType
s {$sel:deviceGroupKey:NewDeviceMetadataType' :: Maybe Text
deviceGroupKey = Maybe Text
a} :: NewDeviceMetadataType)

-- | The device key.
newDeviceMetadataType_deviceKey :: Lens.Lens' NewDeviceMetadataType (Prelude.Maybe Prelude.Text)
newDeviceMetadataType_deviceKey :: (Maybe Text -> f (Maybe Text))
-> NewDeviceMetadataType -> f NewDeviceMetadataType
newDeviceMetadataType_deviceKey = (NewDeviceMetadataType -> Maybe Text)
-> (NewDeviceMetadataType -> Maybe Text -> NewDeviceMetadataType)
-> Lens
     NewDeviceMetadataType
     NewDeviceMetadataType
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewDeviceMetadataType' {Maybe Text
deviceKey :: Maybe Text
$sel:deviceKey:NewDeviceMetadataType' :: NewDeviceMetadataType -> Maybe Text
deviceKey} -> Maybe Text
deviceKey) (\s :: NewDeviceMetadataType
s@NewDeviceMetadataType' {} Maybe Text
a -> NewDeviceMetadataType
s {$sel:deviceKey:NewDeviceMetadataType' :: Maybe Text
deviceKey = Maybe Text
a} :: NewDeviceMetadataType)

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

instance Prelude.Hashable NewDeviceMetadataType

instance Prelude.NFData NewDeviceMetadataType