{-# 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.WorkMail.Types.AccessControlRule
-- 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.WorkMail.Types.AccessControlRule where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkMail.Types.AccessControlRuleEffect

-- | A rule that controls access to an Amazon WorkMail organization.
--
-- /See:/ 'newAccessControlRule' smart constructor.
data AccessControlRule = AccessControlRule'
  { -- | The rule effect.
    AccessControlRule -> Maybe AccessControlRuleEffect
effect :: Prelude.Maybe AccessControlRuleEffect,
    -- | User IDs to include in the rule.
    AccessControlRule -> Maybe [Text]
userIds :: Prelude.Maybe [Prelude.Text],
    -- | Access protocol actions to include in the rule. Valid values include
    -- @ActiveSync@, @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@,
    -- and @WebMail@.
    AccessControlRule -> Maybe [Text]
actions :: Prelude.Maybe [Prelude.Text],
    -- | The date that the rule was created.
    AccessControlRule -> Maybe POSIX
dateCreated :: Prelude.Maybe Core.POSIX,
    -- | The rule name.
    AccessControlRule -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | User IDs to exclude from the rule.
    AccessControlRule -> Maybe [Text]
notUserIds :: Prelude.Maybe [Prelude.Text],
    -- | The date that the rule was modified.
    AccessControlRule -> Maybe POSIX
dateModified :: Prelude.Maybe Core.POSIX,
    -- | IPv4 CIDR ranges to include in the rule.
    AccessControlRule -> Maybe [Text]
ipRanges :: Prelude.Maybe [Prelude.Text],
    -- | IPv4 CIDR ranges to exclude from the rule.
    AccessControlRule -> Maybe [Text]
notIpRanges :: Prelude.Maybe [Prelude.Text],
    -- | Access protocol actions to exclude from the rule. Valid values include
    -- @ActiveSync@, @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@,
    -- and @WebMail@.
    AccessControlRule -> Maybe [Text]
notActions :: Prelude.Maybe [Prelude.Text],
    -- | The rule description.
    AccessControlRule -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (AccessControlRule -> AccessControlRule -> Bool
(AccessControlRule -> AccessControlRule -> Bool)
-> (AccessControlRule -> AccessControlRule -> Bool)
-> Eq AccessControlRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessControlRule -> AccessControlRule -> Bool
$c/= :: AccessControlRule -> AccessControlRule -> Bool
== :: AccessControlRule -> AccessControlRule -> Bool
$c== :: AccessControlRule -> AccessControlRule -> Bool
Prelude.Eq, ReadPrec [AccessControlRule]
ReadPrec AccessControlRule
Int -> ReadS AccessControlRule
ReadS [AccessControlRule]
(Int -> ReadS AccessControlRule)
-> ReadS [AccessControlRule]
-> ReadPrec AccessControlRule
-> ReadPrec [AccessControlRule]
-> Read AccessControlRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessControlRule]
$creadListPrec :: ReadPrec [AccessControlRule]
readPrec :: ReadPrec AccessControlRule
$creadPrec :: ReadPrec AccessControlRule
readList :: ReadS [AccessControlRule]
$creadList :: ReadS [AccessControlRule]
readsPrec :: Int -> ReadS AccessControlRule
$creadsPrec :: Int -> ReadS AccessControlRule
Prelude.Read, Int -> AccessControlRule -> ShowS
[AccessControlRule] -> ShowS
AccessControlRule -> String
(Int -> AccessControlRule -> ShowS)
-> (AccessControlRule -> String)
-> ([AccessControlRule] -> ShowS)
-> Show AccessControlRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessControlRule] -> ShowS
$cshowList :: [AccessControlRule] -> ShowS
show :: AccessControlRule -> String
$cshow :: AccessControlRule -> String
showsPrec :: Int -> AccessControlRule -> ShowS
$cshowsPrec :: Int -> AccessControlRule -> ShowS
Prelude.Show, (forall x. AccessControlRule -> Rep AccessControlRule x)
-> (forall x. Rep AccessControlRule x -> AccessControlRule)
-> Generic AccessControlRule
forall x. Rep AccessControlRule x -> AccessControlRule
forall x. AccessControlRule -> Rep AccessControlRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessControlRule x -> AccessControlRule
$cfrom :: forall x. AccessControlRule -> Rep AccessControlRule x
Prelude.Generic)

-- |
-- Create a value of 'AccessControlRule' 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:
--
-- 'effect', 'accessControlRule_effect' - The rule effect.
--
-- 'userIds', 'accessControlRule_userIds' - User IDs to include in the rule.
--
-- 'actions', 'accessControlRule_actions' - Access protocol actions to include in the rule. Valid values include
-- @ActiveSync@, @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@,
-- and @WebMail@.
--
-- 'dateCreated', 'accessControlRule_dateCreated' - The date that the rule was created.
--
-- 'name', 'accessControlRule_name' - The rule name.
--
-- 'notUserIds', 'accessControlRule_notUserIds' - User IDs to exclude from the rule.
--
-- 'dateModified', 'accessControlRule_dateModified' - The date that the rule was modified.
--
-- 'ipRanges', 'accessControlRule_ipRanges' - IPv4 CIDR ranges to include in the rule.
--
-- 'notIpRanges', 'accessControlRule_notIpRanges' - IPv4 CIDR ranges to exclude from the rule.
--
-- 'notActions', 'accessControlRule_notActions' - Access protocol actions to exclude from the rule. Valid values include
-- @ActiveSync@, @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@,
-- and @WebMail@.
--
-- 'description', 'accessControlRule_description' - The rule description.
newAccessControlRule ::
  AccessControlRule
newAccessControlRule :: AccessControlRule
newAccessControlRule =
  AccessControlRule' :: Maybe AccessControlRuleEffect
-> Maybe [Text]
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> AccessControlRule
AccessControlRule'
    { $sel:effect:AccessControlRule' :: Maybe AccessControlRuleEffect
effect = Maybe AccessControlRuleEffect
forall a. Maybe a
Prelude.Nothing,
      $sel:userIds:AccessControlRule' :: Maybe [Text]
userIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:actions:AccessControlRule' :: Maybe [Text]
actions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:dateCreated:AccessControlRule' :: Maybe POSIX
dateCreated = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AccessControlRule' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:notUserIds:AccessControlRule' :: Maybe [Text]
notUserIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:dateModified:AccessControlRule' :: Maybe POSIX
dateModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:ipRanges:AccessControlRule' :: Maybe [Text]
ipRanges = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:notIpRanges:AccessControlRule' :: Maybe [Text]
notIpRanges = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:notActions:AccessControlRule' :: Maybe [Text]
notActions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AccessControlRule' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The rule effect.
accessControlRule_effect :: Lens.Lens' AccessControlRule (Prelude.Maybe AccessControlRuleEffect)
accessControlRule_effect :: (Maybe AccessControlRuleEffect
 -> f (Maybe AccessControlRuleEffect))
-> AccessControlRule -> f AccessControlRule
accessControlRule_effect = (AccessControlRule -> Maybe AccessControlRuleEffect)
-> (AccessControlRule
    -> Maybe AccessControlRuleEffect -> AccessControlRule)
-> Lens
     AccessControlRule
     AccessControlRule
     (Maybe AccessControlRuleEffect)
     (Maybe AccessControlRuleEffect)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe AccessControlRuleEffect
effect :: Maybe AccessControlRuleEffect
$sel:effect:AccessControlRule' :: AccessControlRule -> Maybe AccessControlRuleEffect
effect} -> Maybe AccessControlRuleEffect
effect) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe AccessControlRuleEffect
a -> AccessControlRule
s {$sel:effect:AccessControlRule' :: Maybe AccessControlRuleEffect
effect = Maybe AccessControlRuleEffect
a} :: AccessControlRule)

-- | User IDs to include in the rule.
accessControlRule_userIds :: Lens.Lens' AccessControlRule (Prelude.Maybe [Prelude.Text])
accessControlRule_userIds :: (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule -> f AccessControlRule
accessControlRule_userIds = (AccessControlRule -> Maybe [Text])
-> (AccessControlRule -> Maybe [Text] -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe [Text]
userIds :: Maybe [Text]
$sel:userIds:AccessControlRule' :: AccessControlRule -> Maybe [Text]
userIds} -> Maybe [Text]
userIds) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe [Text]
a -> AccessControlRule
s {$sel:userIds:AccessControlRule' :: Maybe [Text]
userIds = Maybe [Text]
a} :: AccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule
-> f AccessControlRule
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

-- | Access protocol actions to include in the rule. Valid values include
-- @ActiveSync@, @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@,
-- and @WebMail@.
accessControlRule_actions :: Lens.Lens' AccessControlRule (Prelude.Maybe [Prelude.Text])
accessControlRule_actions :: (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule -> f AccessControlRule
accessControlRule_actions = (AccessControlRule -> Maybe [Text])
-> (AccessControlRule -> Maybe [Text] -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe [Text]
actions :: Maybe [Text]
$sel:actions:AccessControlRule' :: AccessControlRule -> Maybe [Text]
actions} -> Maybe [Text]
actions) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe [Text]
a -> AccessControlRule
s {$sel:actions:AccessControlRule' :: Maybe [Text]
actions = Maybe [Text]
a} :: AccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule
-> f AccessControlRule
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 date that the rule was created.
accessControlRule_dateCreated :: Lens.Lens' AccessControlRule (Prelude.Maybe Prelude.UTCTime)
accessControlRule_dateCreated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessControlRule -> f AccessControlRule
accessControlRule_dateCreated = (AccessControlRule -> Maybe POSIX)
-> (AccessControlRule -> Maybe POSIX -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe POSIX
dateCreated :: Maybe POSIX
$sel:dateCreated:AccessControlRule' :: AccessControlRule -> Maybe POSIX
dateCreated} -> Maybe POSIX
dateCreated) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe POSIX
a -> AccessControlRule
s {$sel:dateCreated:AccessControlRule' :: Maybe POSIX
dateCreated = Maybe POSIX
a} :: AccessControlRule) ((Maybe POSIX -> f (Maybe POSIX))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessControlRule
-> f AccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The rule name.
accessControlRule_name :: Lens.Lens' AccessControlRule (Prelude.Maybe Prelude.Text)
accessControlRule_name :: (Maybe Text -> f (Maybe Text))
-> AccessControlRule -> f AccessControlRule
accessControlRule_name = (AccessControlRule -> Maybe Text)
-> (AccessControlRule -> Maybe Text -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe Text
name :: Maybe Text
$sel:name:AccessControlRule' :: AccessControlRule -> Maybe Text
name} -> Maybe Text
name) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe Text
a -> AccessControlRule
s {$sel:name:AccessControlRule' :: Maybe Text
name = Maybe Text
a} :: AccessControlRule)

-- | User IDs to exclude from the rule.
accessControlRule_notUserIds :: Lens.Lens' AccessControlRule (Prelude.Maybe [Prelude.Text])
accessControlRule_notUserIds :: (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule -> f AccessControlRule
accessControlRule_notUserIds = (AccessControlRule -> Maybe [Text])
-> (AccessControlRule -> Maybe [Text] -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe [Text]
notUserIds :: Maybe [Text]
$sel:notUserIds:AccessControlRule' :: AccessControlRule -> Maybe [Text]
notUserIds} -> Maybe [Text]
notUserIds) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe [Text]
a -> AccessControlRule
s {$sel:notUserIds:AccessControlRule' :: Maybe [Text]
notUserIds = Maybe [Text]
a} :: AccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule
-> f AccessControlRule
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 date that the rule was modified.
accessControlRule_dateModified :: Lens.Lens' AccessControlRule (Prelude.Maybe Prelude.UTCTime)
accessControlRule_dateModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessControlRule -> f AccessControlRule
accessControlRule_dateModified = (AccessControlRule -> Maybe POSIX)
-> (AccessControlRule -> Maybe POSIX -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe POSIX
dateModified :: Maybe POSIX
$sel:dateModified:AccessControlRule' :: AccessControlRule -> Maybe POSIX
dateModified} -> Maybe POSIX
dateModified) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe POSIX
a -> AccessControlRule
s {$sel:dateModified:AccessControlRule' :: Maybe POSIX
dateModified = Maybe POSIX
a} :: AccessControlRule) ((Maybe POSIX -> f (Maybe POSIX))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessControlRule
-> f AccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | IPv4 CIDR ranges to include in the rule.
accessControlRule_ipRanges :: Lens.Lens' AccessControlRule (Prelude.Maybe [Prelude.Text])
accessControlRule_ipRanges :: (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule -> f AccessControlRule
accessControlRule_ipRanges = (AccessControlRule -> Maybe [Text])
-> (AccessControlRule -> Maybe [Text] -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe [Text]
ipRanges :: Maybe [Text]
$sel:ipRanges:AccessControlRule' :: AccessControlRule -> Maybe [Text]
ipRanges} -> Maybe [Text]
ipRanges) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe [Text]
a -> AccessControlRule
s {$sel:ipRanges:AccessControlRule' :: Maybe [Text]
ipRanges = Maybe [Text]
a} :: AccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule
-> f AccessControlRule
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

-- | IPv4 CIDR ranges to exclude from the rule.
accessControlRule_notIpRanges :: Lens.Lens' AccessControlRule (Prelude.Maybe [Prelude.Text])
accessControlRule_notIpRanges :: (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule -> f AccessControlRule
accessControlRule_notIpRanges = (AccessControlRule -> Maybe [Text])
-> (AccessControlRule -> Maybe [Text] -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe [Text]
notIpRanges :: Maybe [Text]
$sel:notIpRanges:AccessControlRule' :: AccessControlRule -> Maybe [Text]
notIpRanges} -> Maybe [Text]
notIpRanges) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe [Text]
a -> AccessControlRule
s {$sel:notIpRanges:AccessControlRule' :: Maybe [Text]
notIpRanges = Maybe [Text]
a} :: AccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule
-> f AccessControlRule
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

-- | Access protocol actions to exclude from the rule. Valid values include
-- @ActiveSync@, @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@,
-- and @WebMail@.
accessControlRule_notActions :: Lens.Lens' AccessControlRule (Prelude.Maybe [Prelude.Text])
accessControlRule_notActions :: (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule -> f AccessControlRule
accessControlRule_notActions = (AccessControlRule -> Maybe [Text])
-> (AccessControlRule -> Maybe [Text] -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe [Text]
notActions :: Maybe [Text]
$sel:notActions:AccessControlRule' :: AccessControlRule -> Maybe [Text]
notActions} -> Maybe [Text]
notActions) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe [Text]
a -> AccessControlRule
s {$sel:notActions:AccessControlRule' :: Maybe [Text]
notActions = Maybe [Text]
a} :: AccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> AccessControlRule -> f AccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AccessControlRule
-> f AccessControlRule
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 rule description.
accessControlRule_description :: Lens.Lens' AccessControlRule (Prelude.Maybe Prelude.Text)
accessControlRule_description :: (Maybe Text -> f (Maybe Text))
-> AccessControlRule -> f AccessControlRule
accessControlRule_description = (AccessControlRule -> Maybe Text)
-> (AccessControlRule -> Maybe Text -> AccessControlRule)
-> Lens
     AccessControlRule AccessControlRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessControlRule' {Maybe Text
description :: Maybe Text
$sel:description:AccessControlRule' :: AccessControlRule -> Maybe Text
description} -> Maybe Text
description) (\s :: AccessControlRule
s@AccessControlRule' {} Maybe Text
a -> AccessControlRule
s {$sel:description:AccessControlRule' :: Maybe Text
description = Maybe Text
a} :: AccessControlRule)

instance Core.FromJSON AccessControlRule where
  parseJSON :: Value -> Parser AccessControlRule
parseJSON =
    String
-> (Object -> Parser AccessControlRule)
-> Value
-> Parser AccessControlRule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AccessControlRule"
      ( \Object
x ->
          Maybe AccessControlRuleEffect
-> Maybe [Text]
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> AccessControlRule
AccessControlRule'
            (Maybe AccessControlRuleEffect
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe POSIX
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe Text
 -> AccessControlRule)
-> Parser (Maybe AccessControlRuleEffect)
-> Parser
     (Maybe [Text]
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> AccessControlRule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AccessControlRuleEffect)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Effect")
            Parser
  (Maybe [Text]
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> AccessControlRule)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserIds" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> AccessControlRule)
-> Parser (Maybe [Text])
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Actions" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> AccessControlRule)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DateCreated")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> AccessControlRule)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> AccessControlRule)
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
"Name")
            Parser
  (Maybe [Text]
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> AccessControlRule)
-> Parser (Maybe [Text])
-> Parser
     (Maybe POSIX
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Text
      -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotUserIds" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe POSIX
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Text
   -> AccessControlRule)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe [Text]
      -> Maybe [Text] -> Maybe [Text] -> Maybe Text -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DateModified")
            Parser
  (Maybe [Text]
   -> Maybe [Text] -> Maybe [Text] -> Maybe Text -> AccessControlRule)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text] -> Maybe [Text] -> Maybe Text -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpRanges" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [Text] -> Maybe [Text] -> Maybe Text -> AccessControlRule)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> Maybe Text -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotIpRanges" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe [Text] -> Maybe Text -> AccessControlRule)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> AccessControlRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotActions" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Text -> AccessControlRule)
-> Parser (Maybe Text) -> Parser AccessControlRule
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
"Description")
      )

instance Prelude.Hashable AccessControlRule

instance Prelude.NFData AccessControlRule