{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetAccessControlEffect
-- 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)
--
-- Gets the effects of an organization\'s access control rules as they
-- apply to a specified IPv4 address, access protocol action, or user ID.
module Amazonka.WorkMail.GetAccessControlEffect
  ( -- * Creating a Request
    GetAccessControlEffect (..),
    newGetAccessControlEffect,

    -- * Request Lenses
    getAccessControlEffect_organizationId,
    getAccessControlEffect_ipAddress,
    getAccessControlEffect_action,
    getAccessControlEffect_userId,

    -- * Destructuring the Response
    GetAccessControlEffectResponse (..),
    newGetAccessControlEffectResponse,

    -- * Response Lenses
    getAccessControlEffectResponse_effect,
    getAccessControlEffectResponse_matchedRules,
    getAccessControlEffectResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkMail.Types

-- | /See:/ 'newGetAccessControlEffect' smart constructor.
data GetAccessControlEffect = GetAccessControlEffect'
  { -- | The identifier for the organization.
    GetAccessControlEffect -> Text
organizationId :: Prelude.Text,
    -- | The IPv4 address.
    GetAccessControlEffect -> Text
ipAddress :: Prelude.Text,
    -- | The access protocol action. Valid values include @ActiveSync@,
    -- @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@, and @WebMail@.
    GetAccessControlEffect -> Text
action :: Prelude.Text,
    -- | The user ID.
    GetAccessControlEffect -> Text
userId :: Prelude.Text
  }
  deriving (GetAccessControlEffect -> GetAccessControlEffect -> Bool
(GetAccessControlEffect -> GetAccessControlEffect -> Bool)
-> (GetAccessControlEffect -> GetAccessControlEffect -> Bool)
-> Eq GetAccessControlEffect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccessControlEffect -> GetAccessControlEffect -> Bool
$c/= :: GetAccessControlEffect -> GetAccessControlEffect -> Bool
== :: GetAccessControlEffect -> GetAccessControlEffect -> Bool
$c== :: GetAccessControlEffect -> GetAccessControlEffect -> Bool
Prelude.Eq, ReadPrec [GetAccessControlEffect]
ReadPrec GetAccessControlEffect
Int -> ReadS GetAccessControlEffect
ReadS [GetAccessControlEffect]
(Int -> ReadS GetAccessControlEffect)
-> ReadS [GetAccessControlEffect]
-> ReadPrec GetAccessControlEffect
-> ReadPrec [GetAccessControlEffect]
-> Read GetAccessControlEffect
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccessControlEffect]
$creadListPrec :: ReadPrec [GetAccessControlEffect]
readPrec :: ReadPrec GetAccessControlEffect
$creadPrec :: ReadPrec GetAccessControlEffect
readList :: ReadS [GetAccessControlEffect]
$creadList :: ReadS [GetAccessControlEffect]
readsPrec :: Int -> ReadS GetAccessControlEffect
$creadsPrec :: Int -> ReadS GetAccessControlEffect
Prelude.Read, Int -> GetAccessControlEffect -> ShowS
[GetAccessControlEffect] -> ShowS
GetAccessControlEffect -> String
(Int -> GetAccessControlEffect -> ShowS)
-> (GetAccessControlEffect -> String)
-> ([GetAccessControlEffect] -> ShowS)
-> Show GetAccessControlEffect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccessControlEffect] -> ShowS
$cshowList :: [GetAccessControlEffect] -> ShowS
show :: GetAccessControlEffect -> String
$cshow :: GetAccessControlEffect -> String
showsPrec :: Int -> GetAccessControlEffect -> ShowS
$cshowsPrec :: Int -> GetAccessControlEffect -> ShowS
Prelude.Show, (forall x. GetAccessControlEffect -> Rep GetAccessControlEffect x)
-> (forall x.
    Rep GetAccessControlEffect x -> GetAccessControlEffect)
-> Generic GetAccessControlEffect
forall x. Rep GetAccessControlEffect x -> GetAccessControlEffect
forall x. GetAccessControlEffect -> Rep GetAccessControlEffect x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAccessControlEffect x -> GetAccessControlEffect
$cfrom :: forall x. GetAccessControlEffect -> Rep GetAccessControlEffect x
Prelude.Generic)

-- |
-- Create a value of 'GetAccessControlEffect' 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:
--
-- 'organizationId', 'getAccessControlEffect_organizationId' - The identifier for the organization.
--
-- 'ipAddress', 'getAccessControlEffect_ipAddress' - The IPv4 address.
--
-- 'action', 'getAccessControlEffect_action' - The access protocol action. Valid values include @ActiveSync@,
-- @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@, and @WebMail@.
--
-- 'userId', 'getAccessControlEffect_userId' - The user ID.
newGetAccessControlEffect ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'ipAddress'
  Prelude.Text ->
  -- | 'action'
  Prelude.Text ->
  -- | 'userId'
  Prelude.Text ->
  GetAccessControlEffect
newGetAccessControlEffect :: Text -> Text -> Text -> Text -> GetAccessControlEffect
newGetAccessControlEffect
  Text
pOrganizationId_
  Text
pIpAddress_
  Text
pAction_
  Text
pUserId_ =
    GetAccessControlEffect' :: Text -> Text -> Text -> Text -> GetAccessControlEffect
GetAccessControlEffect'
      { $sel:organizationId:GetAccessControlEffect' :: Text
organizationId =
          Text
pOrganizationId_,
        $sel:ipAddress:GetAccessControlEffect' :: Text
ipAddress = Text
pIpAddress_,
        $sel:action:GetAccessControlEffect' :: Text
action = Text
pAction_,
        $sel:userId:GetAccessControlEffect' :: Text
userId = Text
pUserId_
      }

-- | The identifier for the organization.
getAccessControlEffect_organizationId :: Lens.Lens' GetAccessControlEffect Prelude.Text
getAccessControlEffect_organizationId :: (Text -> f Text)
-> GetAccessControlEffect -> f GetAccessControlEffect
getAccessControlEffect_organizationId = (GetAccessControlEffect -> Text)
-> (GetAccessControlEffect -> Text -> GetAccessControlEffect)
-> Lens GetAccessControlEffect GetAccessControlEffect Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessControlEffect' {Text
organizationId :: Text
$sel:organizationId:GetAccessControlEffect' :: GetAccessControlEffect -> Text
organizationId} -> Text
organizationId) (\s :: GetAccessControlEffect
s@GetAccessControlEffect' {} Text
a -> GetAccessControlEffect
s {$sel:organizationId:GetAccessControlEffect' :: Text
organizationId = Text
a} :: GetAccessControlEffect)

-- | The IPv4 address.
getAccessControlEffect_ipAddress :: Lens.Lens' GetAccessControlEffect Prelude.Text
getAccessControlEffect_ipAddress :: (Text -> f Text)
-> GetAccessControlEffect -> f GetAccessControlEffect
getAccessControlEffect_ipAddress = (GetAccessControlEffect -> Text)
-> (GetAccessControlEffect -> Text -> GetAccessControlEffect)
-> Lens GetAccessControlEffect GetAccessControlEffect Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessControlEffect' {Text
ipAddress :: Text
$sel:ipAddress:GetAccessControlEffect' :: GetAccessControlEffect -> Text
ipAddress} -> Text
ipAddress) (\s :: GetAccessControlEffect
s@GetAccessControlEffect' {} Text
a -> GetAccessControlEffect
s {$sel:ipAddress:GetAccessControlEffect' :: Text
ipAddress = Text
a} :: GetAccessControlEffect)

-- | The access protocol action. Valid values include @ActiveSync@,
-- @AutoDiscover@, @EWS@, @IMAP@, @SMTP@, @WindowsOutlook@, and @WebMail@.
getAccessControlEffect_action :: Lens.Lens' GetAccessControlEffect Prelude.Text
getAccessControlEffect_action :: (Text -> f Text)
-> GetAccessControlEffect -> f GetAccessControlEffect
getAccessControlEffect_action = (GetAccessControlEffect -> Text)
-> (GetAccessControlEffect -> Text -> GetAccessControlEffect)
-> Lens GetAccessControlEffect GetAccessControlEffect Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessControlEffect' {Text
action :: Text
$sel:action:GetAccessControlEffect' :: GetAccessControlEffect -> Text
action} -> Text
action) (\s :: GetAccessControlEffect
s@GetAccessControlEffect' {} Text
a -> GetAccessControlEffect
s {$sel:action:GetAccessControlEffect' :: Text
action = Text
a} :: GetAccessControlEffect)

-- | The user ID.
getAccessControlEffect_userId :: Lens.Lens' GetAccessControlEffect Prelude.Text
getAccessControlEffect_userId :: (Text -> f Text)
-> GetAccessControlEffect -> f GetAccessControlEffect
getAccessControlEffect_userId = (GetAccessControlEffect -> Text)
-> (GetAccessControlEffect -> Text -> GetAccessControlEffect)
-> Lens GetAccessControlEffect GetAccessControlEffect Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessControlEffect' {Text
userId :: Text
$sel:userId:GetAccessControlEffect' :: GetAccessControlEffect -> Text
userId} -> Text
userId) (\s :: GetAccessControlEffect
s@GetAccessControlEffect' {} Text
a -> GetAccessControlEffect
s {$sel:userId:GetAccessControlEffect' :: Text
userId = Text
a} :: GetAccessControlEffect)

instance Core.AWSRequest GetAccessControlEffect where
  type
    AWSResponse GetAccessControlEffect =
      GetAccessControlEffectResponse
  request :: GetAccessControlEffect -> Request GetAccessControlEffect
request = Service -> GetAccessControlEffect -> Request GetAccessControlEffect
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAccessControlEffect
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAccessControlEffect)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAccessControlEffect))
-> Logger
-> Service
-> Proxy GetAccessControlEffect
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAccessControlEffect)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe AccessControlRuleEffect
-> Maybe [Text] -> Int -> GetAccessControlEffectResponse
GetAccessControlEffectResponse'
            (Maybe AccessControlRuleEffect
 -> Maybe [Text] -> Int -> GetAccessControlEffectResponse)
-> Either String (Maybe AccessControlRuleEffect)
-> Either
     String (Maybe [Text] -> Int -> GetAccessControlEffectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AccessControlRuleEffect)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Effect")
            Either
  String (Maybe [Text] -> Int -> GetAccessControlEffectResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> GetAccessControlEffectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MatchedRules" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetAccessControlEffectResponse)
-> Either String Int
-> Either String GetAccessControlEffectResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetAccessControlEffect

instance Prelude.NFData GetAccessControlEffect

instance Core.ToHeaders GetAccessControlEffect where
  toHeaders :: GetAccessControlEffect -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAccessControlEffect -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"WorkMailService.GetAccessControlEffect" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetAccessControlEffect where
  toJSON :: GetAccessControlEffect -> Value
toJSON GetAccessControlEffect' {Text
userId :: Text
action :: Text
ipAddress :: Text
organizationId :: Text
$sel:userId:GetAccessControlEffect' :: GetAccessControlEffect -> Text
$sel:action:GetAccessControlEffect' :: GetAccessControlEffect -> Text
$sel:ipAddress:GetAccessControlEffect' :: GetAccessControlEffect -> Text
$sel:organizationId:GetAccessControlEffect' :: GetAccessControlEffect -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OrganizationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
organizationId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IpAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ipAddress),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Action" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
action),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userId)
          ]
      )

instance Core.ToPath GetAccessControlEffect where
  toPath :: GetAccessControlEffect -> ByteString
toPath = ByteString -> GetAccessControlEffect -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery GetAccessControlEffect where
  toQuery :: GetAccessControlEffect -> QueryString
toQuery = QueryString -> GetAccessControlEffect -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetAccessControlEffectResponse' smart constructor.
data GetAccessControlEffectResponse = GetAccessControlEffectResponse'
  { -- | The rule effect.
    GetAccessControlEffectResponse -> Maybe AccessControlRuleEffect
effect :: Prelude.Maybe AccessControlRuleEffect,
    -- | The rules that match the given parameters, resulting in an effect.
    GetAccessControlEffectResponse -> Maybe [Text]
matchedRules :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    GetAccessControlEffectResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAccessControlEffectResponse
-> GetAccessControlEffectResponse -> Bool
(GetAccessControlEffectResponse
 -> GetAccessControlEffectResponse -> Bool)
-> (GetAccessControlEffectResponse
    -> GetAccessControlEffectResponse -> Bool)
-> Eq GetAccessControlEffectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccessControlEffectResponse
-> GetAccessControlEffectResponse -> Bool
$c/= :: GetAccessControlEffectResponse
-> GetAccessControlEffectResponse -> Bool
== :: GetAccessControlEffectResponse
-> GetAccessControlEffectResponse -> Bool
$c== :: GetAccessControlEffectResponse
-> GetAccessControlEffectResponse -> Bool
Prelude.Eq, ReadPrec [GetAccessControlEffectResponse]
ReadPrec GetAccessControlEffectResponse
Int -> ReadS GetAccessControlEffectResponse
ReadS [GetAccessControlEffectResponse]
(Int -> ReadS GetAccessControlEffectResponse)
-> ReadS [GetAccessControlEffectResponse]
-> ReadPrec GetAccessControlEffectResponse
-> ReadPrec [GetAccessControlEffectResponse]
-> Read GetAccessControlEffectResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccessControlEffectResponse]
$creadListPrec :: ReadPrec [GetAccessControlEffectResponse]
readPrec :: ReadPrec GetAccessControlEffectResponse
$creadPrec :: ReadPrec GetAccessControlEffectResponse
readList :: ReadS [GetAccessControlEffectResponse]
$creadList :: ReadS [GetAccessControlEffectResponse]
readsPrec :: Int -> ReadS GetAccessControlEffectResponse
$creadsPrec :: Int -> ReadS GetAccessControlEffectResponse
Prelude.Read, Int -> GetAccessControlEffectResponse -> ShowS
[GetAccessControlEffectResponse] -> ShowS
GetAccessControlEffectResponse -> String
(Int -> GetAccessControlEffectResponse -> ShowS)
-> (GetAccessControlEffectResponse -> String)
-> ([GetAccessControlEffectResponse] -> ShowS)
-> Show GetAccessControlEffectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccessControlEffectResponse] -> ShowS
$cshowList :: [GetAccessControlEffectResponse] -> ShowS
show :: GetAccessControlEffectResponse -> String
$cshow :: GetAccessControlEffectResponse -> String
showsPrec :: Int -> GetAccessControlEffectResponse -> ShowS
$cshowsPrec :: Int -> GetAccessControlEffectResponse -> ShowS
Prelude.Show, (forall x.
 GetAccessControlEffectResponse
 -> Rep GetAccessControlEffectResponse x)
-> (forall x.
    Rep GetAccessControlEffectResponse x
    -> GetAccessControlEffectResponse)
-> Generic GetAccessControlEffectResponse
forall x.
Rep GetAccessControlEffectResponse x
-> GetAccessControlEffectResponse
forall x.
GetAccessControlEffectResponse
-> Rep GetAccessControlEffectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAccessControlEffectResponse x
-> GetAccessControlEffectResponse
$cfrom :: forall x.
GetAccessControlEffectResponse
-> Rep GetAccessControlEffectResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAccessControlEffectResponse' 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', 'getAccessControlEffectResponse_effect' - The rule effect.
--
-- 'matchedRules', 'getAccessControlEffectResponse_matchedRules' - The rules that match the given parameters, resulting in an effect.
--
-- 'httpStatus', 'getAccessControlEffectResponse_httpStatus' - The response's http status code.
newGetAccessControlEffectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAccessControlEffectResponse
newGetAccessControlEffectResponse :: Int -> GetAccessControlEffectResponse
newGetAccessControlEffectResponse Int
pHttpStatus_ =
  GetAccessControlEffectResponse' :: Maybe AccessControlRuleEffect
-> Maybe [Text] -> Int -> GetAccessControlEffectResponse
GetAccessControlEffectResponse'
    { $sel:effect:GetAccessControlEffectResponse' :: Maybe AccessControlRuleEffect
effect =
        Maybe AccessControlRuleEffect
forall a. Maybe a
Prelude.Nothing,
      $sel:matchedRules:GetAccessControlEffectResponse' :: Maybe [Text]
matchedRules = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAccessControlEffectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The rules that match the given parameters, resulting in an effect.
getAccessControlEffectResponse_matchedRules :: Lens.Lens' GetAccessControlEffectResponse (Prelude.Maybe [Prelude.Text])
getAccessControlEffectResponse_matchedRules :: (Maybe [Text] -> f (Maybe [Text]))
-> GetAccessControlEffectResponse
-> f GetAccessControlEffectResponse
getAccessControlEffectResponse_matchedRules = (GetAccessControlEffectResponse -> Maybe [Text])
-> (GetAccessControlEffectResponse
    -> Maybe [Text] -> GetAccessControlEffectResponse)
-> Lens
     GetAccessControlEffectResponse
     GetAccessControlEffectResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessControlEffectResponse' {Maybe [Text]
matchedRules :: Maybe [Text]
$sel:matchedRules:GetAccessControlEffectResponse' :: GetAccessControlEffectResponse -> Maybe [Text]
matchedRules} -> Maybe [Text]
matchedRules) (\s :: GetAccessControlEffectResponse
s@GetAccessControlEffectResponse' {} Maybe [Text]
a -> GetAccessControlEffectResponse
s {$sel:matchedRules:GetAccessControlEffectResponse' :: Maybe [Text]
matchedRules = Maybe [Text]
a} :: GetAccessControlEffectResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetAccessControlEffectResponse
 -> f GetAccessControlEffectResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetAccessControlEffectResponse
-> f GetAccessControlEffectResponse
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 response's http status code.
getAccessControlEffectResponse_httpStatus :: Lens.Lens' GetAccessControlEffectResponse Prelude.Int
getAccessControlEffectResponse_httpStatus :: (Int -> f Int)
-> GetAccessControlEffectResponse
-> f GetAccessControlEffectResponse
getAccessControlEffectResponse_httpStatus = (GetAccessControlEffectResponse -> Int)
-> (GetAccessControlEffectResponse
    -> Int -> GetAccessControlEffectResponse)
-> Lens
     GetAccessControlEffectResponse
     GetAccessControlEffectResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccessControlEffectResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAccessControlEffectResponse' :: GetAccessControlEffectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAccessControlEffectResponse
s@GetAccessControlEffectResponse' {} Int
a -> GetAccessControlEffectResponse
s {$sel:httpStatus:GetAccessControlEffectResponse' :: Int
httpStatus = Int
a} :: GetAccessControlEffectResponse)

instance
  Prelude.NFData
    GetAccessControlEffectResponse