{-# 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.Redshift.Types.EndpointAuthorization
-- 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.Redshift.Types.EndpointAuthorization where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
import Amazonka.Redshift.Types.AuthorizationStatus

-- | Describes an endpoint authorization for authorizing Redshift-managed VPC
-- endpoint access to a cluster across Amazon Web Services accounts.
--
-- /See:/ 'newEndpointAuthorization' smart constructor.
data EndpointAuthorization = EndpointAuthorization'
  { -- | The status of the authorization action.
    EndpointAuthorization -> Maybe AuthorizationStatus
status :: Prelude.Maybe AuthorizationStatus,
    -- | Indicates whether all VPCs in the grantee account are allowed access to
    -- the cluster.
    EndpointAuthorization -> Maybe Bool
allowedAllVPCs :: Prelude.Maybe Prelude.Bool,
    -- | The number of Redshift-managed VPC endpoints created for the
    -- authorization.
    EndpointAuthorization -> Maybe Int
endpointCount :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Web Services account ID of the cluster owner.
    EndpointAuthorization -> Maybe Text
grantor :: Prelude.Maybe Prelude.Text,
    -- | The cluster identifier.
    EndpointAuthorization -> Maybe Text
clusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account ID of the grantee of the cluster.
    EndpointAuthorization -> Maybe Text
grantee :: Prelude.Maybe Prelude.Text,
    -- | The VPCs allowed access to the cluster.
    EndpointAuthorization -> Maybe [Text]
allowedVPCs :: Prelude.Maybe [Prelude.Text],
    -- | The status of the cluster.
    EndpointAuthorization -> Maybe Text
clusterStatus :: Prelude.Maybe Prelude.Text,
    -- | The time (UTC) when the authorization was created.
    EndpointAuthorization -> Maybe ISO8601
authorizeTime :: Prelude.Maybe Core.ISO8601
  }
  deriving (EndpointAuthorization -> EndpointAuthorization -> Bool
(EndpointAuthorization -> EndpointAuthorization -> Bool)
-> (EndpointAuthorization -> EndpointAuthorization -> Bool)
-> Eq EndpointAuthorization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointAuthorization -> EndpointAuthorization -> Bool
$c/= :: EndpointAuthorization -> EndpointAuthorization -> Bool
== :: EndpointAuthorization -> EndpointAuthorization -> Bool
$c== :: EndpointAuthorization -> EndpointAuthorization -> Bool
Prelude.Eq, ReadPrec [EndpointAuthorization]
ReadPrec EndpointAuthorization
Int -> ReadS EndpointAuthorization
ReadS [EndpointAuthorization]
(Int -> ReadS EndpointAuthorization)
-> ReadS [EndpointAuthorization]
-> ReadPrec EndpointAuthorization
-> ReadPrec [EndpointAuthorization]
-> Read EndpointAuthorization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointAuthorization]
$creadListPrec :: ReadPrec [EndpointAuthorization]
readPrec :: ReadPrec EndpointAuthorization
$creadPrec :: ReadPrec EndpointAuthorization
readList :: ReadS [EndpointAuthorization]
$creadList :: ReadS [EndpointAuthorization]
readsPrec :: Int -> ReadS EndpointAuthorization
$creadsPrec :: Int -> ReadS EndpointAuthorization
Prelude.Read, Int -> EndpointAuthorization -> ShowS
[EndpointAuthorization] -> ShowS
EndpointAuthorization -> String
(Int -> EndpointAuthorization -> ShowS)
-> (EndpointAuthorization -> String)
-> ([EndpointAuthorization] -> ShowS)
-> Show EndpointAuthorization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointAuthorization] -> ShowS
$cshowList :: [EndpointAuthorization] -> ShowS
show :: EndpointAuthorization -> String
$cshow :: EndpointAuthorization -> String
showsPrec :: Int -> EndpointAuthorization -> ShowS
$cshowsPrec :: Int -> EndpointAuthorization -> ShowS
Prelude.Show, (forall x. EndpointAuthorization -> Rep EndpointAuthorization x)
-> (forall x. Rep EndpointAuthorization x -> EndpointAuthorization)
-> Generic EndpointAuthorization
forall x. Rep EndpointAuthorization x -> EndpointAuthorization
forall x. EndpointAuthorization -> Rep EndpointAuthorization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointAuthorization x -> EndpointAuthorization
$cfrom :: forall x. EndpointAuthorization -> Rep EndpointAuthorization x
Prelude.Generic)

-- |
-- Create a value of 'EndpointAuthorization' 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:
--
-- 'status', 'endpointAuthorization_status' - The status of the authorization action.
--
-- 'allowedAllVPCs', 'endpointAuthorization_allowedAllVPCs' - Indicates whether all VPCs in the grantee account are allowed access to
-- the cluster.
--
-- 'endpointCount', 'endpointAuthorization_endpointCount' - The number of Redshift-managed VPC endpoints created for the
-- authorization.
--
-- 'grantor', 'endpointAuthorization_grantor' - The Amazon Web Services account ID of the cluster owner.
--
-- 'clusterIdentifier', 'endpointAuthorization_clusterIdentifier' - The cluster identifier.
--
-- 'grantee', 'endpointAuthorization_grantee' - The Amazon Web Services account ID of the grantee of the cluster.
--
-- 'allowedVPCs', 'endpointAuthorization_allowedVPCs' - The VPCs allowed access to the cluster.
--
-- 'clusterStatus', 'endpointAuthorization_clusterStatus' - The status of the cluster.
--
-- 'authorizeTime', 'endpointAuthorization_authorizeTime' - The time (UTC) when the authorization was created.
newEndpointAuthorization ::
  EndpointAuthorization
newEndpointAuthorization :: EndpointAuthorization
newEndpointAuthorization =
  EndpointAuthorization' :: Maybe AuthorizationStatus
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe ISO8601
-> EndpointAuthorization
EndpointAuthorization'
    { $sel:status:EndpointAuthorization' :: Maybe AuthorizationStatus
status = Maybe AuthorizationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedAllVPCs:EndpointAuthorization' :: Maybe Bool
allowedAllVPCs = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointCount:EndpointAuthorization' :: Maybe Int
endpointCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:grantor:EndpointAuthorization' :: Maybe Text
grantor = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterIdentifier:EndpointAuthorization' :: Maybe Text
clusterIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:grantee:EndpointAuthorization' :: Maybe Text
grantee = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedVPCs:EndpointAuthorization' :: Maybe [Text]
allowedVPCs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterStatus:EndpointAuthorization' :: Maybe Text
clusterStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizeTime:EndpointAuthorization' :: Maybe ISO8601
authorizeTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the authorization action.
endpointAuthorization_status :: Lens.Lens' EndpointAuthorization (Prelude.Maybe AuthorizationStatus)
endpointAuthorization_status :: (Maybe AuthorizationStatus -> f (Maybe AuthorizationStatus))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_status = (EndpointAuthorization -> Maybe AuthorizationStatus)
-> (EndpointAuthorization
    -> Maybe AuthorizationStatus -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe AuthorizationStatus)
     (Maybe AuthorizationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe AuthorizationStatus
status :: Maybe AuthorizationStatus
$sel:status:EndpointAuthorization' :: EndpointAuthorization -> Maybe AuthorizationStatus
status} -> Maybe AuthorizationStatus
status) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe AuthorizationStatus
a -> EndpointAuthorization
s {$sel:status:EndpointAuthorization' :: Maybe AuthorizationStatus
status = Maybe AuthorizationStatus
a} :: EndpointAuthorization)

-- | Indicates whether all VPCs in the grantee account are allowed access to
-- the cluster.
endpointAuthorization_allowedAllVPCs :: Lens.Lens' EndpointAuthorization (Prelude.Maybe Prelude.Bool)
endpointAuthorization_allowedAllVPCs :: (Maybe Bool -> f (Maybe Bool))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_allowedAllVPCs = (EndpointAuthorization -> Maybe Bool)
-> (EndpointAuthorization -> Maybe Bool -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe Bool
allowedAllVPCs :: Maybe Bool
$sel:allowedAllVPCs:EndpointAuthorization' :: EndpointAuthorization -> Maybe Bool
allowedAllVPCs} -> Maybe Bool
allowedAllVPCs) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe Bool
a -> EndpointAuthorization
s {$sel:allowedAllVPCs:EndpointAuthorization' :: Maybe Bool
allowedAllVPCs = Maybe Bool
a} :: EndpointAuthorization)

-- | The number of Redshift-managed VPC endpoints created for the
-- authorization.
endpointAuthorization_endpointCount :: Lens.Lens' EndpointAuthorization (Prelude.Maybe Prelude.Int)
endpointAuthorization_endpointCount :: (Maybe Int -> f (Maybe Int))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_endpointCount = (EndpointAuthorization -> Maybe Int)
-> (EndpointAuthorization -> Maybe Int -> EndpointAuthorization)
-> Lens
     EndpointAuthorization EndpointAuthorization (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe Int
endpointCount :: Maybe Int
$sel:endpointCount:EndpointAuthorization' :: EndpointAuthorization -> Maybe Int
endpointCount} -> Maybe Int
endpointCount) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe Int
a -> EndpointAuthorization
s {$sel:endpointCount:EndpointAuthorization' :: Maybe Int
endpointCount = Maybe Int
a} :: EndpointAuthorization)

-- | The Amazon Web Services account ID of the cluster owner.
endpointAuthorization_grantor :: Lens.Lens' EndpointAuthorization (Prelude.Maybe Prelude.Text)
endpointAuthorization_grantor :: (Maybe Text -> f (Maybe Text))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_grantor = (EndpointAuthorization -> Maybe Text)
-> (EndpointAuthorization -> Maybe Text -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe Text
grantor :: Maybe Text
$sel:grantor:EndpointAuthorization' :: EndpointAuthorization -> Maybe Text
grantor} -> Maybe Text
grantor) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe Text
a -> EndpointAuthorization
s {$sel:grantor:EndpointAuthorization' :: Maybe Text
grantor = Maybe Text
a} :: EndpointAuthorization)

-- | The cluster identifier.
endpointAuthorization_clusterIdentifier :: Lens.Lens' EndpointAuthorization (Prelude.Maybe Prelude.Text)
endpointAuthorization_clusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_clusterIdentifier = (EndpointAuthorization -> Maybe Text)
-> (EndpointAuthorization -> Maybe Text -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe Text
clusterIdentifier :: Maybe Text
$sel:clusterIdentifier:EndpointAuthorization' :: EndpointAuthorization -> Maybe Text
clusterIdentifier} -> Maybe Text
clusterIdentifier) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe Text
a -> EndpointAuthorization
s {$sel:clusterIdentifier:EndpointAuthorization' :: Maybe Text
clusterIdentifier = Maybe Text
a} :: EndpointAuthorization)

-- | The Amazon Web Services account ID of the grantee of the cluster.
endpointAuthorization_grantee :: Lens.Lens' EndpointAuthorization (Prelude.Maybe Prelude.Text)
endpointAuthorization_grantee :: (Maybe Text -> f (Maybe Text))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_grantee = (EndpointAuthorization -> Maybe Text)
-> (EndpointAuthorization -> Maybe Text -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe Text
grantee :: Maybe Text
$sel:grantee:EndpointAuthorization' :: EndpointAuthorization -> Maybe Text
grantee} -> Maybe Text
grantee) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe Text
a -> EndpointAuthorization
s {$sel:grantee:EndpointAuthorization' :: Maybe Text
grantee = Maybe Text
a} :: EndpointAuthorization)

-- | The VPCs allowed access to the cluster.
endpointAuthorization_allowedVPCs :: Lens.Lens' EndpointAuthorization (Prelude.Maybe [Prelude.Text])
endpointAuthorization_allowedVPCs :: (Maybe [Text] -> f (Maybe [Text]))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_allowedVPCs = (EndpointAuthorization -> Maybe [Text])
-> (EndpointAuthorization -> Maybe [Text] -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe [Text]
allowedVPCs :: Maybe [Text]
$sel:allowedVPCs:EndpointAuthorization' :: EndpointAuthorization -> Maybe [Text]
allowedVPCs} -> Maybe [Text]
allowedVPCs) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe [Text]
a -> EndpointAuthorization
s {$sel:allowedVPCs:EndpointAuthorization' :: Maybe [Text]
allowedVPCs = Maybe [Text]
a} :: EndpointAuthorization) ((Maybe [Text] -> f (Maybe [Text]))
 -> EndpointAuthorization -> f EndpointAuthorization)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EndpointAuthorization
-> f EndpointAuthorization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The status of the cluster.
endpointAuthorization_clusterStatus :: Lens.Lens' EndpointAuthorization (Prelude.Maybe Prelude.Text)
endpointAuthorization_clusterStatus :: (Maybe Text -> f (Maybe Text))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_clusterStatus = (EndpointAuthorization -> Maybe Text)
-> (EndpointAuthorization -> Maybe Text -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe Text
clusterStatus :: Maybe Text
$sel:clusterStatus:EndpointAuthorization' :: EndpointAuthorization -> Maybe Text
clusterStatus} -> Maybe Text
clusterStatus) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe Text
a -> EndpointAuthorization
s {$sel:clusterStatus:EndpointAuthorization' :: Maybe Text
clusterStatus = Maybe Text
a} :: EndpointAuthorization)

-- | The time (UTC) when the authorization was created.
endpointAuthorization_authorizeTime :: Lens.Lens' EndpointAuthorization (Prelude.Maybe Prelude.UTCTime)
endpointAuthorization_authorizeTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EndpointAuthorization -> f EndpointAuthorization
endpointAuthorization_authorizeTime = (EndpointAuthorization -> Maybe ISO8601)
-> (EndpointAuthorization
    -> Maybe ISO8601 -> EndpointAuthorization)
-> Lens
     EndpointAuthorization
     EndpointAuthorization
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointAuthorization' {Maybe ISO8601
authorizeTime :: Maybe ISO8601
$sel:authorizeTime:EndpointAuthorization' :: EndpointAuthorization -> Maybe ISO8601
authorizeTime} -> Maybe ISO8601
authorizeTime) (\s :: EndpointAuthorization
s@EndpointAuthorization' {} Maybe ISO8601
a -> EndpointAuthorization
s {$sel:authorizeTime:EndpointAuthorization' :: Maybe ISO8601
authorizeTime = Maybe ISO8601
a} :: EndpointAuthorization) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> EndpointAuthorization -> f EndpointAuthorization)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EndpointAuthorization
-> f EndpointAuthorization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromXML EndpointAuthorization where
  parseXML :: [Node] -> Either String EndpointAuthorization
parseXML [Node]
x =
    Maybe AuthorizationStatus
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe ISO8601
-> EndpointAuthorization
EndpointAuthorization'
      (Maybe AuthorizationStatus
 -> Maybe Bool
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe ISO8601
 -> EndpointAuthorization)
-> Either String (Maybe AuthorizationStatus)
-> Either
     String
     (Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> EndpointAuthorization)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe AuthorizationStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> EndpointAuthorization)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> EndpointAuthorization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AllowedAllVPCs")
      Either
  String
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> EndpointAuthorization)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> EndpointAuthorization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EndpointCount")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> EndpointAuthorization)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> EndpointAuthorization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Grantor")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> EndpointAuthorization)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> EndpointAuthorization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ClusterIdentifier")
      Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> EndpointAuthorization)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text -> Maybe ISO8601 -> EndpointAuthorization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Grantee")
      Either
  String
  (Maybe [Text]
   -> Maybe Text -> Maybe ISO8601 -> EndpointAuthorization)
-> Either String (Maybe [Text])
-> Either
     String (Maybe Text -> Maybe ISO8601 -> EndpointAuthorization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AllowedVPCs" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"VpcIdentifier")
                  )
      Either
  String (Maybe Text -> Maybe ISO8601 -> EndpointAuthorization)
-> Either String (Maybe Text)
-> Either String (Maybe ISO8601 -> EndpointAuthorization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ClusterStatus")
      Either String (Maybe ISO8601 -> EndpointAuthorization)
-> Either String (Maybe ISO8601)
-> Either String EndpointAuthorization
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AuthorizeTime")

instance Prelude.Hashable EndpointAuthorization

instance Prelude.NFData EndpointAuthorization