{-# 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.Connect.Types.QuickConnect
-- 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.Connect.Types.QuickConnect where

import Amazonka.Connect.Types.QuickConnectConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a quick connect.
--
-- /See:/ 'newQuickConnect' smart constructor.
data QuickConnect = QuickConnect'
  { -- | The name of the quick connect.
    QuickConnect -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the quick connect.
    QuickConnect -> Maybe Text
quickConnectId :: Prelude.Maybe Prelude.Text,
    -- | The description.
    QuickConnect -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the quick connect.
    QuickConnect -> Maybe Text
quickConnectARN :: Prelude.Maybe Prelude.Text,
    -- | One or more tags.
    QuickConnect -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Contains information about the quick connect.
    QuickConnect -> Maybe QuickConnectConfig
quickConnectConfig :: Prelude.Maybe QuickConnectConfig
  }
  deriving (QuickConnect -> QuickConnect -> Bool
(QuickConnect -> QuickConnect -> Bool)
-> (QuickConnect -> QuickConnect -> Bool) -> Eq QuickConnect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QuickConnect -> QuickConnect -> Bool
$c/= :: QuickConnect -> QuickConnect -> Bool
== :: QuickConnect -> QuickConnect -> Bool
$c== :: QuickConnect -> QuickConnect -> Bool
Prelude.Eq, ReadPrec [QuickConnect]
ReadPrec QuickConnect
Int -> ReadS QuickConnect
ReadS [QuickConnect]
(Int -> ReadS QuickConnect)
-> ReadS [QuickConnect]
-> ReadPrec QuickConnect
-> ReadPrec [QuickConnect]
-> Read QuickConnect
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QuickConnect]
$creadListPrec :: ReadPrec [QuickConnect]
readPrec :: ReadPrec QuickConnect
$creadPrec :: ReadPrec QuickConnect
readList :: ReadS [QuickConnect]
$creadList :: ReadS [QuickConnect]
readsPrec :: Int -> ReadS QuickConnect
$creadsPrec :: Int -> ReadS QuickConnect
Prelude.Read, Int -> QuickConnect -> ShowS
[QuickConnect] -> ShowS
QuickConnect -> String
(Int -> QuickConnect -> ShowS)
-> (QuickConnect -> String)
-> ([QuickConnect] -> ShowS)
-> Show QuickConnect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QuickConnect] -> ShowS
$cshowList :: [QuickConnect] -> ShowS
show :: QuickConnect -> String
$cshow :: QuickConnect -> String
showsPrec :: Int -> QuickConnect -> ShowS
$cshowsPrec :: Int -> QuickConnect -> ShowS
Prelude.Show, (forall x. QuickConnect -> Rep QuickConnect x)
-> (forall x. Rep QuickConnect x -> QuickConnect)
-> Generic QuickConnect
forall x. Rep QuickConnect x -> QuickConnect
forall x. QuickConnect -> Rep QuickConnect x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QuickConnect x -> QuickConnect
$cfrom :: forall x. QuickConnect -> Rep QuickConnect x
Prelude.Generic)

-- |
-- Create a value of 'QuickConnect' 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:
--
-- 'name', 'quickConnect_name' - The name of the quick connect.
--
-- 'quickConnectId', 'quickConnect_quickConnectId' - The identifier for the quick connect.
--
-- 'description', 'quickConnect_description' - The description.
--
-- 'quickConnectARN', 'quickConnect_quickConnectARN' - The Amazon Resource Name (ARN) of the quick connect.
--
-- 'tags', 'quickConnect_tags' - One or more tags.
--
-- 'quickConnectConfig', 'quickConnect_quickConnectConfig' - Contains information about the quick connect.
newQuickConnect ::
  QuickConnect
newQuickConnect :: QuickConnect
newQuickConnect =
  QuickConnect' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe QuickConnectConfig
-> QuickConnect
QuickConnect'
    { $sel:name:QuickConnect' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:quickConnectId:QuickConnect' :: Maybe Text
quickConnectId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:QuickConnect' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:quickConnectARN:QuickConnect' :: Maybe Text
quickConnectARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:QuickConnect' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:quickConnectConfig:QuickConnect' :: Maybe QuickConnectConfig
quickConnectConfig = Maybe QuickConnectConfig
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The identifier for the quick connect.
quickConnect_quickConnectId :: Lens.Lens' QuickConnect (Prelude.Maybe Prelude.Text)
quickConnect_quickConnectId :: (Maybe Text -> f (Maybe Text)) -> QuickConnect -> f QuickConnect
quickConnect_quickConnectId = (QuickConnect -> Maybe Text)
-> (QuickConnect -> Maybe Text -> QuickConnect)
-> Lens QuickConnect QuickConnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnect' {Maybe Text
quickConnectId :: Maybe Text
$sel:quickConnectId:QuickConnect' :: QuickConnect -> Maybe Text
quickConnectId} -> Maybe Text
quickConnectId) (\s :: QuickConnect
s@QuickConnect' {} Maybe Text
a -> QuickConnect
s {$sel:quickConnectId:QuickConnect' :: Maybe Text
quickConnectId = Maybe Text
a} :: QuickConnect)

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

-- | The Amazon Resource Name (ARN) of the quick connect.
quickConnect_quickConnectARN :: Lens.Lens' QuickConnect (Prelude.Maybe Prelude.Text)
quickConnect_quickConnectARN :: (Maybe Text -> f (Maybe Text)) -> QuickConnect -> f QuickConnect
quickConnect_quickConnectARN = (QuickConnect -> Maybe Text)
-> (QuickConnect -> Maybe Text -> QuickConnect)
-> Lens QuickConnect QuickConnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnect' {Maybe Text
quickConnectARN :: Maybe Text
$sel:quickConnectARN:QuickConnect' :: QuickConnect -> Maybe Text
quickConnectARN} -> Maybe Text
quickConnectARN) (\s :: QuickConnect
s@QuickConnect' {} Maybe Text
a -> QuickConnect
s {$sel:quickConnectARN:QuickConnect' :: Maybe Text
quickConnectARN = Maybe Text
a} :: QuickConnect)

-- | One or more tags.
quickConnect_tags :: Lens.Lens' QuickConnect (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
quickConnect_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> QuickConnect -> f QuickConnect
quickConnect_tags = (QuickConnect -> Maybe (HashMap Text Text))
-> (QuickConnect -> Maybe (HashMap Text Text) -> QuickConnect)
-> Lens
     QuickConnect
     QuickConnect
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnect' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:QuickConnect' :: QuickConnect -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: QuickConnect
s@QuickConnect' {} Maybe (HashMap Text Text)
a -> QuickConnect
s {$sel:tags:QuickConnect' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: QuickConnect) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> QuickConnect -> f QuickConnect)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> QuickConnect
-> f QuickConnect
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Contains information about the quick connect.
quickConnect_quickConnectConfig :: Lens.Lens' QuickConnect (Prelude.Maybe QuickConnectConfig)
quickConnect_quickConnectConfig :: (Maybe QuickConnectConfig -> f (Maybe QuickConnectConfig))
-> QuickConnect -> f QuickConnect
quickConnect_quickConnectConfig = (QuickConnect -> Maybe QuickConnectConfig)
-> (QuickConnect -> Maybe QuickConnectConfig -> QuickConnect)
-> Lens
     QuickConnect
     QuickConnect
     (Maybe QuickConnectConfig)
     (Maybe QuickConnectConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnect' {Maybe QuickConnectConfig
quickConnectConfig :: Maybe QuickConnectConfig
$sel:quickConnectConfig:QuickConnect' :: QuickConnect -> Maybe QuickConnectConfig
quickConnectConfig} -> Maybe QuickConnectConfig
quickConnectConfig) (\s :: QuickConnect
s@QuickConnect' {} Maybe QuickConnectConfig
a -> QuickConnect
s {$sel:quickConnectConfig:QuickConnect' :: Maybe QuickConnectConfig
quickConnectConfig = Maybe QuickConnectConfig
a} :: QuickConnect)

instance Core.FromJSON QuickConnect where
  parseJSON :: Value -> Parser QuickConnect
parseJSON =
    String
-> (Object -> Parser QuickConnect) -> Value -> Parser QuickConnect
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"QuickConnect"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe QuickConnectConfig
-> QuickConnect
QuickConnect'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe QuickConnectConfig
 -> QuickConnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe QuickConnectConfig
      -> QuickConnect)
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
"Name")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe QuickConnectConfig
   -> QuickConnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe QuickConnectConfig
      -> QuickConnect)
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
"QuickConnectId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe QuickConnectConfig
   -> QuickConnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe QuickConnectConfig
      -> QuickConnect)
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")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe QuickConnectConfig
   -> QuickConnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe QuickConnectConfig -> QuickConnect)
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
"QuickConnectARN")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe QuickConnectConfig -> QuickConnect)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe QuickConnectConfig -> QuickConnect)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe QuickConnectConfig -> QuickConnect)
-> Parser (Maybe QuickConnectConfig) -> Parser QuickConnect
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QuickConnectConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuickConnectConfig")
      )

instance Prelude.Hashable QuickConnect

instance Prelude.NFData QuickConnect