{-# 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.RoutingProfileReference
-- 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.RoutingProfileReference 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

-- | Information about the routing profile assigned to the user.
--
-- /See:/ 'newRoutingProfileReference' smart constructor.
data RoutingProfileReference = RoutingProfileReference'
  { -- | The Amazon Resource Name (ARN) of the routing profile.
    RoutingProfileReference -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the routing profile.
    RoutingProfileReference -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (RoutingProfileReference -> RoutingProfileReference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoutingProfileReference -> RoutingProfileReference -> Bool
$c/= :: RoutingProfileReference -> RoutingProfileReference -> Bool
== :: RoutingProfileReference -> RoutingProfileReference -> Bool
$c== :: RoutingProfileReference -> RoutingProfileReference -> Bool
Prelude.Eq, ReadPrec [RoutingProfileReference]
ReadPrec RoutingProfileReference
Int -> ReadS RoutingProfileReference
ReadS [RoutingProfileReference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoutingProfileReference]
$creadListPrec :: ReadPrec [RoutingProfileReference]
readPrec :: ReadPrec RoutingProfileReference
$creadPrec :: ReadPrec RoutingProfileReference
readList :: ReadS [RoutingProfileReference]
$creadList :: ReadS [RoutingProfileReference]
readsPrec :: Int -> ReadS RoutingProfileReference
$creadsPrec :: Int -> ReadS RoutingProfileReference
Prelude.Read, Int -> RoutingProfileReference -> ShowS
[RoutingProfileReference] -> ShowS
RoutingProfileReference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoutingProfileReference] -> ShowS
$cshowList :: [RoutingProfileReference] -> ShowS
show :: RoutingProfileReference -> String
$cshow :: RoutingProfileReference -> String
showsPrec :: Int -> RoutingProfileReference -> ShowS
$cshowsPrec :: Int -> RoutingProfileReference -> ShowS
Prelude.Show, forall x. Rep RoutingProfileReference x -> RoutingProfileReference
forall x. RoutingProfileReference -> Rep RoutingProfileReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoutingProfileReference x -> RoutingProfileReference
$cfrom :: forall x. RoutingProfileReference -> Rep RoutingProfileReference x
Prelude.Generic)

-- |
-- Create a value of 'RoutingProfileReference' 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', 'routingProfileReference_arn' - The Amazon Resource Name (ARN) of the routing profile.
--
-- 'id', 'routingProfileReference_id' - The identifier of the routing profile.
newRoutingProfileReference ::
  RoutingProfileReference
newRoutingProfileReference :: RoutingProfileReference
newRoutingProfileReference =
  RoutingProfileReference'
    { $sel:arn:RoutingProfileReference' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:RoutingProfileReference' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the routing profile.
routingProfileReference_arn :: Lens.Lens' RoutingProfileReference (Prelude.Maybe Prelude.Text)
routingProfileReference_arn :: Lens' RoutingProfileReference (Maybe Text)
routingProfileReference_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingProfileReference' {Maybe Text
arn :: Maybe Text
$sel:arn:RoutingProfileReference' :: RoutingProfileReference -> Maybe Text
arn} -> Maybe Text
arn) (\s :: RoutingProfileReference
s@RoutingProfileReference' {} Maybe Text
a -> RoutingProfileReference
s {$sel:arn:RoutingProfileReference' :: Maybe Text
arn = Maybe Text
a} :: RoutingProfileReference)

-- | The identifier of the routing profile.
routingProfileReference_id :: Lens.Lens' RoutingProfileReference (Prelude.Maybe Prelude.Text)
routingProfileReference_id :: Lens' RoutingProfileReference (Maybe Text)
routingProfileReference_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingProfileReference' {Maybe Text
id :: Maybe Text
$sel:id:RoutingProfileReference' :: RoutingProfileReference -> Maybe Text
id} -> Maybe Text
id) (\s :: RoutingProfileReference
s@RoutingProfileReference' {} Maybe Text
a -> RoutingProfileReference
s {$sel:id:RoutingProfileReference' :: Maybe Text
id = Maybe Text
a} :: RoutingProfileReference)

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

instance Prelude.Hashable RoutingProfileReference where
  hashWithSalt :: Int -> RoutingProfileReference -> Int
hashWithSalt Int
_salt RoutingProfileReference' {Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:id:RoutingProfileReference' :: RoutingProfileReference -> Maybe Text
$sel:arn:RoutingProfileReference' :: RoutingProfileReference -> 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
id

instance Prelude.NFData RoutingProfileReference where
  rnf :: RoutingProfileReference -> ()
rnf RoutingProfileReference' {Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:id:RoutingProfileReference' :: RoutingProfileReference -> Maybe Text
$sel:arn:RoutingProfileReference' :: RoutingProfileReference -> 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
id