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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkSpaces.Types.AssociationStatus

-- | Describes a connection alias association that is used for cross-Region
-- redirection. For more information, see
-- <https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html Cross-Region Redirection for Amazon WorkSpaces>.
--
-- /See:/ 'newConnectionAliasAssociation' smart constructor.
data ConnectionAliasAssociation = ConnectionAliasAssociation'
  { -- | The identifier of the Amazon Web Services account that associated the
    -- connection alias with a directory.
    ConnectionAliasAssociation -> Maybe Text
associatedAccountId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the directory associated with a connection alias.
    ConnectionAliasAssociation -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The association status of the connection alias.
    ConnectionAliasAssociation -> Maybe AssociationStatus
associationStatus :: Prelude.Maybe AssociationStatus,
    -- | The identifier of the connection alias association. You use the
    -- connection identifier in the DNS TXT record when you\'re configuring
    -- your DNS routing policies.
    ConnectionAliasAssociation -> Maybe Text
connectionIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (ConnectionAliasAssociation -> ConnectionAliasAssociation -> Bool
(ConnectionAliasAssociation -> ConnectionAliasAssociation -> Bool)
-> (ConnectionAliasAssociation
    -> ConnectionAliasAssociation -> Bool)
-> Eq ConnectionAliasAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectionAliasAssociation -> ConnectionAliasAssociation -> Bool
$c/= :: ConnectionAliasAssociation -> ConnectionAliasAssociation -> Bool
== :: ConnectionAliasAssociation -> ConnectionAliasAssociation -> Bool
$c== :: ConnectionAliasAssociation -> ConnectionAliasAssociation -> Bool
Prelude.Eq, ReadPrec [ConnectionAliasAssociation]
ReadPrec ConnectionAliasAssociation
Int -> ReadS ConnectionAliasAssociation
ReadS [ConnectionAliasAssociation]
(Int -> ReadS ConnectionAliasAssociation)
-> ReadS [ConnectionAliasAssociation]
-> ReadPrec ConnectionAliasAssociation
-> ReadPrec [ConnectionAliasAssociation]
-> Read ConnectionAliasAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectionAliasAssociation]
$creadListPrec :: ReadPrec [ConnectionAliasAssociation]
readPrec :: ReadPrec ConnectionAliasAssociation
$creadPrec :: ReadPrec ConnectionAliasAssociation
readList :: ReadS [ConnectionAliasAssociation]
$creadList :: ReadS [ConnectionAliasAssociation]
readsPrec :: Int -> ReadS ConnectionAliasAssociation
$creadsPrec :: Int -> ReadS ConnectionAliasAssociation
Prelude.Read, Int -> ConnectionAliasAssociation -> ShowS
[ConnectionAliasAssociation] -> ShowS
ConnectionAliasAssociation -> String
(Int -> ConnectionAliasAssociation -> ShowS)
-> (ConnectionAliasAssociation -> String)
-> ([ConnectionAliasAssociation] -> ShowS)
-> Show ConnectionAliasAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectionAliasAssociation] -> ShowS
$cshowList :: [ConnectionAliasAssociation] -> ShowS
show :: ConnectionAliasAssociation -> String
$cshow :: ConnectionAliasAssociation -> String
showsPrec :: Int -> ConnectionAliasAssociation -> ShowS
$cshowsPrec :: Int -> ConnectionAliasAssociation -> ShowS
Prelude.Show, (forall x.
 ConnectionAliasAssociation -> Rep ConnectionAliasAssociation x)
-> (forall x.
    Rep ConnectionAliasAssociation x -> ConnectionAliasAssociation)
-> Generic ConnectionAliasAssociation
forall x.
Rep ConnectionAliasAssociation x -> ConnectionAliasAssociation
forall x.
ConnectionAliasAssociation -> Rep ConnectionAliasAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConnectionAliasAssociation x -> ConnectionAliasAssociation
$cfrom :: forall x.
ConnectionAliasAssociation -> Rep ConnectionAliasAssociation x
Prelude.Generic)

-- |
-- Create a value of 'ConnectionAliasAssociation' 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:
--
-- 'associatedAccountId', 'connectionAliasAssociation_associatedAccountId' - The identifier of the Amazon Web Services account that associated the
-- connection alias with a directory.
--
-- 'resourceId', 'connectionAliasAssociation_resourceId' - The identifier of the directory associated with a connection alias.
--
-- 'associationStatus', 'connectionAliasAssociation_associationStatus' - The association status of the connection alias.
--
-- 'connectionIdentifier', 'connectionAliasAssociation_connectionIdentifier' - The identifier of the connection alias association. You use the
-- connection identifier in the DNS TXT record when you\'re configuring
-- your DNS routing policies.
newConnectionAliasAssociation ::
  ConnectionAliasAssociation
newConnectionAliasAssociation :: ConnectionAliasAssociation
newConnectionAliasAssociation =
  ConnectionAliasAssociation' :: Maybe Text
-> Maybe Text
-> Maybe AssociationStatus
-> Maybe Text
-> ConnectionAliasAssociation
ConnectionAliasAssociation'
    { $sel:associatedAccountId:ConnectionAliasAssociation' :: Maybe Text
associatedAccountId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:ConnectionAliasAssociation' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:associationStatus:ConnectionAliasAssociation' :: Maybe AssociationStatus
associationStatus = Maybe AssociationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionIdentifier:ConnectionAliasAssociation' :: Maybe Text
connectionIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the Amazon Web Services account that associated the
-- connection alias with a directory.
connectionAliasAssociation_associatedAccountId :: Lens.Lens' ConnectionAliasAssociation (Prelude.Maybe Prelude.Text)
connectionAliasAssociation_associatedAccountId :: (Maybe Text -> f (Maybe Text))
-> ConnectionAliasAssociation -> f ConnectionAliasAssociation
connectionAliasAssociation_associatedAccountId = (ConnectionAliasAssociation -> Maybe Text)
-> (ConnectionAliasAssociation
    -> Maybe Text -> ConnectionAliasAssociation)
-> Lens
     ConnectionAliasAssociation
     ConnectionAliasAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionAliasAssociation' {Maybe Text
associatedAccountId :: Maybe Text
$sel:associatedAccountId:ConnectionAliasAssociation' :: ConnectionAliasAssociation -> Maybe Text
associatedAccountId} -> Maybe Text
associatedAccountId) (\s :: ConnectionAliasAssociation
s@ConnectionAliasAssociation' {} Maybe Text
a -> ConnectionAliasAssociation
s {$sel:associatedAccountId:ConnectionAliasAssociation' :: Maybe Text
associatedAccountId = Maybe Text
a} :: ConnectionAliasAssociation)

-- | The identifier of the directory associated with a connection alias.
connectionAliasAssociation_resourceId :: Lens.Lens' ConnectionAliasAssociation (Prelude.Maybe Prelude.Text)
connectionAliasAssociation_resourceId :: (Maybe Text -> f (Maybe Text))
-> ConnectionAliasAssociation -> f ConnectionAliasAssociation
connectionAliasAssociation_resourceId = (ConnectionAliasAssociation -> Maybe Text)
-> (ConnectionAliasAssociation
    -> Maybe Text -> ConnectionAliasAssociation)
-> Lens
     ConnectionAliasAssociation
     ConnectionAliasAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionAliasAssociation' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:ConnectionAliasAssociation' :: ConnectionAliasAssociation -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: ConnectionAliasAssociation
s@ConnectionAliasAssociation' {} Maybe Text
a -> ConnectionAliasAssociation
s {$sel:resourceId:ConnectionAliasAssociation' :: Maybe Text
resourceId = Maybe Text
a} :: ConnectionAliasAssociation)

-- | The association status of the connection alias.
connectionAliasAssociation_associationStatus :: Lens.Lens' ConnectionAliasAssociation (Prelude.Maybe AssociationStatus)
connectionAliasAssociation_associationStatus :: (Maybe AssociationStatus -> f (Maybe AssociationStatus))
-> ConnectionAliasAssociation -> f ConnectionAliasAssociation
connectionAliasAssociation_associationStatus = (ConnectionAliasAssociation -> Maybe AssociationStatus)
-> (ConnectionAliasAssociation
    -> Maybe AssociationStatus -> ConnectionAliasAssociation)
-> Lens
     ConnectionAliasAssociation
     ConnectionAliasAssociation
     (Maybe AssociationStatus)
     (Maybe AssociationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionAliasAssociation' {Maybe AssociationStatus
associationStatus :: Maybe AssociationStatus
$sel:associationStatus:ConnectionAliasAssociation' :: ConnectionAliasAssociation -> Maybe AssociationStatus
associationStatus} -> Maybe AssociationStatus
associationStatus) (\s :: ConnectionAliasAssociation
s@ConnectionAliasAssociation' {} Maybe AssociationStatus
a -> ConnectionAliasAssociation
s {$sel:associationStatus:ConnectionAliasAssociation' :: Maybe AssociationStatus
associationStatus = Maybe AssociationStatus
a} :: ConnectionAliasAssociation)

-- | The identifier of the connection alias association. You use the
-- connection identifier in the DNS TXT record when you\'re configuring
-- your DNS routing policies.
connectionAliasAssociation_connectionIdentifier :: Lens.Lens' ConnectionAliasAssociation (Prelude.Maybe Prelude.Text)
connectionAliasAssociation_connectionIdentifier :: (Maybe Text -> f (Maybe Text))
-> ConnectionAliasAssociation -> f ConnectionAliasAssociation
connectionAliasAssociation_connectionIdentifier = (ConnectionAliasAssociation -> Maybe Text)
-> (ConnectionAliasAssociation
    -> Maybe Text -> ConnectionAliasAssociation)
-> Lens
     ConnectionAliasAssociation
     ConnectionAliasAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionAliasAssociation' {Maybe Text
connectionIdentifier :: Maybe Text
$sel:connectionIdentifier:ConnectionAliasAssociation' :: ConnectionAliasAssociation -> Maybe Text
connectionIdentifier} -> Maybe Text
connectionIdentifier) (\s :: ConnectionAliasAssociation
s@ConnectionAliasAssociation' {} Maybe Text
a -> ConnectionAliasAssociation
s {$sel:connectionIdentifier:ConnectionAliasAssociation' :: Maybe Text
connectionIdentifier = Maybe Text
a} :: ConnectionAliasAssociation)

instance Core.FromJSON ConnectionAliasAssociation where
  parseJSON :: Value -> Parser ConnectionAliasAssociation
parseJSON =
    String
-> (Object -> Parser ConnectionAliasAssociation)
-> Value
-> Parser ConnectionAliasAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ConnectionAliasAssociation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe AssociationStatus
-> Maybe Text
-> ConnectionAliasAssociation
ConnectionAliasAssociation'
            (Maybe Text
 -> Maybe Text
 -> Maybe AssociationStatus
 -> Maybe Text
 -> ConnectionAliasAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AssociationStatus
      -> Maybe Text
      -> ConnectionAliasAssociation)
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
"AssociatedAccountId")
            Parser
  (Maybe Text
   -> Maybe AssociationStatus
   -> Maybe Text
   -> ConnectionAliasAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe AssociationStatus
      -> Maybe Text -> ConnectionAliasAssociation)
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
"ResourceId")
            Parser
  (Maybe AssociationStatus
   -> Maybe Text -> ConnectionAliasAssociation)
-> Parser (Maybe AssociationStatus)
-> Parser (Maybe Text -> ConnectionAliasAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AssociationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssociationStatus")
            Parser (Maybe Text -> ConnectionAliasAssociation)
-> Parser (Maybe Text) -> Parser ConnectionAliasAssociation
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
"ConnectionIdentifier")
      )

instance Prelude.Hashable ConnectionAliasAssociation

instance Prelude.NFData ConnectionAliasAssociation