{-# 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.WorkSpaces.Types.ConnectClientAddIn
-- 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.WorkSpaces.Types.ConnectClientAddIn 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

-- | Describes an Amazon Connect client add-in.
--
-- /See:/ 'newConnectClientAddIn' smart constructor.
data ConnectClientAddIn = ConnectClientAddIn'
  { -- | The client add-in identifier.
    ConnectClientAddIn -> Maybe Text
addInId :: Prelude.Maybe Prelude.Text,
    -- | The name of the client add in.
    ConnectClientAddIn -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The directory identifier for which the client add-in is configured.
    ConnectClientAddIn -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The endpoint URL of the client add-in.
    ConnectClientAddIn -> Maybe Text
url :: Prelude.Maybe Prelude.Text
  }
  deriving (ConnectClientAddIn -> ConnectClientAddIn -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectClientAddIn -> ConnectClientAddIn -> Bool
$c/= :: ConnectClientAddIn -> ConnectClientAddIn -> Bool
== :: ConnectClientAddIn -> ConnectClientAddIn -> Bool
$c== :: ConnectClientAddIn -> ConnectClientAddIn -> Bool
Prelude.Eq, ReadPrec [ConnectClientAddIn]
ReadPrec ConnectClientAddIn
Int -> ReadS ConnectClientAddIn
ReadS [ConnectClientAddIn]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectClientAddIn]
$creadListPrec :: ReadPrec [ConnectClientAddIn]
readPrec :: ReadPrec ConnectClientAddIn
$creadPrec :: ReadPrec ConnectClientAddIn
readList :: ReadS [ConnectClientAddIn]
$creadList :: ReadS [ConnectClientAddIn]
readsPrec :: Int -> ReadS ConnectClientAddIn
$creadsPrec :: Int -> ReadS ConnectClientAddIn
Prelude.Read, Int -> ConnectClientAddIn -> ShowS
[ConnectClientAddIn] -> ShowS
ConnectClientAddIn -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectClientAddIn] -> ShowS
$cshowList :: [ConnectClientAddIn] -> ShowS
show :: ConnectClientAddIn -> String
$cshow :: ConnectClientAddIn -> String
showsPrec :: Int -> ConnectClientAddIn -> ShowS
$cshowsPrec :: Int -> ConnectClientAddIn -> ShowS
Prelude.Show, forall x. Rep ConnectClientAddIn x -> ConnectClientAddIn
forall x. ConnectClientAddIn -> Rep ConnectClientAddIn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectClientAddIn x -> ConnectClientAddIn
$cfrom :: forall x. ConnectClientAddIn -> Rep ConnectClientAddIn x
Prelude.Generic)

-- |
-- Create a value of 'ConnectClientAddIn' 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:
--
-- 'addInId', 'connectClientAddIn_addInId' - The client add-in identifier.
--
-- 'name', 'connectClientAddIn_name' - The name of the client add in.
--
-- 'resourceId', 'connectClientAddIn_resourceId' - The directory identifier for which the client add-in is configured.
--
-- 'url', 'connectClientAddIn_url' - The endpoint URL of the client add-in.
newConnectClientAddIn ::
  ConnectClientAddIn
newConnectClientAddIn :: ConnectClientAddIn
newConnectClientAddIn =
  ConnectClientAddIn'
    { $sel:addInId:ConnectClientAddIn' :: Maybe Text
addInId = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ConnectClientAddIn' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:ConnectClientAddIn' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:url:ConnectClientAddIn' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing
    }

-- | The client add-in identifier.
connectClientAddIn_addInId :: Lens.Lens' ConnectClientAddIn (Prelude.Maybe Prelude.Text)
connectClientAddIn_addInId :: Lens' ConnectClientAddIn (Maybe Text)
connectClientAddIn_addInId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectClientAddIn' {Maybe Text
addInId :: Maybe Text
$sel:addInId:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
addInId} -> Maybe Text
addInId) (\s :: ConnectClientAddIn
s@ConnectClientAddIn' {} Maybe Text
a -> ConnectClientAddIn
s {$sel:addInId:ConnectClientAddIn' :: Maybe Text
addInId = Maybe Text
a} :: ConnectClientAddIn)

-- | The name of the client add in.
connectClientAddIn_name :: Lens.Lens' ConnectClientAddIn (Prelude.Maybe Prelude.Text)
connectClientAddIn_name :: Lens' ConnectClientAddIn (Maybe Text)
connectClientAddIn_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectClientAddIn' {Maybe Text
name :: Maybe Text
$sel:name:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
name} -> Maybe Text
name) (\s :: ConnectClientAddIn
s@ConnectClientAddIn' {} Maybe Text
a -> ConnectClientAddIn
s {$sel:name:ConnectClientAddIn' :: Maybe Text
name = Maybe Text
a} :: ConnectClientAddIn)

-- | The directory identifier for which the client add-in is configured.
connectClientAddIn_resourceId :: Lens.Lens' ConnectClientAddIn (Prelude.Maybe Prelude.Text)
connectClientAddIn_resourceId :: Lens' ConnectClientAddIn (Maybe Text)
connectClientAddIn_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectClientAddIn' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: ConnectClientAddIn
s@ConnectClientAddIn' {} Maybe Text
a -> ConnectClientAddIn
s {$sel:resourceId:ConnectClientAddIn' :: Maybe Text
resourceId = Maybe Text
a} :: ConnectClientAddIn)

-- | The endpoint URL of the client add-in.
connectClientAddIn_url :: Lens.Lens' ConnectClientAddIn (Prelude.Maybe Prelude.Text)
connectClientAddIn_url :: Lens' ConnectClientAddIn (Maybe Text)
connectClientAddIn_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectClientAddIn' {Maybe Text
url :: Maybe Text
$sel:url:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
url} -> Maybe Text
url) (\s :: ConnectClientAddIn
s@ConnectClientAddIn' {} Maybe Text
a -> ConnectClientAddIn
s {$sel:url:ConnectClientAddIn' :: Maybe Text
url = Maybe Text
a} :: ConnectClientAddIn)

instance Data.FromJSON ConnectClientAddIn where
  parseJSON :: Value -> Parser ConnectClientAddIn
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ConnectClientAddIn"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ConnectClientAddIn
ConnectClientAddIn'
            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
"AddInId")
            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
"ResourceId")
            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
"URL")
      )

instance Prelude.Hashable ConnectClientAddIn where
  hashWithSalt :: Int -> ConnectClientAddIn -> Int
hashWithSalt Int
_salt ConnectClientAddIn' {Maybe Text
url :: Maybe Text
resourceId :: Maybe Text
name :: Maybe Text
addInId :: Maybe Text
$sel:url:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
$sel:resourceId:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
$sel:name:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
$sel:addInId:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
addInId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url

instance Prelude.NFData ConnectClientAddIn where
  rnf :: ConnectClientAddIn -> ()
rnf ConnectClientAddIn' {Maybe Text
url :: Maybe Text
resourceId :: Maybe Text
name :: Maybe Text
addInId :: Maybe Text
$sel:url:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
$sel:resourceId:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
$sel:name:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
$sel:addInId:ConnectClientAddIn' :: ConnectClientAddIn -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
addInId
      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
resourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url