{-# 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.Braket.Types.DeviceSummary
-- 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.Braket.Types.DeviceSummary where

import Amazonka.Braket.Types.DeviceStatus
import Amazonka.Braket.Types.DeviceType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Includes information about the device.
--
-- /See:/ 'newDeviceSummary' smart constructor.
data DeviceSummary = DeviceSummary'
  { -- | The ARN of the device.
    DeviceSummary -> Text
deviceArn :: Prelude.Text,
    -- | The name of the device.
    DeviceSummary -> Text
deviceName :: Prelude.Text,
    -- | The status of the device.
    DeviceSummary -> DeviceStatus
deviceStatus :: DeviceStatus,
    -- | The type of the device.
    DeviceSummary -> DeviceType
deviceType :: DeviceType,
    -- | The provider of the device.
    DeviceSummary -> Text
providerName :: Prelude.Text
  }
  deriving (DeviceSummary -> DeviceSummary -> Bool
(DeviceSummary -> DeviceSummary -> Bool)
-> (DeviceSummary -> DeviceSummary -> Bool) -> Eq DeviceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceSummary -> DeviceSummary -> Bool
$c/= :: DeviceSummary -> DeviceSummary -> Bool
== :: DeviceSummary -> DeviceSummary -> Bool
$c== :: DeviceSummary -> DeviceSummary -> Bool
Prelude.Eq, ReadPrec [DeviceSummary]
ReadPrec DeviceSummary
Int -> ReadS DeviceSummary
ReadS [DeviceSummary]
(Int -> ReadS DeviceSummary)
-> ReadS [DeviceSummary]
-> ReadPrec DeviceSummary
-> ReadPrec [DeviceSummary]
-> Read DeviceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceSummary]
$creadListPrec :: ReadPrec [DeviceSummary]
readPrec :: ReadPrec DeviceSummary
$creadPrec :: ReadPrec DeviceSummary
readList :: ReadS [DeviceSummary]
$creadList :: ReadS [DeviceSummary]
readsPrec :: Int -> ReadS DeviceSummary
$creadsPrec :: Int -> ReadS DeviceSummary
Prelude.Read, Int -> DeviceSummary -> ShowS
[DeviceSummary] -> ShowS
DeviceSummary -> String
(Int -> DeviceSummary -> ShowS)
-> (DeviceSummary -> String)
-> ([DeviceSummary] -> ShowS)
-> Show DeviceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceSummary] -> ShowS
$cshowList :: [DeviceSummary] -> ShowS
show :: DeviceSummary -> String
$cshow :: DeviceSummary -> String
showsPrec :: Int -> DeviceSummary -> ShowS
$cshowsPrec :: Int -> DeviceSummary -> ShowS
Prelude.Show, (forall x. DeviceSummary -> Rep DeviceSummary x)
-> (forall x. Rep DeviceSummary x -> DeviceSummary)
-> Generic DeviceSummary
forall x. Rep DeviceSummary x -> DeviceSummary
forall x. DeviceSummary -> Rep DeviceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceSummary x -> DeviceSummary
$cfrom :: forall x. DeviceSummary -> Rep DeviceSummary x
Prelude.Generic)

-- |
-- Create a value of 'DeviceSummary' 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:
--
-- 'deviceArn', 'deviceSummary_deviceArn' - The ARN of the device.
--
-- 'deviceName', 'deviceSummary_deviceName' - The name of the device.
--
-- 'deviceStatus', 'deviceSummary_deviceStatus' - The status of the device.
--
-- 'deviceType', 'deviceSummary_deviceType' - The type of the device.
--
-- 'providerName', 'deviceSummary_providerName' - The provider of the device.
newDeviceSummary ::
  -- | 'deviceArn'
  Prelude.Text ->
  -- | 'deviceName'
  Prelude.Text ->
  -- | 'deviceStatus'
  DeviceStatus ->
  -- | 'deviceType'
  DeviceType ->
  -- | 'providerName'
  Prelude.Text ->
  DeviceSummary
newDeviceSummary :: Text -> Text -> DeviceStatus -> DeviceType -> Text -> DeviceSummary
newDeviceSummary
  Text
pDeviceArn_
  Text
pDeviceName_
  DeviceStatus
pDeviceStatus_
  DeviceType
pDeviceType_
  Text
pProviderName_ =
    DeviceSummary' :: Text -> Text -> DeviceStatus -> DeviceType -> Text -> DeviceSummary
DeviceSummary'
      { $sel:deviceArn:DeviceSummary' :: Text
deviceArn = Text
pDeviceArn_,
        $sel:deviceName:DeviceSummary' :: Text
deviceName = Text
pDeviceName_,
        $sel:deviceStatus:DeviceSummary' :: DeviceStatus
deviceStatus = DeviceStatus
pDeviceStatus_,
        $sel:deviceType:DeviceSummary' :: DeviceType
deviceType = DeviceType
pDeviceType_,
        $sel:providerName:DeviceSummary' :: Text
providerName = Text
pProviderName_
      }

-- | The ARN of the device.
deviceSummary_deviceArn :: Lens.Lens' DeviceSummary Prelude.Text
deviceSummary_deviceArn :: (Text -> f Text) -> DeviceSummary -> f DeviceSummary
deviceSummary_deviceArn = (DeviceSummary -> Text)
-> (DeviceSummary -> Text -> DeviceSummary)
-> Lens DeviceSummary DeviceSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Text
deviceArn :: Text
$sel:deviceArn:DeviceSummary' :: DeviceSummary -> Text
deviceArn} -> Text
deviceArn) (\s :: DeviceSummary
s@DeviceSummary' {} Text
a -> DeviceSummary
s {$sel:deviceArn:DeviceSummary' :: Text
deviceArn = Text
a} :: DeviceSummary)

-- | The name of the device.
deviceSummary_deviceName :: Lens.Lens' DeviceSummary Prelude.Text
deviceSummary_deviceName :: (Text -> f Text) -> DeviceSummary -> f DeviceSummary
deviceSummary_deviceName = (DeviceSummary -> Text)
-> (DeviceSummary -> Text -> DeviceSummary)
-> Lens DeviceSummary DeviceSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Text
deviceName :: Text
$sel:deviceName:DeviceSummary' :: DeviceSummary -> Text
deviceName} -> Text
deviceName) (\s :: DeviceSummary
s@DeviceSummary' {} Text
a -> DeviceSummary
s {$sel:deviceName:DeviceSummary' :: Text
deviceName = Text
a} :: DeviceSummary)

-- | The status of the device.
deviceSummary_deviceStatus :: Lens.Lens' DeviceSummary DeviceStatus
deviceSummary_deviceStatus :: (DeviceStatus -> f DeviceStatus)
-> DeviceSummary -> f DeviceSummary
deviceSummary_deviceStatus = (DeviceSummary -> DeviceStatus)
-> (DeviceSummary -> DeviceStatus -> DeviceSummary)
-> Lens DeviceSummary DeviceSummary DeviceStatus DeviceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {DeviceStatus
deviceStatus :: DeviceStatus
$sel:deviceStatus:DeviceSummary' :: DeviceSummary -> DeviceStatus
deviceStatus} -> DeviceStatus
deviceStatus) (\s :: DeviceSummary
s@DeviceSummary' {} DeviceStatus
a -> DeviceSummary
s {$sel:deviceStatus:DeviceSummary' :: DeviceStatus
deviceStatus = DeviceStatus
a} :: DeviceSummary)

-- | The type of the device.
deviceSummary_deviceType :: Lens.Lens' DeviceSummary DeviceType
deviceSummary_deviceType :: (DeviceType -> f DeviceType) -> DeviceSummary -> f DeviceSummary
deviceSummary_deviceType = (DeviceSummary -> DeviceType)
-> (DeviceSummary -> DeviceType -> DeviceSummary)
-> Lens DeviceSummary DeviceSummary DeviceType DeviceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {DeviceType
deviceType :: DeviceType
$sel:deviceType:DeviceSummary' :: DeviceSummary -> DeviceType
deviceType} -> DeviceType
deviceType) (\s :: DeviceSummary
s@DeviceSummary' {} DeviceType
a -> DeviceSummary
s {$sel:deviceType:DeviceSummary' :: DeviceType
deviceType = DeviceType
a} :: DeviceSummary)

-- | The provider of the device.
deviceSummary_providerName :: Lens.Lens' DeviceSummary Prelude.Text
deviceSummary_providerName :: (Text -> f Text) -> DeviceSummary -> f DeviceSummary
deviceSummary_providerName = (DeviceSummary -> Text)
-> (DeviceSummary -> Text -> DeviceSummary)
-> Lens DeviceSummary DeviceSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Text
providerName :: Text
$sel:providerName:DeviceSummary' :: DeviceSummary -> Text
providerName} -> Text
providerName) (\s :: DeviceSummary
s@DeviceSummary' {} Text
a -> DeviceSummary
s {$sel:providerName:DeviceSummary' :: Text
providerName = Text
a} :: DeviceSummary)

instance Core.FromJSON DeviceSummary where
  parseJSON :: Value -> Parser DeviceSummary
parseJSON =
    String
-> (Object -> Parser DeviceSummary)
-> Value
-> Parser DeviceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DeviceSummary"
      ( \Object
x ->
          Text -> Text -> DeviceStatus -> DeviceType -> Text -> DeviceSummary
DeviceSummary'
            (Text
 -> Text -> DeviceStatus -> DeviceType -> Text -> DeviceSummary)
-> Parser Text
-> Parser
     (Text -> DeviceStatus -> DeviceType -> Text -> DeviceSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deviceArn")
            Parser
  (Text -> DeviceStatus -> DeviceType -> Text -> DeviceSummary)
-> Parser Text
-> Parser (DeviceStatus -> DeviceType -> Text -> DeviceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deviceName")
            Parser (DeviceStatus -> DeviceType -> Text -> DeviceSummary)
-> Parser DeviceStatus
-> Parser (DeviceType -> Text -> DeviceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeviceStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deviceStatus")
            Parser (DeviceType -> Text -> DeviceSummary)
-> Parser DeviceType -> Parser (Text -> DeviceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeviceType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deviceType")
            Parser (Text -> DeviceSummary)
-> Parser Text -> Parser DeviceSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"providerName")
      )

instance Prelude.Hashable DeviceSummary

instance Prelude.NFData DeviceSummary