{-# 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.GetMobileDeviceAccessOverride
-- 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 mobile device access override for the given WorkMail
-- organization, user, and device.
module Amazonka.WorkMail.GetMobileDeviceAccessOverride
  ( -- * Creating a Request
    GetMobileDeviceAccessOverride (..),
    newGetMobileDeviceAccessOverride,

    -- * Request Lenses
    getMobileDeviceAccessOverride_organizationId,
    getMobileDeviceAccessOverride_userId,
    getMobileDeviceAccessOverride_deviceId,

    -- * Destructuring the Response
    GetMobileDeviceAccessOverrideResponse (..),
    newGetMobileDeviceAccessOverrideResponse,

    -- * Response Lenses
    getMobileDeviceAccessOverrideResponse_effect,
    getMobileDeviceAccessOverrideResponse_userId,
    getMobileDeviceAccessOverrideResponse_dateCreated,
    getMobileDeviceAccessOverrideResponse_dateModified,
    getMobileDeviceAccessOverrideResponse_deviceId,
    getMobileDeviceAccessOverrideResponse_description,
    getMobileDeviceAccessOverrideResponse_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:/ 'newGetMobileDeviceAccessOverride' smart constructor.
data GetMobileDeviceAccessOverride = GetMobileDeviceAccessOverride'
  { -- | The Amazon WorkMail organization to which you want to apply the
    -- override.
    GetMobileDeviceAccessOverride -> Text
organizationId :: Prelude.Text,
    -- | Identifies the WorkMail user for the override. Accepts the following
    -- types of user identities:
    --
    -- -   User ID: @12345678-1234-1234-1234-123456789012@ or
    --     @S-1-1-12-1234567890-123456789-123456789-1234@
    --
    -- -   Email address: @user\@domain.tld@
    --
    -- -   User name: @user@
    GetMobileDeviceAccessOverride -> Text
userId :: Prelude.Text,
    -- | The mobile device to which the override applies. @DeviceId@ is case
    -- insensitive.
    GetMobileDeviceAccessOverride -> Text
deviceId :: Prelude.Text
  }
  deriving (GetMobileDeviceAccessOverride
-> GetMobileDeviceAccessOverride -> Bool
(GetMobileDeviceAccessOverride
 -> GetMobileDeviceAccessOverride -> Bool)
-> (GetMobileDeviceAccessOverride
    -> GetMobileDeviceAccessOverride -> Bool)
-> Eq GetMobileDeviceAccessOverride
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMobileDeviceAccessOverride
-> GetMobileDeviceAccessOverride -> Bool
$c/= :: GetMobileDeviceAccessOverride
-> GetMobileDeviceAccessOverride -> Bool
== :: GetMobileDeviceAccessOverride
-> GetMobileDeviceAccessOverride -> Bool
$c== :: GetMobileDeviceAccessOverride
-> GetMobileDeviceAccessOverride -> Bool
Prelude.Eq, ReadPrec [GetMobileDeviceAccessOverride]
ReadPrec GetMobileDeviceAccessOverride
Int -> ReadS GetMobileDeviceAccessOverride
ReadS [GetMobileDeviceAccessOverride]
(Int -> ReadS GetMobileDeviceAccessOverride)
-> ReadS [GetMobileDeviceAccessOverride]
-> ReadPrec GetMobileDeviceAccessOverride
-> ReadPrec [GetMobileDeviceAccessOverride]
-> Read GetMobileDeviceAccessOverride
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMobileDeviceAccessOverride]
$creadListPrec :: ReadPrec [GetMobileDeviceAccessOverride]
readPrec :: ReadPrec GetMobileDeviceAccessOverride
$creadPrec :: ReadPrec GetMobileDeviceAccessOverride
readList :: ReadS [GetMobileDeviceAccessOverride]
$creadList :: ReadS [GetMobileDeviceAccessOverride]
readsPrec :: Int -> ReadS GetMobileDeviceAccessOverride
$creadsPrec :: Int -> ReadS GetMobileDeviceAccessOverride
Prelude.Read, Int -> GetMobileDeviceAccessOverride -> ShowS
[GetMobileDeviceAccessOverride] -> ShowS
GetMobileDeviceAccessOverride -> String
(Int -> GetMobileDeviceAccessOverride -> ShowS)
-> (GetMobileDeviceAccessOverride -> String)
-> ([GetMobileDeviceAccessOverride] -> ShowS)
-> Show GetMobileDeviceAccessOverride
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMobileDeviceAccessOverride] -> ShowS
$cshowList :: [GetMobileDeviceAccessOverride] -> ShowS
show :: GetMobileDeviceAccessOverride -> String
$cshow :: GetMobileDeviceAccessOverride -> String
showsPrec :: Int -> GetMobileDeviceAccessOverride -> ShowS
$cshowsPrec :: Int -> GetMobileDeviceAccessOverride -> ShowS
Prelude.Show, (forall x.
 GetMobileDeviceAccessOverride
 -> Rep GetMobileDeviceAccessOverride x)
-> (forall x.
    Rep GetMobileDeviceAccessOverride x
    -> GetMobileDeviceAccessOverride)
-> Generic GetMobileDeviceAccessOverride
forall x.
Rep GetMobileDeviceAccessOverride x
-> GetMobileDeviceAccessOverride
forall x.
GetMobileDeviceAccessOverride
-> Rep GetMobileDeviceAccessOverride x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMobileDeviceAccessOverride x
-> GetMobileDeviceAccessOverride
$cfrom :: forall x.
GetMobileDeviceAccessOverride
-> Rep GetMobileDeviceAccessOverride x
Prelude.Generic)

-- |
-- Create a value of 'GetMobileDeviceAccessOverride' 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', 'getMobileDeviceAccessOverride_organizationId' - The Amazon WorkMail organization to which you want to apply the
-- override.
--
-- 'userId', 'getMobileDeviceAccessOverride_userId' - Identifies the WorkMail user for the override. Accepts the following
-- types of user identities:
--
-- -   User ID: @12345678-1234-1234-1234-123456789012@ or
--     @S-1-1-12-1234567890-123456789-123456789-1234@
--
-- -   Email address: @user\@domain.tld@
--
-- -   User name: @user@
--
-- 'deviceId', 'getMobileDeviceAccessOverride_deviceId' - The mobile device to which the override applies. @DeviceId@ is case
-- insensitive.
newGetMobileDeviceAccessOverride ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'userId'
  Prelude.Text ->
  -- | 'deviceId'
  Prelude.Text ->
  GetMobileDeviceAccessOverride
newGetMobileDeviceAccessOverride :: Text -> Text -> Text -> GetMobileDeviceAccessOverride
newGetMobileDeviceAccessOverride
  Text
pOrganizationId_
  Text
pUserId_
  Text
pDeviceId_ =
    GetMobileDeviceAccessOverride' :: Text -> Text -> Text -> GetMobileDeviceAccessOverride
GetMobileDeviceAccessOverride'
      { $sel:organizationId:GetMobileDeviceAccessOverride' :: Text
organizationId =
          Text
pOrganizationId_,
        $sel:userId:GetMobileDeviceAccessOverride' :: Text
userId = Text
pUserId_,
        $sel:deviceId:GetMobileDeviceAccessOverride' :: Text
deviceId = Text
pDeviceId_
      }

-- | The Amazon WorkMail organization to which you want to apply the
-- override.
getMobileDeviceAccessOverride_organizationId :: Lens.Lens' GetMobileDeviceAccessOverride Prelude.Text
getMobileDeviceAccessOverride_organizationId :: (Text -> f Text)
-> GetMobileDeviceAccessOverride -> f GetMobileDeviceAccessOverride
getMobileDeviceAccessOverride_organizationId = (GetMobileDeviceAccessOverride -> Text)
-> (GetMobileDeviceAccessOverride
    -> Text -> GetMobileDeviceAccessOverride)
-> Lens
     GetMobileDeviceAccessOverride
     GetMobileDeviceAccessOverride
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverride' {Text
organizationId :: Text
$sel:organizationId:GetMobileDeviceAccessOverride' :: GetMobileDeviceAccessOverride -> Text
organizationId} -> Text
organizationId) (\s :: GetMobileDeviceAccessOverride
s@GetMobileDeviceAccessOverride' {} Text
a -> GetMobileDeviceAccessOverride
s {$sel:organizationId:GetMobileDeviceAccessOverride' :: Text
organizationId = Text
a} :: GetMobileDeviceAccessOverride)

-- | Identifies the WorkMail user for the override. Accepts the following
-- types of user identities:
--
-- -   User ID: @12345678-1234-1234-1234-123456789012@ or
--     @S-1-1-12-1234567890-123456789-123456789-1234@
--
-- -   Email address: @user\@domain.tld@
--
-- -   User name: @user@
getMobileDeviceAccessOverride_userId :: Lens.Lens' GetMobileDeviceAccessOverride Prelude.Text
getMobileDeviceAccessOverride_userId :: (Text -> f Text)
-> GetMobileDeviceAccessOverride -> f GetMobileDeviceAccessOverride
getMobileDeviceAccessOverride_userId = (GetMobileDeviceAccessOverride -> Text)
-> (GetMobileDeviceAccessOverride
    -> Text -> GetMobileDeviceAccessOverride)
-> Lens
     GetMobileDeviceAccessOverride
     GetMobileDeviceAccessOverride
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverride' {Text
userId :: Text
$sel:userId:GetMobileDeviceAccessOverride' :: GetMobileDeviceAccessOverride -> Text
userId} -> Text
userId) (\s :: GetMobileDeviceAccessOverride
s@GetMobileDeviceAccessOverride' {} Text
a -> GetMobileDeviceAccessOverride
s {$sel:userId:GetMobileDeviceAccessOverride' :: Text
userId = Text
a} :: GetMobileDeviceAccessOverride)

-- | The mobile device to which the override applies. @DeviceId@ is case
-- insensitive.
getMobileDeviceAccessOverride_deviceId :: Lens.Lens' GetMobileDeviceAccessOverride Prelude.Text
getMobileDeviceAccessOverride_deviceId :: (Text -> f Text)
-> GetMobileDeviceAccessOverride -> f GetMobileDeviceAccessOverride
getMobileDeviceAccessOverride_deviceId = (GetMobileDeviceAccessOverride -> Text)
-> (GetMobileDeviceAccessOverride
    -> Text -> GetMobileDeviceAccessOverride)
-> Lens
     GetMobileDeviceAccessOverride
     GetMobileDeviceAccessOverride
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverride' {Text
deviceId :: Text
$sel:deviceId:GetMobileDeviceAccessOverride' :: GetMobileDeviceAccessOverride -> Text
deviceId} -> Text
deviceId) (\s :: GetMobileDeviceAccessOverride
s@GetMobileDeviceAccessOverride' {} Text
a -> GetMobileDeviceAccessOverride
s {$sel:deviceId:GetMobileDeviceAccessOverride' :: Text
deviceId = Text
a} :: GetMobileDeviceAccessOverride)

instance
  Core.AWSRequest
    GetMobileDeviceAccessOverride
  where
  type
    AWSResponse GetMobileDeviceAccessOverride =
      GetMobileDeviceAccessOverrideResponse
  request :: GetMobileDeviceAccessOverride
-> Request GetMobileDeviceAccessOverride
request = Service
-> GetMobileDeviceAccessOverride
-> Request GetMobileDeviceAccessOverride
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMobileDeviceAccessOverride
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMobileDeviceAccessOverride)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMobileDeviceAccessOverride))
-> Logger
-> Service
-> Proxy GetMobileDeviceAccessOverride
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMobileDeviceAccessOverride)))
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 Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> GetMobileDeviceAccessOverrideResponse
GetMobileDeviceAccessOverrideResponse'
            (Maybe MobileDeviceAccessRuleEffect
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetMobileDeviceAccessOverrideResponse)
-> Either String (Maybe MobileDeviceAccessRuleEffect)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMobileDeviceAccessOverrideResponse)
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 Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMobileDeviceAccessOverrideResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMobileDeviceAccessOverrideResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserId")
            Either
  String
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMobileDeviceAccessOverrideResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetMobileDeviceAccessOverrideResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DateCreated")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetMobileDeviceAccessOverrideResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> GetMobileDeviceAccessOverrideResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DateModified")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> GetMobileDeviceAccessOverrideResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> GetMobileDeviceAccessOverrideResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeviceId")
            Either
  String (Maybe Text -> Int -> GetMobileDeviceAccessOverrideResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetMobileDeviceAccessOverrideResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either String (Int -> GetMobileDeviceAccessOverrideResponse)
-> Either String Int
-> Either String GetMobileDeviceAccessOverrideResponse
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
    GetMobileDeviceAccessOverride

instance Prelude.NFData GetMobileDeviceAccessOverride

instance Core.ToHeaders GetMobileDeviceAccessOverride where
  toHeaders :: GetMobileDeviceAccessOverride -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetMobileDeviceAccessOverride -> 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.GetMobileDeviceAccessOverride" ::
                          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 GetMobileDeviceAccessOverride where
  toJSON :: GetMobileDeviceAccessOverride -> Value
toJSON GetMobileDeviceAccessOverride' {Text
deviceId :: Text
userId :: Text
organizationId :: Text
$sel:deviceId:GetMobileDeviceAccessOverride' :: GetMobileDeviceAccessOverride -> Text
$sel:userId:GetMobileDeviceAccessOverride' :: GetMobileDeviceAccessOverride -> Text
$sel:organizationId:GetMobileDeviceAccessOverride' :: GetMobileDeviceAccessOverride -> 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
"UserId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceId)
          ]
      )

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

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

-- | /See:/ 'newGetMobileDeviceAccessOverrideResponse' smart constructor.
data GetMobileDeviceAccessOverrideResponse = GetMobileDeviceAccessOverrideResponse'
  { -- | The effect of the override, @ALLOW@ or @DENY@.
    GetMobileDeviceAccessOverrideResponse
-> Maybe MobileDeviceAccessRuleEffect
effect :: Prelude.Maybe MobileDeviceAccessRuleEffect,
    -- | The WorkMail user to which the access override applies.
    GetMobileDeviceAccessOverrideResponse -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
    -- | The date the override was first created.
    GetMobileDeviceAccessOverrideResponse -> Maybe POSIX
dateCreated :: Prelude.Maybe Core.POSIX,
    -- | The date the description was last modified.
    GetMobileDeviceAccessOverrideResponse -> Maybe POSIX
dateModified :: Prelude.Maybe Core.POSIX,
    -- | The device to which the access override applies.
    GetMobileDeviceAccessOverrideResponse -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text,
    -- | A description of the override.
    GetMobileDeviceAccessOverrideResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetMobileDeviceAccessOverrideResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMobileDeviceAccessOverrideResponse
-> GetMobileDeviceAccessOverrideResponse -> Bool
(GetMobileDeviceAccessOverrideResponse
 -> GetMobileDeviceAccessOverrideResponse -> Bool)
-> (GetMobileDeviceAccessOverrideResponse
    -> GetMobileDeviceAccessOverrideResponse -> Bool)
-> Eq GetMobileDeviceAccessOverrideResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMobileDeviceAccessOverrideResponse
-> GetMobileDeviceAccessOverrideResponse -> Bool
$c/= :: GetMobileDeviceAccessOverrideResponse
-> GetMobileDeviceAccessOverrideResponse -> Bool
== :: GetMobileDeviceAccessOverrideResponse
-> GetMobileDeviceAccessOverrideResponse -> Bool
$c== :: GetMobileDeviceAccessOverrideResponse
-> GetMobileDeviceAccessOverrideResponse -> Bool
Prelude.Eq, ReadPrec [GetMobileDeviceAccessOverrideResponse]
ReadPrec GetMobileDeviceAccessOverrideResponse
Int -> ReadS GetMobileDeviceAccessOverrideResponse
ReadS [GetMobileDeviceAccessOverrideResponse]
(Int -> ReadS GetMobileDeviceAccessOverrideResponse)
-> ReadS [GetMobileDeviceAccessOverrideResponse]
-> ReadPrec GetMobileDeviceAccessOverrideResponse
-> ReadPrec [GetMobileDeviceAccessOverrideResponse]
-> Read GetMobileDeviceAccessOverrideResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMobileDeviceAccessOverrideResponse]
$creadListPrec :: ReadPrec [GetMobileDeviceAccessOverrideResponse]
readPrec :: ReadPrec GetMobileDeviceAccessOverrideResponse
$creadPrec :: ReadPrec GetMobileDeviceAccessOverrideResponse
readList :: ReadS [GetMobileDeviceAccessOverrideResponse]
$creadList :: ReadS [GetMobileDeviceAccessOverrideResponse]
readsPrec :: Int -> ReadS GetMobileDeviceAccessOverrideResponse
$creadsPrec :: Int -> ReadS GetMobileDeviceAccessOverrideResponse
Prelude.Read, Int -> GetMobileDeviceAccessOverrideResponse -> ShowS
[GetMobileDeviceAccessOverrideResponse] -> ShowS
GetMobileDeviceAccessOverrideResponse -> String
(Int -> GetMobileDeviceAccessOverrideResponse -> ShowS)
-> (GetMobileDeviceAccessOverrideResponse -> String)
-> ([GetMobileDeviceAccessOverrideResponse] -> ShowS)
-> Show GetMobileDeviceAccessOverrideResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMobileDeviceAccessOverrideResponse] -> ShowS
$cshowList :: [GetMobileDeviceAccessOverrideResponse] -> ShowS
show :: GetMobileDeviceAccessOverrideResponse -> String
$cshow :: GetMobileDeviceAccessOverrideResponse -> String
showsPrec :: Int -> GetMobileDeviceAccessOverrideResponse -> ShowS
$cshowsPrec :: Int -> GetMobileDeviceAccessOverrideResponse -> ShowS
Prelude.Show, (forall x.
 GetMobileDeviceAccessOverrideResponse
 -> Rep GetMobileDeviceAccessOverrideResponse x)
-> (forall x.
    Rep GetMobileDeviceAccessOverrideResponse x
    -> GetMobileDeviceAccessOverrideResponse)
-> Generic GetMobileDeviceAccessOverrideResponse
forall x.
Rep GetMobileDeviceAccessOverrideResponse x
-> GetMobileDeviceAccessOverrideResponse
forall x.
GetMobileDeviceAccessOverrideResponse
-> Rep GetMobileDeviceAccessOverrideResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMobileDeviceAccessOverrideResponse x
-> GetMobileDeviceAccessOverrideResponse
$cfrom :: forall x.
GetMobileDeviceAccessOverrideResponse
-> Rep GetMobileDeviceAccessOverrideResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMobileDeviceAccessOverrideResponse' 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', 'getMobileDeviceAccessOverrideResponse_effect' - The effect of the override, @ALLOW@ or @DENY@.
--
-- 'userId', 'getMobileDeviceAccessOverrideResponse_userId' - The WorkMail user to which the access override applies.
--
-- 'dateCreated', 'getMobileDeviceAccessOverrideResponse_dateCreated' - The date the override was first created.
--
-- 'dateModified', 'getMobileDeviceAccessOverrideResponse_dateModified' - The date the description was last modified.
--
-- 'deviceId', 'getMobileDeviceAccessOverrideResponse_deviceId' - The device to which the access override applies.
--
-- 'description', 'getMobileDeviceAccessOverrideResponse_description' - A description of the override.
--
-- 'httpStatus', 'getMobileDeviceAccessOverrideResponse_httpStatus' - The response's http status code.
newGetMobileDeviceAccessOverrideResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMobileDeviceAccessOverrideResponse
newGetMobileDeviceAccessOverrideResponse :: Int -> GetMobileDeviceAccessOverrideResponse
newGetMobileDeviceAccessOverrideResponse Int
pHttpStatus_ =
  GetMobileDeviceAccessOverrideResponse' :: Maybe MobileDeviceAccessRuleEffect
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> GetMobileDeviceAccessOverrideResponse
GetMobileDeviceAccessOverrideResponse'
    { $sel:effect:GetMobileDeviceAccessOverrideResponse' :: Maybe MobileDeviceAccessRuleEffect
effect =
        Maybe MobileDeviceAccessRuleEffect
forall a. Maybe a
Prelude.Nothing,
      $sel:userId:GetMobileDeviceAccessOverrideResponse' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dateCreated:GetMobileDeviceAccessOverrideResponse' :: Maybe POSIX
dateCreated = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:dateModified:GetMobileDeviceAccessOverrideResponse' :: Maybe POSIX
dateModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceId:GetMobileDeviceAccessOverrideResponse' :: Maybe Text
deviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:GetMobileDeviceAccessOverrideResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMobileDeviceAccessOverrideResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The effect of the override, @ALLOW@ or @DENY@.
getMobileDeviceAccessOverrideResponse_effect :: Lens.Lens' GetMobileDeviceAccessOverrideResponse (Prelude.Maybe MobileDeviceAccessRuleEffect)
getMobileDeviceAccessOverrideResponse_effect :: (Maybe MobileDeviceAccessRuleEffect
 -> f (Maybe MobileDeviceAccessRuleEffect))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
getMobileDeviceAccessOverrideResponse_effect = (GetMobileDeviceAccessOverrideResponse
 -> Maybe MobileDeviceAccessRuleEffect)
-> (GetMobileDeviceAccessOverrideResponse
    -> Maybe MobileDeviceAccessRuleEffect
    -> GetMobileDeviceAccessOverrideResponse)
-> Lens
     GetMobileDeviceAccessOverrideResponse
     GetMobileDeviceAccessOverrideResponse
     (Maybe MobileDeviceAccessRuleEffect)
     (Maybe MobileDeviceAccessRuleEffect)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverrideResponse' {Maybe MobileDeviceAccessRuleEffect
effect :: Maybe MobileDeviceAccessRuleEffect
$sel:effect:GetMobileDeviceAccessOverrideResponse' :: GetMobileDeviceAccessOverrideResponse
-> Maybe MobileDeviceAccessRuleEffect
effect} -> Maybe MobileDeviceAccessRuleEffect
effect) (\s :: GetMobileDeviceAccessOverrideResponse
s@GetMobileDeviceAccessOverrideResponse' {} Maybe MobileDeviceAccessRuleEffect
a -> GetMobileDeviceAccessOverrideResponse
s {$sel:effect:GetMobileDeviceAccessOverrideResponse' :: Maybe MobileDeviceAccessRuleEffect
effect = Maybe MobileDeviceAccessRuleEffect
a} :: GetMobileDeviceAccessOverrideResponse)

-- | The WorkMail user to which the access override applies.
getMobileDeviceAccessOverrideResponse_userId :: Lens.Lens' GetMobileDeviceAccessOverrideResponse (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessOverrideResponse_userId :: (Maybe Text -> f (Maybe Text))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
getMobileDeviceAccessOverrideResponse_userId = (GetMobileDeviceAccessOverrideResponse -> Maybe Text)
-> (GetMobileDeviceAccessOverrideResponse
    -> Maybe Text -> GetMobileDeviceAccessOverrideResponse)
-> Lens
     GetMobileDeviceAccessOverrideResponse
     GetMobileDeviceAccessOverrideResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverrideResponse' {Maybe Text
userId :: Maybe Text
$sel:userId:GetMobileDeviceAccessOverrideResponse' :: GetMobileDeviceAccessOverrideResponse -> Maybe Text
userId} -> Maybe Text
userId) (\s :: GetMobileDeviceAccessOverrideResponse
s@GetMobileDeviceAccessOverrideResponse' {} Maybe Text
a -> GetMobileDeviceAccessOverrideResponse
s {$sel:userId:GetMobileDeviceAccessOverrideResponse' :: Maybe Text
userId = Maybe Text
a} :: GetMobileDeviceAccessOverrideResponse)

-- | The date the override was first created.
getMobileDeviceAccessOverrideResponse_dateCreated :: Lens.Lens' GetMobileDeviceAccessOverrideResponse (Prelude.Maybe Prelude.UTCTime)
getMobileDeviceAccessOverrideResponse_dateCreated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
getMobileDeviceAccessOverrideResponse_dateCreated = (GetMobileDeviceAccessOverrideResponse -> Maybe POSIX)
-> (GetMobileDeviceAccessOverrideResponse
    -> Maybe POSIX -> GetMobileDeviceAccessOverrideResponse)
-> Lens
     GetMobileDeviceAccessOverrideResponse
     GetMobileDeviceAccessOverrideResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverrideResponse' {Maybe POSIX
dateCreated :: Maybe POSIX
$sel:dateCreated:GetMobileDeviceAccessOverrideResponse' :: GetMobileDeviceAccessOverrideResponse -> Maybe POSIX
dateCreated} -> Maybe POSIX
dateCreated) (\s :: GetMobileDeviceAccessOverrideResponse
s@GetMobileDeviceAccessOverrideResponse' {} Maybe POSIX
a -> GetMobileDeviceAccessOverrideResponse
s {$sel:dateCreated:GetMobileDeviceAccessOverrideResponse' :: Maybe POSIX
dateCreated = Maybe POSIX
a} :: GetMobileDeviceAccessOverrideResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetMobileDeviceAccessOverrideResponse
 -> f GetMobileDeviceAccessOverrideResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
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 date the description was last modified.
getMobileDeviceAccessOverrideResponse_dateModified :: Lens.Lens' GetMobileDeviceAccessOverrideResponse (Prelude.Maybe Prelude.UTCTime)
getMobileDeviceAccessOverrideResponse_dateModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
getMobileDeviceAccessOverrideResponse_dateModified = (GetMobileDeviceAccessOverrideResponse -> Maybe POSIX)
-> (GetMobileDeviceAccessOverrideResponse
    -> Maybe POSIX -> GetMobileDeviceAccessOverrideResponse)
-> Lens
     GetMobileDeviceAccessOverrideResponse
     GetMobileDeviceAccessOverrideResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverrideResponse' {Maybe POSIX
dateModified :: Maybe POSIX
$sel:dateModified:GetMobileDeviceAccessOverrideResponse' :: GetMobileDeviceAccessOverrideResponse -> Maybe POSIX
dateModified} -> Maybe POSIX
dateModified) (\s :: GetMobileDeviceAccessOverrideResponse
s@GetMobileDeviceAccessOverrideResponse' {} Maybe POSIX
a -> GetMobileDeviceAccessOverrideResponse
s {$sel:dateModified:GetMobileDeviceAccessOverrideResponse' :: Maybe POSIX
dateModified = Maybe POSIX
a} :: GetMobileDeviceAccessOverrideResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetMobileDeviceAccessOverrideResponse
 -> f GetMobileDeviceAccessOverrideResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
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 device to which the access override applies.
getMobileDeviceAccessOverrideResponse_deviceId :: Lens.Lens' GetMobileDeviceAccessOverrideResponse (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessOverrideResponse_deviceId :: (Maybe Text -> f (Maybe Text))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
getMobileDeviceAccessOverrideResponse_deviceId = (GetMobileDeviceAccessOverrideResponse -> Maybe Text)
-> (GetMobileDeviceAccessOverrideResponse
    -> Maybe Text -> GetMobileDeviceAccessOverrideResponse)
-> Lens
     GetMobileDeviceAccessOverrideResponse
     GetMobileDeviceAccessOverrideResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverrideResponse' {Maybe Text
deviceId :: Maybe Text
$sel:deviceId:GetMobileDeviceAccessOverrideResponse' :: GetMobileDeviceAccessOverrideResponse -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: GetMobileDeviceAccessOverrideResponse
s@GetMobileDeviceAccessOverrideResponse' {} Maybe Text
a -> GetMobileDeviceAccessOverrideResponse
s {$sel:deviceId:GetMobileDeviceAccessOverrideResponse' :: Maybe Text
deviceId = Maybe Text
a} :: GetMobileDeviceAccessOverrideResponse)

-- | A description of the override.
getMobileDeviceAccessOverrideResponse_description :: Lens.Lens' GetMobileDeviceAccessOverrideResponse (Prelude.Maybe Prelude.Text)
getMobileDeviceAccessOverrideResponse_description :: (Maybe Text -> f (Maybe Text))
-> GetMobileDeviceAccessOverrideResponse
-> f GetMobileDeviceAccessOverrideResponse
getMobileDeviceAccessOverrideResponse_description = (GetMobileDeviceAccessOverrideResponse -> Maybe Text)
-> (GetMobileDeviceAccessOverrideResponse
    -> Maybe Text -> GetMobileDeviceAccessOverrideResponse)
-> Lens
     GetMobileDeviceAccessOverrideResponse
     GetMobileDeviceAccessOverrideResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMobileDeviceAccessOverrideResponse' {Maybe Text
description :: Maybe Text
$sel:description:GetMobileDeviceAccessOverrideResponse' :: GetMobileDeviceAccessOverrideResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: GetMobileDeviceAccessOverrideResponse
s@GetMobileDeviceAccessOverrideResponse' {} Maybe Text
a -> GetMobileDeviceAccessOverrideResponse
s {$sel:description:GetMobileDeviceAccessOverrideResponse' :: Maybe Text
description = Maybe Text
a} :: GetMobileDeviceAccessOverrideResponse)

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

instance
  Prelude.NFData
    GetMobileDeviceAccessOverrideResponse