{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a quick connect.
--
-- /See:/ 'newQuickConnect' smart constructor.
data QuickConnect = QuickConnect'
  { -- | The description.
    QuickConnect -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the quick connect.
    QuickConnect -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the quick connect.
    QuickConnect -> Maybe Text
quickConnectARN :: Prelude.Maybe Prelude.Text,
    -- | Contains information about the quick connect.
    QuickConnect -> Maybe QuickConnectConfig
quickConnectConfig :: Prelude.Maybe QuickConnectConfig,
    -- | The identifier for the quick connect.
    QuickConnect -> Maybe Text
quickConnectId :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for this resource.
    -- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
    QuickConnect -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (QuickConnect -> QuickConnect -> Bool
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]
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
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. 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:
--
-- 'description', 'quickConnect_description' - The description.
--
-- 'name', 'quickConnect_name' - The name of the quick connect.
--
-- 'quickConnectARN', 'quickConnect_quickConnectARN' - The Amazon Resource Name (ARN) of the quick connect.
--
-- 'quickConnectConfig', 'quickConnect_quickConnectConfig' - Contains information about the quick connect.
--
-- 'quickConnectId', 'quickConnect_quickConnectId' - The identifier for the quick connect.
--
-- 'tags', 'quickConnect_tags' - The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
newQuickConnect ::
  QuickConnect
newQuickConnect :: QuickConnect
newQuickConnect =
  QuickConnect'
    { $sel:description:QuickConnect' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:name:QuickConnect' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:quickConnectARN:QuickConnect' :: Maybe Text
quickConnectARN = forall a. Maybe a
Prelude.Nothing,
      $sel:quickConnectConfig:QuickConnect' :: Maybe QuickConnectConfig
quickConnectConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:quickConnectId:QuickConnect' :: Maybe Text
quickConnectId = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:QuickConnect' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The description.
quickConnect_description :: Lens.Lens' QuickConnect (Prelude.Maybe Prelude.Text)
quickConnect_description :: Lens' QuickConnect (Maybe Text)
quickConnect_description = 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 name of the quick connect.
quickConnect_name :: Lens.Lens' QuickConnect (Prelude.Maybe Prelude.Text)
quickConnect_name :: Lens' QuickConnect (Maybe Text)
quickConnect_name = 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 Amazon Resource Name (ARN) of the quick connect.
quickConnect_quickConnectARN :: Lens.Lens' QuickConnect (Prelude.Maybe Prelude.Text)
quickConnect_quickConnectARN :: Lens' QuickConnect (Maybe Text)
quickConnect_quickConnectARN = 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)

-- | Contains information about the quick connect.
quickConnect_quickConnectConfig :: Lens.Lens' QuickConnect (Prelude.Maybe QuickConnectConfig)
quickConnect_quickConnectConfig :: Lens' QuickConnect (Maybe QuickConnectConfig)
quickConnect_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)

-- | The identifier for the quick connect.
quickConnect_quickConnectId :: Lens.Lens' QuickConnect (Prelude.Maybe Prelude.Text)
quickConnect_quickConnectId :: Lens' QuickConnect (Maybe Text)
quickConnect_quickConnectId = 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 tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
quickConnect_tags :: Lens.Lens' QuickConnect (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
quickConnect_tags :: Lens' QuickConnect (Maybe (HashMap Text Text))
quickConnect_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable QuickConnect where
  hashWithSalt :: Int -> QuickConnect -> Int
hashWithSalt Int
_salt QuickConnect' {Maybe Text
Maybe (HashMap Text Text)
Maybe QuickConnectConfig
tags :: Maybe (HashMap Text Text)
quickConnectId :: Maybe Text
quickConnectConfig :: Maybe QuickConnectConfig
quickConnectARN :: Maybe Text
name :: Maybe Text
description :: Maybe Text
$sel:tags:QuickConnect' :: QuickConnect -> Maybe (HashMap Text Text)
$sel:quickConnectId:QuickConnect' :: QuickConnect -> Maybe Text
$sel:quickConnectConfig:QuickConnect' :: QuickConnect -> Maybe QuickConnectConfig
$sel:quickConnectARN:QuickConnect' :: QuickConnect -> Maybe Text
$sel:name:QuickConnect' :: QuickConnect -> Maybe Text
$sel:description:QuickConnect' :: QuickConnect -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
quickConnectARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QuickConnectConfig
quickConnectConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
quickConnectId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData QuickConnect where
  rnf :: QuickConnect -> ()
rnf QuickConnect' {Maybe Text
Maybe (HashMap Text Text)
Maybe QuickConnectConfig
tags :: Maybe (HashMap Text Text)
quickConnectId :: Maybe Text
quickConnectConfig :: Maybe QuickConnectConfig
quickConnectARN :: Maybe Text
name :: Maybe Text
description :: Maybe Text
$sel:tags:QuickConnect' :: QuickConnect -> Maybe (HashMap Text Text)
$sel:quickConnectId:QuickConnect' :: QuickConnect -> Maybe Text
$sel:quickConnectConfig:QuickConnect' :: QuickConnect -> Maybe QuickConnectConfig
$sel:quickConnectARN:QuickConnect' :: QuickConnect -> Maybe Text
$sel:name:QuickConnect' :: QuickConnect -> Maybe Text
$sel:description:QuickConnect' :: QuickConnect -> Maybe Text
..} =
    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
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
quickConnectARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe QuickConnectConfig
quickConnectConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
quickConnectId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags