{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AlexaBusiness.Types.Gateway where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 description of the gateway.
    Gateway -> Maybe Text
description :: 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 name of the gateway.
    Gateway -> Maybe Text
name :: 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
  }
  deriving (Gateway -> Gateway -> Bool
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]
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
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. 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.
--
-- 'description', 'gateway_description' - The description of the gateway.
--
-- 'gatewayGroupArn', 'gateway_gatewayGroupArn' - The ARN of the gateway group that the gateway is associated to.
--
-- 'name', 'gateway_name' - The name of the gateway.
--
-- 'softwareVersion', 'gateway_softwareVersion' - The software version of the gateway. The gateway automatically updates
-- its software version during normal operation.
newGateway ::
  Gateway
newGateway :: Gateway
newGateway =
  Gateway'
    { $sel:arn:Gateway' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:Gateway' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayGroupArn:Gateway' :: Maybe Text
gatewayGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:name:Gateway' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:softwareVersion:Gateway' :: Maybe Text
softwareVersion = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the gateway.
gateway_arn :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_arn :: Lens' Gateway (Maybe Text)
gateway_arn = 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 description of the gateway.
gateway_description :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_description :: Lens' Gateway (Maybe Text)
gateway_description = 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)

-- | The ARN of the gateway group that the gateway is associated to.
gateway_gatewayGroupArn :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_gatewayGroupArn :: Lens' Gateway (Maybe Text)
gateway_gatewayGroupArn = 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 name of the gateway.
gateway_name :: Lens.Lens' Gateway (Prelude.Maybe Prelude.Text)
gateway_name :: Lens' Gateway (Maybe Text)
gateway_name = 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 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 :: Lens' Gateway (Maybe Text)
gateway_softwareVersion = 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)

instance Data.FromJSON Gateway where
  parseJSON :: Value -> Parser Gateway
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Gateway"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Gateway
Gateway'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GatewayGroupArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SoftwareVersion")
      )

instance Prelude.Hashable Gateway where
  hashWithSalt :: Int -> Gateway -> Int
hashWithSalt Int
_salt Gateway' {Maybe Text
softwareVersion :: Maybe Text
name :: Maybe Text
gatewayGroupArn :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:softwareVersion:Gateway' :: Gateway -> Maybe Text
$sel:name:Gateway' :: Gateway -> Maybe Text
$sel:gatewayGroupArn:Gateway' :: Gateway -> Maybe Text
$sel:description:Gateway' :: Gateway -> Maybe Text
$sel:arn:Gateway' :: Gateway -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
softwareVersion

instance Prelude.NFData Gateway where
  rnf :: Gateway -> ()
rnf Gateway' {Maybe Text
softwareVersion :: Maybe Text
name :: Maybe Text
gatewayGroupArn :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:softwareVersion:Gateway' :: Gateway -> Maybe Text
$sel:name:Gateway' :: Gateway -> Maybe Text
$sel:gatewayGroupArn:Gateway' :: Gateway -> Maybe Text
$sel:description:Gateway' :: Gateway -> Maybe Text
$sel:arn:Gateway' :: Gateway -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
softwareVersion