{-# 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.GetMobileDeviceAccessEffect
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Simulates the effect of the mobile device access rules for the given
-- attributes of a sample access event. Use this method to test the effects
-- of the current set of mobile device access rules for the WorkMail
-- organization for a particular user\'s attributes.
module Amazonka.WorkMail.GetMobileDeviceAccessEffect
  ( -- * Creating a Request
    GetMobileDeviceAccessEffect (..),
    newGetMobileDeviceAccessEffect,

    -- * Request Lenses
    getMobileDeviceAccessEffect_deviceModel,
    getMobileDeviceAccessEffect_deviceOperatingSystem,
    getMobileDeviceAccessEffect_deviceType,
    getMobileDeviceAccessEffect_deviceUserAgent,
    getMobileDeviceAccessEffect_organizationId,

    -- * Destructuring the Response
    GetMobileDeviceAccessEffectResponse (..),
    newGetMobileDeviceAccessEffectResponse,

    -- * Response Lenses
    getMobileDeviceAccessEffectResponse_effect,
    getMobileDeviceAccessEffectResponse_matchedRules,
    getMobileDeviceAccessEffectResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetMobileDeviceAccessEffect' smart constructor.
data GetMobileDeviceAccessEffect = GetMobileDeviceAccessEffect'
  { -- | Device model the simulated user will report.
    GetMobileDeviceAccessEffect -> Maybe Text
deviceModel :: Prelude.Maybe Prelude.Text,
    -- | Device operating system the simulated user will report.
    GetMobileDeviceAccessEffect -> Maybe Text
deviceOperatingSystem :: Prelude.Maybe Prelude.Text,
    -- | Device type the simulated user will report.
    GetMobileDeviceAccessEffect -> Maybe Text
deviceType :: Prelude.Maybe Prelude.Text,
    -- | Device user agent the simulated user will report.
    GetMobileDeviceAccessEffect -> Maybe Text
deviceUserAgent :: Prelude.Maybe Prelude.Text,
    -- | The WorkMail organization to simulate the access effect for.
    GetMobileDeviceAccessEffect -> Text
organizationId :: Prelude.Text
  }
  deriving (GetMobileDeviceAccessEffect -> GetMobileDeviceAccessEffect -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMobileDeviceAccessEffect -> GetMobileDeviceAccessEffect -> Bool
$c/= :: GetMobileDeviceAccessEffect -> GetMobileDeviceAccessEffect -> Bool
== :: GetMobileDeviceAccessEffect -> GetMobileDeviceAccessEffect -> Bool
$c== :: GetMobileDeviceAccessEffect -> GetMobileDeviceAccessEffect -> Bool
Prelude.Eq, ReadPrec [GetMobileDeviceAccessEffect]
ReadPrec GetMobileDeviceAccessEffect
Int -> ReadS GetMobileDeviceAccessEffect
ReadS [GetMobileDeviceAccessEffect]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMobileDeviceAccessEffect]
$creadListPrec :: ReadPrec [GetMobileDeviceAccessEffect]
readPrec :: ReadPrec GetMobileDeviceAccessEffect
$creadPrec :: ReadPrec GetMobileDeviceAccessEffect
readList :: ReadS [GetMobileDeviceAccessEffect]
$creadList :: ReadS [GetMobileDeviceAccessEffect]
readsPrec :: Int -> ReadS GetMobileDeviceAccessEffect
$creadsPrec :: Int -> ReadS GetMobileDeviceAccessEffect
Prelude.Read, Int -> GetMobileDeviceAccessEffect -> ShowS
[GetMobileDeviceAccessEffect] -> ShowS
GetMobileDeviceAccessEffect -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMobileDeviceAccessEffect] -> ShowS
$cshowList :: [GetMobileDeviceAccessEffect] -> ShowS
show :: GetMobileDeviceAccessEffect -> String
$cshow :: GetMobileDeviceAccessEffect -> String
showsPrec :: Int -> GetMobileDeviceAccessEffect -> ShowS
$cshowsPrec :: Int -> GetMobileDeviceAccessEffect -> ShowS
Prelude.Show, forall x.
Rep GetMobileDeviceAccessEffect x -> GetMobileDeviceAccessEffect
forall x.
GetMobileDeviceAccessEffect -> Rep GetMobileDeviceAccessEffect x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMobileDeviceAccessEffect x -> GetMobileDeviceAccessEffect
$cfrom :: forall x.
GetMobileDeviceAccessEffect -> Rep GetMobileDeviceAccessEffect x
Prelude.Generic)

-- |
-- Create a value of 'GetMobileDeviceAccessEffect' 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:
--
-- 'deviceModel', 'getMobileDeviceAccessEffect_deviceModel' - Device model the simulated user will report.
--
-- 'deviceOperatingSystem', 'getMobileDeviceAccessEffect_deviceOperatingSystem' - Device operating system the simulated user will report.
--
-- 'deviceType', 'getMobileDeviceAccessEffect_deviceType' - Device type the simulated user will report.
--
-- 'deviceUserAgent', 'getMobileDeviceAccessEffect_deviceUserAgent' - Device user agent the simulated user will report.
--
-- 'organizationId', 'getMobileDeviceAccessEffect_organizationId' - The WorkMail organization to simulate the access effect for.
newGetMobileDeviceAccessEffect ::
  -- | 'organizationId'
  Prelude.Text ->
  GetMobileDeviceAccessEffect
newGetMobileDeviceAccessEffect :: Text -> GetMobileDeviceAccessEffect
newGetMobileDeviceAccessEffect Text
pOrganizationId_ =
  GetMobileDeviceAccessEffect'
    { $sel:deviceModel:GetMobileDeviceAccessEffect' :: Maybe Text
deviceModel =
        forall a. Maybe a
Prelude.Nothing,
      $sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: Maybe Text
deviceOperatingSystem = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceType:GetMobileDeviceAccessEffect' :: Maybe Text
deviceType = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: Maybe Text
deviceUserAgent = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationId:GetMobileDeviceAccessEffect' :: Text
organizationId = Text
pOrganizationId_
    }

-- | Device model the simulated user will report.
getMobileDeviceAccessEffect_deviceModel :: Lens.Lens' GetMobileDeviceAccessEffect (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessEffect_deviceModel :: Lens' GetMobileDeviceAccessEffect (Maybe Text)
getMobileDeviceAccessEffect_deviceModel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffect' {Maybe Text
deviceModel :: Maybe Text
$sel:deviceModel:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
deviceModel} -> Maybe Text
deviceModel) (\s :: GetMobileDeviceAccessEffect
s@GetMobileDeviceAccessEffect' {} Maybe Text
a -> GetMobileDeviceAccessEffect
s {$sel:deviceModel:GetMobileDeviceAccessEffect' :: Maybe Text
deviceModel = Maybe Text
a} :: GetMobileDeviceAccessEffect)

-- | Device operating system the simulated user will report.
getMobileDeviceAccessEffect_deviceOperatingSystem :: Lens.Lens' GetMobileDeviceAccessEffect (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessEffect_deviceOperatingSystem :: Lens' GetMobileDeviceAccessEffect (Maybe Text)
getMobileDeviceAccessEffect_deviceOperatingSystem = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffect' {Maybe Text
deviceOperatingSystem :: Maybe Text
$sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
deviceOperatingSystem} -> Maybe Text
deviceOperatingSystem) (\s :: GetMobileDeviceAccessEffect
s@GetMobileDeviceAccessEffect' {} Maybe Text
a -> GetMobileDeviceAccessEffect
s {$sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: Maybe Text
deviceOperatingSystem = Maybe Text
a} :: GetMobileDeviceAccessEffect)

-- | Device type the simulated user will report.
getMobileDeviceAccessEffect_deviceType :: Lens.Lens' GetMobileDeviceAccessEffect (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessEffect_deviceType :: Lens' GetMobileDeviceAccessEffect (Maybe Text)
getMobileDeviceAccessEffect_deviceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffect' {Maybe Text
deviceType :: Maybe Text
$sel:deviceType:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
deviceType} -> Maybe Text
deviceType) (\s :: GetMobileDeviceAccessEffect
s@GetMobileDeviceAccessEffect' {} Maybe Text
a -> GetMobileDeviceAccessEffect
s {$sel:deviceType:GetMobileDeviceAccessEffect' :: Maybe Text
deviceType = Maybe Text
a} :: GetMobileDeviceAccessEffect)

-- | Device user agent the simulated user will report.
getMobileDeviceAccessEffect_deviceUserAgent :: Lens.Lens' GetMobileDeviceAccessEffect (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessEffect_deviceUserAgent :: Lens' GetMobileDeviceAccessEffect (Maybe Text)
getMobileDeviceAccessEffect_deviceUserAgent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffect' {Maybe Text
deviceUserAgent :: Maybe Text
$sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
deviceUserAgent} -> Maybe Text
deviceUserAgent) (\s :: GetMobileDeviceAccessEffect
s@GetMobileDeviceAccessEffect' {} Maybe Text
a -> GetMobileDeviceAccessEffect
s {$sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: Maybe Text
deviceUserAgent = Maybe Text
a} :: GetMobileDeviceAccessEffect)

-- | The WorkMail organization to simulate the access effect for.
getMobileDeviceAccessEffect_organizationId :: Lens.Lens' GetMobileDeviceAccessEffect Prelude.Text
getMobileDeviceAccessEffect_organizationId :: Lens' GetMobileDeviceAccessEffect Text
getMobileDeviceAccessEffect_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffect' {Text
organizationId :: Text
$sel:organizationId:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Text
organizationId} -> Text
organizationId) (\s :: GetMobileDeviceAccessEffect
s@GetMobileDeviceAccessEffect' {} Text
a -> GetMobileDeviceAccessEffect
s {$sel:organizationId:GetMobileDeviceAccessEffect' :: Text
organizationId = Text
a} :: GetMobileDeviceAccessEffect)

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

instance Prelude.Hashable GetMobileDeviceAccessEffect where
  hashWithSalt :: Int -> GetMobileDeviceAccessEffect -> Int
hashWithSalt Int
_salt GetMobileDeviceAccessEffect' {Maybe Text
Text
organizationId :: Text
deviceUserAgent :: Maybe Text
deviceType :: Maybe Text
deviceOperatingSystem :: Maybe Text
deviceModel :: Maybe Text
$sel:organizationId:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Text
$sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceType:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceModel:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceModel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceOperatingSystem
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceUserAgent
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId

instance Prelude.NFData GetMobileDeviceAccessEffect where
  rnf :: GetMobileDeviceAccessEffect -> ()
rnf GetMobileDeviceAccessEffect' {Maybe Text
Text
organizationId :: Text
deviceUserAgent :: Maybe Text
deviceType :: Maybe Text
deviceOperatingSystem :: Maybe Text
deviceModel :: Maybe Text
$sel:organizationId:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Text
$sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceType:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceModel:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceModel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceOperatingSystem
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceUserAgent
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId

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

instance Data.ToJSON GetMobileDeviceAccessEffect where
  toJSON :: GetMobileDeviceAccessEffect -> Value
toJSON GetMobileDeviceAccessEffect' {Maybe Text
Text
organizationId :: Text
deviceUserAgent :: Maybe Text
deviceType :: Maybe Text
deviceOperatingSystem :: Maybe Text
deviceModel :: Maybe Text
$sel:organizationId:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Text
$sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceType:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceModel:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DeviceModel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceModel,
            (Key
"DeviceOperatingSystem" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceOperatingSystem,
            (Key
"DeviceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceType,
            (Key
"DeviceUserAgent" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceUserAgent,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId)
          ]
      )

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

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

-- | /See:/ 'newGetMobileDeviceAccessEffectResponse' smart constructor.
data GetMobileDeviceAccessEffectResponse = GetMobileDeviceAccessEffectResponse'
  { -- | The effect of the simulated access, @ALLOW@ or @DENY@, after evaluating
    -- mobile device access rules in the WorkMail organization for the
    -- simulated user parameters.
    GetMobileDeviceAccessEffectResponse
-> Maybe MobileDeviceAccessRuleEffect
effect :: Prelude.Maybe MobileDeviceAccessRuleEffect,
    -- | A list of the rules which matched the simulated user input and produced
    -- the effect.
    GetMobileDeviceAccessEffectResponse
-> Maybe [MobileDeviceAccessMatchedRule]
matchedRules :: Prelude.Maybe [MobileDeviceAccessMatchedRule],
    -- | The response's http status code.
    GetMobileDeviceAccessEffectResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMobileDeviceAccessEffectResponse
-> GetMobileDeviceAccessEffectResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMobileDeviceAccessEffectResponse
-> GetMobileDeviceAccessEffectResponse -> Bool
$c/= :: GetMobileDeviceAccessEffectResponse
-> GetMobileDeviceAccessEffectResponse -> Bool
== :: GetMobileDeviceAccessEffectResponse
-> GetMobileDeviceAccessEffectResponse -> Bool
$c== :: GetMobileDeviceAccessEffectResponse
-> GetMobileDeviceAccessEffectResponse -> Bool
Prelude.Eq, ReadPrec [GetMobileDeviceAccessEffectResponse]
ReadPrec GetMobileDeviceAccessEffectResponse
Int -> ReadS GetMobileDeviceAccessEffectResponse
ReadS [GetMobileDeviceAccessEffectResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMobileDeviceAccessEffectResponse]
$creadListPrec :: ReadPrec [GetMobileDeviceAccessEffectResponse]
readPrec :: ReadPrec GetMobileDeviceAccessEffectResponse
$creadPrec :: ReadPrec GetMobileDeviceAccessEffectResponse
readList :: ReadS [GetMobileDeviceAccessEffectResponse]
$creadList :: ReadS [GetMobileDeviceAccessEffectResponse]
readsPrec :: Int -> ReadS GetMobileDeviceAccessEffectResponse
$creadsPrec :: Int -> ReadS GetMobileDeviceAccessEffectResponse
Prelude.Read, Int -> GetMobileDeviceAccessEffectResponse -> ShowS
[GetMobileDeviceAccessEffectResponse] -> ShowS
GetMobileDeviceAccessEffectResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMobileDeviceAccessEffectResponse] -> ShowS
$cshowList :: [GetMobileDeviceAccessEffectResponse] -> ShowS
show :: GetMobileDeviceAccessEffectResponse -> String
$cshow :: GetMobileDeviceAccessEffectResponse -> String
showsPrec :: Int -> GetMobileDeviceAccessEffectResponse -> ShowS
$cshowsPrec :: Int -> GetMobileDeviceAccessEffectResponse -> ShowS
Prelude.Show, forall x.
Rep GetMobileDeviceAccessEffectResponse x
-> GetMobileDeviceAccessEffectResponse
forall x.
GetMobileDeviceAccessEffectResponse
-> Rep GetMobileDeviceAccessEffectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMobileDeviceAccessEffectResponse x
-> GetMobileDeviceAccessEffectResponse
$cfrom :: forall x.
GetMobileDeviceAccessEffectResponse
-> Rep GetMobileDeviceAccessEffectResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMobileDeviceAccessEffectResponse' 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', 'getMobileDeviceAccessEffectResponse_effect' - The effect of the simulated access, @ALLOW@ or @DENY@, after evaluating
-- mobile device access rules in the WorkMail organization for the
-- simulated user parameters.
--
-- 'matchedRules', 'getMobileDeviceAccessEffectResponse_matchedRules' - A list of the rules which matched the simulated user input and produced
-- the effect.
--
-- 'httpStatus', 'getMobileDeviceAccessEffectResponse_httpStatus' - The response's http status code.
newGetMobileDeviceAccessEffectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMobileDeviceAccessEffectResponse
newGetMobileDeviceAccessEffectResponse :: Int -> GetMobileDeviceAccessEffectResponse
newGetMobileDeviceAccessEffectResponse Int
pHttpStatus_ =
  GetMobileDeviceAccessEffectResponse'
    { $sel:effect:GetMobileDeviceAccessEffectResponse' :: Maybe MobileDeviceAccessRuleEffect
effect =
        forall a. Maybe a
Prelude.Nothing,
      $sel:matchedRules:GetMobileDeviceAccessEffectResponse' :: Maybe [MobileDeviceAccessMatchedRule]
matchedRules = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMobileDeviceAccessEffectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The effect of the simulated access, @ALLOW@ or @DENY@, after evaluating
-- mobile device access rules in the WorkMail organization for the
-- simulated user parameters.
getMobileDeviceAccessEffectResponse_effect :: Lens.Lens' GetMobileDeviceAccessEffectResponse (Prelude.Maybe MobileDeviceAccessRuleEffect)
getMobileDeviceAccessEffectResponse_effect :: Lens'
  GetMobileDeviceAccessEffectResponse
  (Maybe MobileDeviceAccessRuleEffect)
getMobileDeviceAccessEffectResponse_effect = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffectResponse' {Maybe MobileDeviceAccessRuleEffect
effect :: Maybe MobileDeviceAccessRuleEffect
$sel:effect:GetMobileDeviceAccessEffectResponse' :: GetMobileDeviceAccessEffectResponse
-> Maybe MobileDeviceAccessRuleEffect
effect} -> Maybe MobileDeviceAccessRuleEffect
effect) (\s :: GetMobileDeviceAccessEffectResponse
s@GetMobileDeviceAccessEffectResponse' {} Maybe MobileDeviceAccessRuleEffect
a -> GetMobileDeviceAccessEffectResponse
s {$sel:effect:GetMobileDeviceAccessEffectResponse' :: Maybe MobileDeviceAccessRuleEffect
effect = Maybe MobileDeviceAccessRuleEffect
a} :: GetMobileDeviceAccessEffectResponse)

-- | A list of the rules which matched the simulated user input and produced
-- the effect.
getMobileDeviceAccessEffectResponse_matchedRules :: Lens.Lens' GetMobileDeviceAccessEffectResponse (Prelude.Maybe [MobileDeviceAccessMatchedRule])
getMobileDeviceAccessEffectResponse_matchedRules :: Lens'
  GetMobileDeviceAccessEffectResponse
  (Maybe [MobileDeviceAccessMatchedRule])
getMobileDeviceAccessEffectResponse_matchedRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffectResponse' {Maybe [MobileDeviceAccessMatchedRule]
matchedRules :: Maybe [MobileDeviceAccessMatchedRule]
$sel:matchedRules:GetMobileDeviceAccessEffectResponse' :: GetMobileDeviceAccessEffectResponse
-> Maybe [MobileDeviceAccessMatchedRule]
matchedRules} -> Maybe [MobileDeviceAccessMatchedRule]
matchedRules) (\s :: GetMobileDeviceAccessEffectResponse
s@GetMobileDeviceAccessEffectResponse' {} Maybe [MobileDeviceAccessMatchedRule]
a -> GetMobileDeviceAccessEffectResponse
s {$sel:matchedRules:GetMobileDeviceAccessEffectResponse' :: Maybe [MobileDeviceAccessMatchedRule]
matchedRules = Maybe [MobileDeviceAccessMatchedRule]
a} :: GetMobileDeviceAccessEffectResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
getMobileDeviceAccessEffectResponse_httpStatus :: Lens.Lens' GetMobileDeviceAccessEffectResponse Prelude.Int
getMobileDeviceAccessEffectResponse_httpStatus :: Lens' GetMobileDeviceAccessEffectResponse Int
getMobileDeviceAccessEffectResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessEffectResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetMobileDeviceAccessEffectResponse' :: GetMobileDeviceAccessEffectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetMobileDeviceAccessEffectResponse
s@GetMobileDeviceAccessEffectResponse' {} Int
a -> GetMobileDeviceAccessEffectResponse
s {$sel:httpStatus:GetMobileDeviceAccessEffectResponse' :: Int
httpStatus = Int
a} :: GetMobileDeviceAccessEffectResponse)

instance
  Prelude.NFData
    GetMobileDeviceAccessEffectResponse
  where
  rnf :: GetMobileDeviceAccessEffectResponse -> ()
rnf GetMobileDeviceAccessEffectResponse' {Int
Maybe [MobileDeviceAccessMatchedRule]
Maybe MobileDeviceAccessRuleEffect
httpStatus :: Int
matchedRules :: Maybe [MobileDeviceAccessMatchedRule]
effect :: Maybe MobileDeviceAccessRuleEffect
$sel:httpStatus:GetMobileDeviceAccessEffectResponse' :: GetMobileDeviceAccessEffectResponse -> Int
$sel:matchedRules:GetMobileDeviceAccessEffectResponse' :: GetMobileDeviceAccessEffectResponse
-> Maybe [MobileDeviceAccessMatchedRule]
$sel:effect:GetMobileDeviceAccessEffectResponse' :: GetMobileDeviceAccessEffectResponse
-> Maybe MobileDeviceAccessRuleEffect
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MobileDeviceAccessRuleEffect
effect
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [MobileDeviceAccessMatchedRule]
matchedRules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus