{-# 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.AlexaBusiness.Types.Gateway
-- 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.AlexaBusiness.Types.Gateway where

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

-- | The details of the gateway.
--
-- /See:/ 'newGateway' smart constructor.
data Gateway = Gateway'
  { -- | The ARN of the gateway.
    Gateway -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the gateway.
    Gateway -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the gateway group that the gateway is associated to.
    Gateway -> Maybe Text
gatewayGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The software version of the gateway. The gateway automatically updates
    -- its software version during normal operation.
    Gateway -> Maybe Text
softwareVersion :: Prelude.Maybe Prelude.Text,
    -- | The description of the gateway.
    Gateway -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (Gateway -> Gateway -> Bool
(Gateway -> Gateway -> Bool)
-> (Gateway -> Gateway -> Bool) -> Eq Gateway
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Gateway -> Gateway -> Bool
$c/= :: Gateway -> Gateway -> Bool
== :: Gateway -> Gateway -> Bool
$c== :: Gateway -> Gateway -> Bool
Prelude.Eq, ReadPrec [Gateway]
ReadPrec Gateway
Int -> ReadS Gateway
ReadS [Gateway]
(Int -> ReadS Gateway)
-> ReadS [Gateway]
-> ReadPrec Gateway
-> ReadPrec [Gateway]
-> Read Gateway
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Gateway]
$creadListPrec :: ReadPrec [Gateway]
readPrec :: ReadPrec Gateway
$creadPrec :: ReadPrec Gateway
readList :: ReadS [Gateway]
$creadList :: ReadS [Gateway]
readsPrec :: Int -> ReadS Gateway
$creadsPrec :: Int -> ReadS Gateway
Prelude.Read, Int -> Gateway -> ShowS
[Gateway] -> ShowS
Gateway -> String
(Int -> Gateway -> ShowS)
-> (Gateway -> String) -> ([Gateway] -> ShowS) -> Show Gateway
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Gateway] -> ShowS
$cshowList :: [Gateway] -> ShowS
show :: Gateway -> String
$cshow :: Gateway -> String
showsPrec :: Int -> Gateway -> ShowS
$cshowsPrec :: Int -> Gateway -> ShowS
Prelude.Show, (forall x. Gateway -> Rep Gateway x)
-> (forall x. Rep Gateway x -> Gateway) -> Generic Gateway
forall x. Rep Gateway x -> Gateway
forall x. Gateway -> Rep Gateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Gateway x -> Gateway
$cfrom :: forall x. Gateway -> Rep Gateway x
Prelude.Generic)

-- |
-- Create a value of 'Gateway' 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:
--
-- 'arn', 'gateway_arn' - The ARN of the gateway.
--
-- 'name', 'gateway_name' - The name of the gateway.
--
-- 'gatewayGroupArn', 'gateway_gatewayGroupArn' - The ARN of the gateway group that the gateway is associated to.
--
-- 'softwareVersion', 'gateway_softwareVersion' - The software version of the gateway. The gateway automatically updates
-- its software version during normal operation.
--
-- 'description', 'gateway_description' - The description of the gateway.
newGateway ::
  Gateway
newGateway :: Gateway
newGateway =
  Gateway' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Gateway
Gateway'
    { $sel:arn:Gateway' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Gateway' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayGroupArn:Gateway' :: Maybe Text
gatewayGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:softwareVersion:Gateway' :: Maybe Text
softwareVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Gateway' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the gateway.
gateway_arn :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_arn :: (Maybe Text -> f (Maybe Text)) -> Gateway -> f Gateway
gateway_arn = (Gateway -> Maybe Text)
-> (Gateway -> Maybe Text -> Gateway)
-> Lens Gateway Gateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Gateway' {Maybe Text
arn :: Maybe Text
$sel:arn:Gateway' :: Gateway -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Gateway
s@Gateway' {} Maybe Text
a -> Gateway
s {$sel:arn:Gateway' :: Maybe Text
arn = Maybe Text
a} :: Gateway)

-- | The name of the gateway.
gateway_name :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_name :: (Maybe Text -> f (Maybe Text)) -> Gateway -> f Gateway
gateway_name = (Gateway -> Maybe Text)
-> (Gateway -> Maybe Text -> Gateway)
-> Lens Gateway Gateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Gateway' {Maybe Text
name :: Maybe Text
$sel:name:Gateway' :: Gateway -> Maybe Text
name} -> Maybe Text
name) (\s :: Gateway
s@Gateway' {} Maybe Text
a -> Gateway
s {$sel:name:Gateway' :: Maybe Text
name = Maybe Text
a} :: Gateway)

-- | The ARN of the gateway group that the gateway is associated to.
gateway_gatewayGroupArn :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_gatewayGroupArn :: (Maybe Text -> f (Maybe Text)) -> Gateway -> f Gateway
gateway_gatewayGroupArn = (Gateway -> Maybe Text)
-> (Gateway -> Maybe Text -> Gateway)
-> Lens Gateway Gateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Gateway' {Maybe Text
gatewayGroupArn :: Maybe Text
$sel:gatewayGroupArn:Gateway' :: Gateway -> Maybe Text
gatewayGroupArn} -> Maybe Text
gatewayGroupArn) (\s :: Gateway
s@Gateway' {} Maybe Text
a -> Gateway
s {$sel:gatewayGroupArn:Gateway' :: Maybe Text
gatewayGroupArn = Maybe Text
a} :: Gateway)

-- | The software version of the gateway. The gateway automatically updates
-- its software version during normal operation.
gateway_softwareVersion :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_softwareVersion :: (Maybe Text -> f (Maybe Text)) -> Gateway -> f Gateway
gateway_softwareVersion = (Gateway -> Maybe Text)
-> (Gateway -> Maybe Text -> Gateway)
-> Lens Gateway Gateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Gateway' {Maybe Text
softwareVersion :: Maybe Text
$sel:softwareVersion:Gateway' :: Gateway -> Maybe Text
softwareVersion} -> Maybe Text
softwareVersion) (\s :: Gateway
s@Gateway' {} Maybe Text
a -> Gateway
s {$sel:softwareVersion:Gateway' :: Maybe Text
softwareVersion = Maybe Text
a} :: Gateway)

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

instance Core.FromJSON Gateway where
  parseJSON :: Value -> Parser Gateway
parseJSON =
    String -> (Object -> Parser Gateway) -> Value -> Parser Gateway
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Gateway"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Gateway
Gateway'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Gateway)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Gateway)
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
"Arn")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Gateway)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Gateway)
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
"Name")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> Gateway)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Gateway)
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
"GatewayGroupArn")
            Parser (Maybe Text -> Maybe Text -> Gateway)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Gateway)
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
"SoftwareVersion")
            Parser (Maybe Text -> Gateway)
-> Parser (Maybe Text) -> Parser Gateway
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
"Description")
      )

instance Prelude.Hashable Gateway

instance Prelude.NFData Gateway