{-# 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-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)
--
-- 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 Amazon WorkMail
-- organization for a particular user\'s attributes.
module Amazonka.WorkMail.GetMobileDeviceAccessEffect
  ( -- * Creating a Request
    GetMobileDeviceAccessEffect (..),
    newGetMobileDeviceAccessEffect,

    -- * Request Lenses
    getMobileDeviceAccessEffect_deviceOperatingSystem,
    getMobileDeviceAccessEffect_deviceModel,
    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.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:/ 'newGetMobileDeviceAccessEffect' smart constructor.
data GetMobileDeviceAccessEffect = GetMobileDeviceAccessEffect'
  { -- | Device operating system the simulated user will report.
    GetMobileDeviceAccessEffect -> Maybe Text
deviceOperatingSystem :: Prelude.Maybe Prelude.Text,
    -- | Device model the simulated user will report.
    GetMobileDeviceAccessEffect -> Maybe Text
deviceModel :: 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 Amazon WorkMail organization to simulate the access effect for.
    GetMobileDeviceAccessEffect -> Text
organizationId :: Prelude.Text
  }
  deriving (GetMobileDeviceAccessEffect -> GetMobileDeviceAccessEffect -> Bool
(GetMobileDeviceAccessEffect
 -> GetMobileDeviceAccessEffect -> Bool)
-> (GetMobileDeviceAccessEffect
    -> GetMobileDeviceAccessEffect -> Bool)
-> Eq GetMobileDeviceAccessEffect
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]
(Int -> ReadS GetMobileDeviceAccessEffect)
-> ReadS [GetMobileDeviceAccessEffect]
-> ReadPrec GetMobileDeviceAccessEffect
-> ReadPrec [GetMobileDeviceAccessEffect]
-> Read 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
(Int -> GetMobileDeviceAccessEffect -> ShowS)
-> (GetMobileDeviceAccessEffect -> String)
-> ([GetMobileDeviceAccessEffect] -> ShowS)
-> Show GetMobileDeviceAccessEffect
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.
 GetMobileDeviceAccessEffect -> Rep GetMobileDeviceAccessEffect x)
-> (forall x.
    Rep GetMobileDeviceAccessEffect x -> GetMobileDeviceAccessEffect)
-> Generic GetMobileDeviceAccessEffect
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:
--
-- 'deviceOperatingSystem', 'getMobileDeviceAccessEffect_deviceOperatingSystem' - Device operating system the simulated user will report.
--
-- 'deviceModel', 'getMobileDeviceAccessEffect_deviceModel' - Device model 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 Amazon WorkMail organization to simulate the access effect for.
newGetMobileDeviceAccessEffect ::
  -- | 'organizationId'
  Prelude.Text ->
  GetMobileDeviceAccessEffect
newGetMobileDeviceAccessEffect :: Text -> GetMobileDeviceAccessEffect
newGetMobileDeviceAccessEffect Text
pOrganizationId_ =
  GetMobileDeviceAccessEffect' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> GetMobileDeviceAccessEffect
GetMobileDeviceAccessEffect'
    { $sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: Maybe Text
deviceOperatingSystem =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceModel:GetMobileDeviceAccessEffect' :: Maybe Text
deviceModel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceType:GetMobileDeviceAccessEffect' :: Maybe Text
deviceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: Maybe Text
deviceUserAgent = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationId:GetMobileDeviceAccessEffect' :: Text
organizationId = Text
pOrganizationId_
    }

-- | Device operating system the simulated user will report.
getMobileDeviceAccessEffect_deviceOperatingSystem :: Lens.Lens' GetMobileDeviceAccessEffect (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessEffect_deviceOperatingSystem :: (Maybe Text -> f (Maybe Text))
-> GetMobileDeviceAccessEffect -> f GetMobileDeviceAccessEffect
getMobileDeviceAccessEffect_deviceOperatingSystem = (GetMobileDeviceAccessEffect -> Maybe Text)
-> (GetMobileDeviceAccessEffect
    -> Maybe Text -> GetMobileDeviceAccessEffect)
-> Lens
     GetMobileDeviceAccessEffect
     GetMobileDeviceAccessEffect
     (Maybe Text)
     (Maybe Text)
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 model the simulated user will report.
getMobileDeviceAccessEffect_deviceModel :: Lens.Lens' GetMobileDeviceAccessEffect (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessEffect_deviceModel :: (Maybe Text -> f (Maybe Text))
-> GetMobileDeviceAccessEffect -> f GetMobileDeviceAccessEffect
getMobileDeviceAccessEffect_deviceModel = (GetMobileDeviceAccessEffect -> Maybe Text)
-> (GetMobileDeviceAccessEffect
    -> Maybe Text -> GetMobileDeviceAccessEffect)
-> Lens
     GetMobileDeviceAccessEffect
     GetMobileDeviceAccessEffect
     (Maybe Text)
     (Maybe Text)
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 type the simulated user will report.
getMobileDeviceAccessEffect_deviceType :: Lens.Lens' GetMobileDeviceAccessEffect (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessEffect_deviceType :: (Maybe Text -> f (Maybe Text))
-> GetMobileDeviceAccessEffect -> f GetMobileDeviceAccessEffect
getMobileDeviceAccessEffect_deviceType = (GetMobileDeviceAccessEffect -> Maybe Text)
-> (GetMobileDeviceAccessEffect
    -> Maybe Text -> GetMobileDeviceAccessEffect)
-> Lens
     GetMobileDeviceAccessEffect
     GetMobileDeviceAccessEffect
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> GetMobileDeviceAccessEffect -> f GetMobileDeviceAccessEffect
getMobileDeviceAccessEffect_deviceUserAgent = (GetMobileDeviceAccessEffect -> Maybe Text)
-> (GetMobileDeviceAccessEffect
    -> Maybe Text -> GetMobileDeviceAccessEffect)
-> Lens
     GetMobileDeviceAccessEffect
     GetMobileDeviceAccessEffect
     (Maybe Text)
     (Maybe Text)
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 Amazon WorkMail organization to simulate the access effect for.
getMobileDeviceAccessEffect_organizationId :: Lens.Lens' GetMobileDeviceAccessEffect Prelude.Text
getMobileDeviceAccessEffect_organizationId :: (Text -> f Text)
-> GetMobileDeviceAccessEffect -> f GetMobileDeviceAccessEffect
getMobileDeviceAccessEffect_organizationId = (GetMobileDeviceAccessEffect -> Text)
-> (GetMobileDeviceAccessEffect
    -> Text -> GetMobileDeviceAccessEffect)
-> Lens
     GetMobileDeviceAccessEffect GetMobileDeviceAccessEffect Text Text
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 :: GetMobileDeviceAccessEffect -> Request GetMobileDeviceAccessEffect
request = Service
-> GetMobileDeviceAccessEffect
-> Request GetMobileDeviceAccessEffect
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMobileDeviceAccessEffect
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMobileDeviceAccessEffect)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMobileDeviceAccessEffect))
-> Logger
-> Service
-> Proxy GetMobileDeviceAccessEffect
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMobileDeviceAccessEffect)))
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 MobileDeviceAccessRuleEffect
-> Maybe [MobileDeviceAccessMatchedRule]
-> Int
-> GetMobileDeviceAccessEffectResponse
GetMobileDeviceAccessEffectResponse'
            (Maybe MobileDeviceAccessRuleEffect
 -> Maybe [MobileDeviceAccessMatchedRule]
 -> Int
 -> GetMobileDeviceAccessEffectResponse)
-> Either String (Maybe MobileDeviceAccessRuleEffect)
-> Either
     String
     (Maybe [MobileDeviceAccessMatchedRule]
      -> Int -> GetMobileDeviceAccessEffectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe MobileDeviceAccessRuleEffect)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Effect")
            Either
  String
  (Maybe [MobileDeviceAccessMatchedRule]
   -> Int -> GetMobileDeviceAccessEffectResponse)
-> Either String (Maybe [MobileDeviceAccessMatchedRule])
-> Either String (Int -> GetMobileDeviceAccessEffectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe [MobileDeviceAccessMatchedRule]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MatchedRules" Either String (Maybe (Maybe [MobileDeviceAccessMatchedRule]))
-> Maybe [MobileDeviceAccessMatchedRule]
-> Either String (Maybe [MobileDeviceAccessMatchedRule])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MobileDeviceAccessMatchedRule]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetMobileDeviceAccessEffectResponse)
-> Either String Int
-> Either String GetMobileDeviceAccessEffectResponse
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 GetMobileDeviceAccessEffect

instance Prelude.NFData GetMobileDeviceAccessEffect

instance Core.ToHeaders GetMobileDeviceAccessEffect where
  toHeaders :: GetMobileDeviceAccessEffect -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetMobileDeviceAccessEffect -> 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.GetMobileDeviceAccessEffect" ::
                          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 GetMobileDeviceAccessEffect where
  toJSON :: GetMobileDeviceAccessEffect -> Value
toJSON GetMobileDeviceAccessEffect' {Maybe Text
Text
organizationId :: Text
deviceUserAgent :: Maybe Text
deviceType :: Maybe Text
deviceModel :: Maybe Text
deviceOperatingSystem :: Maybe Text
$sel:organizationId:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Text
$sel:deviceUserAgent:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceType:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceModel:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
$sel:deviceOperatingSystem:GetMobileDeviceAccessEffect' :: GetMobileDeviceAccessEffect -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DeviceOperatingSystem" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceOperatingSystem,
            (Text
"DeviceModel" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceModel,
            (Text
"DeviceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceType,
            (Text
"DeviceUserAgent" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceUserAgent,
            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)
          ]
      )

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

instance Core.ToQuery GetMobileDeviceAccessEffect where
  toQuery :: GetMobileDeviceAccessEffect -> QueryString
toQuery = QueryString -> GetMobileDeviceAccessEffect -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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 Amazon 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
(GetMobileDeviceAccessEffectResponse
 -> GetMobileDeviceAccessEffectResponse -> Bool)
-> (GetMobileDeviceAccessEffectResponse
    -> GetMobileDeviceAccessEffectResponse -> Bool)
-> Eq GetMobileDeviceAccessEffectResponse
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]
(Int -> ReadS GetMobileDeviceAccessEffectResponse)
-> ReadS [GetMobileDeviceAccessEffectResponse]
-> ReadPrec GetMobileDeviceAccessEffectResponse
-> ReadPrec [GetMobileDeviceAccessEffectResponse]
-> Read 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
(Int -> GetMobileDeviceAccessEffectResponse -> ShowS)
-> (GetMobileDeviceAccessEffectResponse -> String)
-> ([GetMobileDeviceAccessEffectResponse] -> ShowS)
-> Show GetMobileDeviceAccessEffectResponse
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.
 GetMobileDeviceAccessEffectResponse
 -> Rep GetMobileDeviceAccessEffectResponse x)
-> (forall x.
    Rep GetMobileDeviceAccessEffectResponse x
    -> GetMobileDeviceAccessEffectResponse)
-> Generic GetMobileDeviceAccessEffectResponse
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 Amazon 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' :: Maybe MobileDeviceAccessRuleEffect
-> Maybe [MobileDeviceAccessMatchedRule]
-> Int
-> GetMobileDeviceAccessEffectResponse
GetMobileDeviceAccessEffectResponse'
    { $sel:effect:GetMobileDeviceAccessEffectResponse' :: Maybe MobileDeviceAccessRuleEffect
effect =
        Maybe MobileDeviceAccessRuleEffect
forall a. Maybe a
Prelude.Nothing,
      $sel:matchedRules:GetMobileDeviceAccessEffectResponse' :: Maybe [MobileDeviceAccessMatchedRule]
matchedRules = Maybe [MobileDeviceAccessMatchedRule]
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 Amazon WorkMail organization for the
-- simulated user parameters.
getMobileDeviceAccessEffectResponse_effect :: Lens.Lens' GetMobileDeviceAccessEffectResponse (Prelude.Maybe MobileDeviceAccessRuleEffect)
getMobileDeviceAccessEffectResponse_effect :: (Maybe MobileDeviceAccessRuleEffect
 -> f (Maybe MobileDeviceAccessRuleEffect))
-> GetMobileDeviceAccessEffectResponse
-> f GetMobileDeviceAccessEffectResponse
getMobileDeviceAccessEffectResponse_effect = (GetMobileDeviceAccessEffectResponse
 -> Maybe MobileDeviceAccessRuleEffect)
-> (GetMobileDeviceAccessEffectResponse
    -> Maybe MobileDeviceAccessRuleEffect
    -> GetMobileDeviceAccessEffectResponse)
-> Lens
     GetMobileDeviceAccessEffectResponse
     GetMobileDeviceAccessEffectResponse
     (Maybe MobileDeviceAccessRuleEffect)
     (Maybe MobileDeviceAccessRuleEffect)
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 :: (Maybe [MobileDeviceAccessMatchedRule]
 -> f (Maybe [MobileDeviceAccessMatchedRule]))
-> GetMobileDeviceAccessEffectResponse
-> f GetMobileDeviceAccessEffectResponse
getMobileDeviceAccessEffectResponse_matchedRules = (GetMobileDeviceAccessEffectResponse
 -> Maybe [MobileDeviceAccessMatchedRule])
-> (GetMobileDeviceAccessEffectResponse
    -> Maybe [MobileDeviceAccessMatchedRule]
    -> GetMobileDeviceAccessEffectResponse)
-> Lens
     GetMobileDeviceAccessEffectResponse
     GetMobileDeviceAccessEffectResponse
     (Maybe [MobileDeviceAccessMatchedRule])
     (Maybe [MobileDeviceAccessMatchedRule])
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) ((Maybe [MobileDeviceAccessMatchedRule]
  -> f (Maybe [MobileDeviceAccessMatchedRule]))
 -> GetMobileDeviceAccessEffectResponse
 -> f GetMobileDeviceAccessEffectResponse)
-> ((Maybe [MobileDeviceAccessMatchedRule]
     -> f (Maybe [MobileDeviceAccessMatchedRule]))
    -> Maybe [MobileDeviceAccessMatchedRule]
    -> f (Maybe [MobileDeviceAccessMatchedRule]))
-> (Maybe [MobileDeviceAccessMatchedRule]
    -> f (Maybe [MobileDeviceAccessMatchedRule]))
-> GetMobileDeviceAccessEffectResponse
-> f GetMobileDeviceAccessEffectResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MobileDeviceAccessMatchedRule]
  [MobileDeviceAccessMatchedRule]
  [MobileDeviceAccessMatchedRule]
  [MobileDeviceAccessMatchedRule]
-> Iso
     (Maybe [MobileDeviceAccessMatchedRule])
     (Maybe [MobileDeviceAccessMatchedRule])
     (Maybe [MobileDeviceAccessMatchedRule])
     (Maybe [MobileDeviceAccessMatchedRule])
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
  [MobileDeviceAccessMatchedRule]
  [MobileDeviceAccessMatchedRule]
  [MobileDeviceAccessMatchedRule]
  [MobileDeviceAccessMatchedRule]
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 :: (Int -> f Int)
-> GetMobileDeviceAccessEffectResponse
-> f GetMobileDeviceAccessEffectResponse
getMobileDeviceAccessEffectResponse_httpStatus = (GetMobileDeviceAccessEffectResponse -> Int)
-> (GetMobileDeviceAccessEffectResponse
    -> Int -> GetMobileDeviceAccessEffectResponse)
-> Lens
     GetMobileDeviceAccessEffectResponse
     GetMobileDeviceAccessEffectResponse
     Int
     Int
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