{-# 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.GetMailDomain
-- 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 details for a mail domain, including domain records required to
-- configure your domain with recommended security.
module Amazonka.WorkMail.GetMailDomain
  ( -- * Creating a Request
    GetMailDomain (..),
    newGetMailDomain,

    -- * Request Lenses
    getMailDomain_organizationId,
    getMailDomain_domainName,

    -- * Destructuring the Response
    GetMailDomainResponse (..),
    newGetMailDomainResponse,

    -- * Response Lenses
    getMailDomainResponse_isTestDomain,
    getMailDomainResponse_records,
    getMailDomainResponse_ownershipVerificationStatus,
    getMailDomainResponse_dkimVerificationStatus,
    getMailDomainResponse_isDefault,
    getMailDomainResponse_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:/ 'newGetMailDomain' smart constructor.
data GetMailDomain = GetMailDomain'
  { -- | The Amazon WorkMail organization for which the domain is retrieved.
    GetMailDomain -> Text
organizationId :: Prelude.Text,
    -- | The domain from which you want to retrieve details.
    GetMailDomain -> Text
domainName :: Prelude.Text
  }
  deriving (GetMailDomain -> GetMailDomain -> Bool
(GetMailDomain -> GetMailDomain -> Bool)
-> (GetMailDomain -> GetMailDomain -> Bool) -> Eq GetMailDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMailDomain -> GetMailDomain -> Bool
$c/= :: GetMailDomain -> GetMailDomain -> Bool
== :: GetMailDomain -> GetMailDomain -> Bool
$c== :: GetMailDomain -> GetMailDomain -> Bool
Prelude.Eq, ReadPrec [GetMailDomain]
ReadPrec GetMailDomain
Int -> ReadS GetMailDomain
ReadS [GetMailDomain]
(Int -> ReadS GetMailDomain)
-> ReadS [GetMailDomain]
-> ReadPrec GetMailDomain
-> ReadPrec [GetMailDomain]
-> Read GetMailDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMailDomain]
$creadListPrec :: ReadPrec [GetMailDomain]
readPrec :: ReadPrec GetMailDomain
$creadPrec :: ReadPrec GetMailDomain
readList :: ReadS [GetMailDomain]
$creadList :: ReadS [GetMailDomain]
readsPrec :: Int -> ReadS GetMailDomain
$creadsPrec :: Int -> ReadS GetMailDomain
Prelude.Read, Int -> GetMailDomain -> ShowS
[GetMailDomain] -> ShowS
GetMailDomain -> String
(Int -> GetMailDomain -> ShowS)
-> (GetMailDomain -> String)
-> ([GetMailDomain] -> ShowS)
-> Show GetMailDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMailDomain] -> ShowS
$cshowList :: [GetMailDomain] -> ShowS
show :: GetMailDomain -> String
$cshow :: GetMailDomain -> String
showsPrec :: Int -> GetMailDomain -> ShowS
$cshowsPrec :: Int -> GetMailDomain -> ShowS
Prelude.Show, (forall x. GetMailDomain -> Rep GetMailDomain x)
-> (forall x. Rep GetMailDomain x -> GetMailDomain)
-> Generic GetMailDomain
forall x. Rep GetMailDomain x -> GetMailDomain
forall x. GetMailDomain -> Rep GetMailDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMailDomain x -> GetMailDomain
$cfrom :: forall x. GetMailDomain -> Rep GetMailDomain x
Prelude.Generic)

-- |
-- Create a value of 'GetMailDomain' 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', 'getMailDomain_organizationId' - The Amazon WorkMail organization for which the domain is retrieved.
--
-- 'domainName', 'getMailDomain_domainName' - The domain from which you want to retrieve details.
newGetMailDomain ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'domainName'
  Prelude.Text ->
  GetMailDomain
newGetMailDomain :: Text -> Text -> GetMailDomain
newGetMailDomain Text
pOrganizationId_ Text
pDomainName_ =
  GetMailDomain' :: Text -> Text -> GetMailDomain
GetMailDomain'
    { $sel:organizationId:GetMailDomain' :: Text
organizationId = Text
pOrganizationId_,
      $sel:domainName:GetMailDomain' :: Text
domainName = Text
pDomainName_
    }

-- | The Amazon WorkMail organization for which the domain is retrieved.
getMailDomain_organizationId :: Lens.Lens' GetMailDomain Prelude.Text
getMailDomain_organizationId :: (Text -> f Text) -> GetMailDomain -> f GetMailDomain
getMailDomain_organizationId = (GetMailDomain -> Text)
-> (GetMailDomain -> Text -> GetMailDomain)
-> Lens GetMailDomain GetMailDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMailDomain' {Text
organizationId :: Text
$sel:organizationId:GetMailDomain' :: GetMailDomain -> Text
organizationId} -> Text
organizationId) (\s :: GetMailDomain
s@GetMailDomain' {} Text
a -> GetMailDomain
s {$sel:organizationId:GetMailDomain' :: Text
organizationId = Text
a} :: GetMailDomain)

-- | The domain from which you want to retrieve details.
getMailDomain_domainName :: Lens.Lens' GetMailDomain Prelude.Text
getMailDomain_domainName :: (Text -> f Text) -> GetMailDomain -> f GetMailDomain
getMailDomain_domainName = (GetMailDomain -> Text)
-> (GetMailDomain -> Text -> GetMailDomain)
-> Lens GetMailDomain GetMailDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMailDomain' {Text
domainName :: Text
$sel:domainName:GetMailDomain' :: GetMailDomain -> Text
domainName} -> Text
domainName) (\s :: GetMailDomain
s@GetMailDomain' {} Text
a -> GetMailDomain
s {$sel:domainName:GetMailDomain' :: Text
domainName = Text
a} :: GetMailDomain)

instance Core.AWSRequest GetMailDomain where
  type
    AWSResponse GetMailDomain =
      GetMailDomainResponse
  request :: GetMailDomain -> Request GetMailDomain
request = Service -> GetMailDomain -> Request GetMailDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMailDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMailDomain)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMailDomain))
-> Logger
-> Service
-> Proxy GetMailDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMailDomain)))
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 Bool
-> Maybe [DnsRecord]
-> Maybe DnsRecordVerificationStatus
-> Maybe DnsRecordVerificationStatus
-> Maybe Bool
-> Int
-> GetMailDomainResponse
GetMailDomainResponse'
            (Maybe Bool
 -> Maybe [DnsRecord]
 -> Maybe DnsRecordVerificationStatus
 -> Maybe DnsRecordVerificationStatus
 -> Maybe Bool
 -> Int
 -> GetMailDomainResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [DnsRecord]
      -> Maybe DnsRecordVerificationStatus
      -> Maybe DnsRecordVerificationStatus
      -> Maybe Bool
      -> Int
      -> GetMailDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IsTestDomain")
            Either
  String
  (Maybe [DnsRecord]
   -> Maybe DnsRecordVerificationStatus
   -> Maybe DnsRecordVerificationStatus
   -> Maybe Bool
   -> Int
   -> GetMailDomainResponse)
-> Either String (Maybe [DnsRecord])
-> Either
     String
     (Maybe DnsRecordVerificationStatus
      -> Maybe DnsRecordVerificationStatus
      -> Maybe Bool
      -> Int
      -> GetMailDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [DnsRecord]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Records" Either String (Maybe (Maybe [DnsRecord]))
-> Maybe [DnsRecord] -> Either String (Maybe [DnsRecord])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DnsRecord]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe DnsRecordVerificationStatus
   -> Maybe DnsRecordVerificationStatus
   -> Maybe Bool
   -> Int
   -> GetMailDomainResponse)
-> Either String (Maybe DnsRecordVerificationStatus)
-> Either
     String
     (Maybe DnsRecordVerificationStatus
      -> Maybe Bool -> Int -> GetMailDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DnsRecordVerificationStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"OwnershipVerificationStatus")
            Either
  String
  (Maybe DnsRecordVerificationStatus
   -> Maybe Bool -> Int -> GetMailDomainResponse)
-> Either String (Maybe DnsRecordVerificationStatus)
-> Either String (Maybe Bool -> Int -> GetMailDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DnsRecordVerificationStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DkimVerificationStatus")
            Either String (Maybe Bool -> Int -> GetMailDomainResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> GetMailDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IsDefault")
            Either String (Int -> GetMailDomainResponse)
-> Either String Int -> Either String GetMailDomainResponse
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 GetMailDomain

instance Prelude.NFData GetMailDomain

instance Core.ToHeaders GetMailDomain where
  toHeaders :: GetMailDomain -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetMailDomain -> 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.GetMailDomain" ::
                          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 GetMailDomain where
  toJSON :: GetMailDomain -> Value
toJSON GetMailDomain' {Text
domainName :: Text
organizationId :: Text
$sel:domainName:GetMailDomain' :: GetMailDomain -> Text
$sel:organizationId:GetMailDomain' :: GetMailDomain -> 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
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
          ]
      )

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

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

-- | /See:/ 'newGetMailDomainResponse' smart constructor.
data GetMailDomainResponse = GetMailDomainResponse'
  { -- | Specifies whether the domain is a test domain provided by WorkMail, or a
    -- custom domain.
    GetMailDomainResponse -> Maybe Bool
isTestDomain :: Prelude.Maybe Prelude.Bool,
    -- | A list of the DNS records that Amazon WorkMail recommends adding in your
    -- DNS provider for the best user experience. The records configure your
    -- domain with DMARC, SPF, DKIM, and direct incoming email traffic to SES.
    -- See admin guide for more details.
    GetMailDomainResponse -> Maybe [DnsRecord]
records :: Prelude.Maybe [DnsRecord],
    -- | Indicates the status of the domain ownership verification.
    GetMailDomainResponse -> Maybe DnsRecordVerificationStatus
ownershipVerificationStatus :: Prelude.Maybe DnsRecordVerificationStatus,
    -- | Indicates the status of a DKIM verification.
    GetMailDomainResponse -> Maybe DnsRecordVerificationStatus
dkimVerificationStatus :: Prelude.Maybe DnsRecordVerificationStatus,
    -- | Specifies whether the domain is the default domain for your
    -- organization.
    GetMailDomainResponse -> Maybe Bool
isDefault :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    GetMailDomainResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMailDomainResponse -> GetMailDomainResponse -> Bool
(GetMailDomainResponse -> GetMailDomainResponse -> Bool)
-> (GetMailDomainResponse -> GetMailDomainResponse -> Bool)
-> Eq GetMailDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMailDomainResponse -> GetMailDomainResponse -> Bool
$c/= :: GetMailDomainResponse -> GetMailDomainResponse -> Bool
== :: GetMailDomainResponse -> GetMailDomainResponse -> Bool
$c== :: GetMailDomainResponse -> GetMailDomainResponse -> Bool
Prelude.Eq, ReadPrec [GetMailDomainResponse]
ReadPrec GetMailDomainResponse
Int -> ReadS GetMailDomainResponse
ReadS [GetMailDomainResponse]
(Int -> ReadS GetMailDomainResponse)
-> ReadS [GetMailDomainResponse]
-> ReadPrec GetMailDomainResponse
-> ReadPrec [GetMailDomainResponse]
-> Read GetMailDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMailDomainResponse]
$creadListPrec :: ReadPrec [GetMailDomainResponse]
readPrec :: ReadPrec GetMailDomainResponse
$creadPrec :: ReadPrec GetMailDomainResponse
readList :: ReadS [GetMailDomainResponse]
$creadList :: ReadS [GetMailDomainResponse]
readsPrec :: Int -> ReadS GetMailDomainResponse
$creadsPrec :: Int -> ReadS GetMailDomainResponse
Prelude.Read, Int -> GetMailDomainResponse -> ShowS
[GetMailDomainResponse] -> ShowS
GetMailDomainResponse -> String
(Int -> GetMailDomainResponse -> ShowS)
-> (GetMailDomainResponse -> String)
-> ([GetMailDomainResponse] -> ShowS)
-> Show GetMailDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMailDomainResponse] -> ShowS
$cshowList :: [GetMailDomainResponse] -> ShowS
show :: GetMailDomainResponse -> String
$cshow :: GetMailDomainResponse -> String
showsPrec :: Int -> GetMailDomainResponse -> ShowS
$cshowsPrec :: Int -> GetMailDomainResponse -> ShowS
Prelude.Show, (forall x. GetMailDomainResponse -> Rep GetMailDomainResponse x)
-> (forall x. Rep GetMailDomainResponse x -> GetMailDomainResponse)
-> Generic GetMailDomainResponse
forall x. Rep GetMailDomainResponse x -> GetMailDomainResponse
forall x. GetMailDomainResponse -> Rep GetMailDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMailDomainResponse x -> GetMailDomainResponse
$cfrom :: forall x. GetMailDomainResponse -> Rep GetMailDomainResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMailDomainResponse' 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:
--
-- 'isTestDomain', 'getMailDomainResponse_isTestDomain' - Specifies whether the domain is a test domain provided by WorkMail, or a
-- custom domain.
--
-- 'records', 'getMailDomainResponse_records' - A list of the DNS records that Amazon WorkMail recommends adding in your
-- DNS provider for the best user experience. The records configure your
-- domain with DMARC, SPF, DKIM, and direct incoming email traffic to SES.
-- See admin guide for more details.
--
-- 'ownershipVerificationStatus', 'getMailDomainResponse_ownershipVerificationStatus' - Indicates the status of the domain ownership verification.
--
-- 'dkimVerificationStatus', 'getMailDomainResponse_dkimVerificationStatus' - Indicates the status of a DKIM verification.
--
-- 'isDefault', 'getMailDomainResponse_isDefault' - Specifies whether the domain is the default domain for your
-- organization.
--
-- 'httpStatus', 'getMailDomainResponse_httpStatus' - The response's http status code.
newGetMailDomainResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMailDomainResponse
newGetMailDomainResponse :: Int -> GetMailDomainResponse
newGetMailDomainResponse Int
pHttpStatus_ =
  GetMailDomainResponse' :: Maybe Bool
-> Maybe [DnsRecord]
-> Maybe DnsRecordVerificationStatus
-> Maybe DnsRecordVerificationStatus
-> Maybe Bool
-> Int
-> GetMailDomainResponse
GetMailDomainResponse'
    { $sel:isTestDomain:GetMailDomainResponse' :: Maybe Bool
isTestDomain =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:records:GetMailDomainResponse' :: Maybe [DnsRecord]
records = Maybe [DnsRecord]
forall a. Maybe a
Prelude.Nothing,
      $sel:ownershipVerificationStatus:GetMailDomainResponse' :: Maybe DnsRecordVerificationStatus
ownershipVerificationStatus = Maybe DnsRecordVerificationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:dkimVerificationStatus:GetMailDomainResponse' :: Maybe DnsRecordVerificationStatus
dkimVerificationStatus = Maybe DnsRecordVerificationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:isDefault:GetMailDomainResponse' :: Maybe Bool
isDefault = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMailDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Specifies whether the domain is a test domain provided by WorkMail, or a
-- custom domain.
getMailDomainResponse_isTestDomain :: Lens.Lens' GetMailDomainResponse (Prelude.Maybe Prelude.Bool)
getMailDomainResponse_isTestDomain :: (Maybe Bool -> f (Maybe Bool))
-> GetMailDomainResponse -> f GetMailDomainResponse
getMailDomainResponse_isTestDomain = (GetMailDomainResponse -> Maybe Bool)
-> (GetMailDomainResponse -> Maybe Bool -> GetMailDomainResponse)
-> Lens
     GetMailDomainResponse
     GetMailDomainResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMailDomainResponse' {Maybe Bool
isTestDomain :: Maybe Bool
$sel:isTestDomain:GetMailDomainResponse' :: GetMailDomainResponse -> Maybe Bool
isTestDomain} -> Maybe Bool
isTestDomain) (\s :: GetMailDomainResponse
s@GetMailDomainResponse' {} Maybe Bool
a -> GetMailDomainResponse
s {$sel:isTestDomain:GetMailDomainResponse' :: Maybe Bool
isTestDomain = Maybe Bool
a} :: GetMailDomainResponse)

-- | A list of the DNS records that Amazon WorkMail recommends adding in your
-- DNS provider for the best user experience. The records configure your
-- domain with DMARC, SPF, DKIM, and direct incoming email traffic to SES.
-- See admin guide for more details.
getMailDomainResponse_records :: Lens.Lens' GetMailDomainResponse (Prelude.Maybe [DnsRecord])
getMailDomainResponse_records :: (Maybe [DnsRecord] -> f (Maybe [DnsRecord]))
-> GetMailDomainResponse -> f GetMailDomainResponse
getMailDomainResponse_records = (GetMailDomainResponse -> Maybe [DnsRecord])
-> (GetMailDomainResponse
    -> Maybe [DnsRecord] -> GetMailDomainResponse)
-> Lens
     GetMailDomainResponse
     GetMailDomainResponse
     (Maybe [DnsRecord])
     (Maybe [DnsRecord])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMailDomainResponse' {Maybe [DnsRecord]
records :: Maybe [DnsRecord]
$sel:records:GetMailDomainResponse' :: GetMailDomainResponse -> Maybe [DnsRecord]
records} -> Maybe [DnsRecord]
records) (\s :: GetMailDomainResponse
s@GetMailDomainResponse' {} Maybe [DnsRecord]
a -> GetMailDomainResponse
s {$sel:records:GetMailDomainResponse' :: Maybe [DnsRecord]
records = Maybe [DnsRecord]
a} :: GetMailDomainResponse) ((Maybe [DnsRecord] -> f (Maybe [DnsRecord]))
 -> GetMailDomainResponse -> f GetMailDomainResponse)
-> ((Maybe [DnsRecord] -> f (Maybe [DnsRecord]))
    -> Maybe [DnsRecord] -> f (Maybe [DnsRecord]))
-> (Maybe [DnsRecord] -> f (Maybe [DnsRecord]))
-> GetMailDomainResponse
-> f GetMailDomainResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DnsRecord] [DnsRecord] [DnsRecord] [DnsRecord]
-> Iso
     (Maybe [DnsRecord])
     (Maybe [DnsRecord])
     (Maybe [DnsRecord])
     (Maybe [DnsRecord])
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 [DnsRecord] [DnsRecord] [DnsRecord] [DnsRecord]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates the status of the domain ownership verification.
getMailDomainResponse_ownershipVerificationStatus :: Lens.Lens' GetMailDomainResponse (Prelude.Maybe DnsRecordVerificationStatus)
getMailDomainResponse_ownershipVerificationStatus :: (Maybe DnsRecordVerificationStatus
 -> f (Maybe DnsRecordVerificationStatus))
-> GetMailDomainResponse -> f GetMailDomainResponse
getMailDomainResponse_ownershipVerificationStatus = (GetMailDomainResponse -> Maybe DnsRecordVerificationStatus)
-> (GetMailDomainResponse
    -> Maybe DnsRecordVerificationStatus -> GetMailDomainResponse)
-> Lens
     GetMailDomainResponse
     GetMailDomainResponse
     (Maybe DnsRecordVerificationStatus)
     (Maybe DnsRecordVerificationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMailDomainResponse' {Maybe DnsRecordVerificationStatus
ownershipVerificationStatus :: Maybe DnsRecordVerificationStatus
$sel:ownershipVerificationStatus:GetMailDomainResponse' :: GetMailDomainResponse -> Maybe DnsRecordVerificationStatus
ownershipVerificationStatus} -> Maybe DnsRecordVerificationStatus
ownershipVerificationStatus) (\s :: GetMailDomainResponse
s@GetMailDomainResponse' {} Maybe DnsRecordVerificationStatus
a -> GetMailDomainResponse
s {$sel:ownershipVerificationStatus:GetMailDomainResponse' :: Maybe DnsRecordVerificationStatus
ownershipVerificationStatus = Maybe DnsRecordVerificationStatus
a} :: GetMailDomainResponse)

-- | Indicates the status of a DKIM verification.
getMailDomainResponse_dkimVerificationStatus :: Lens.Lens' GetMailDomainResponse (Prelude.Maybe DnsRecordVerificationStatus)
getMailDomainResponse_dkimVerificationStatus :: (Maybe DnsRecordVerificationStatus
 -> f (Maybe DnsRecordVerificationStatus))
-> GetMailDomainResponse -> f GetMailDomainResponse
getMailDomainResponse_dkimVerificationStatus = (GetMailDomainResponse -> Maybe DnsRecordVerificationStatus)
-> (GetMailDomainResponse
    -> Maybe DnsRecordVerificationStatus -> GetMailDomainResponse)
-> Lens
     GetMailDomainResponse
     GetMailDomainResponse
     (Maybe DnsRecordVerificationStatus)
     (Maybe DnsRecordVerificationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMailDomainResponse' {Maybe DnsRecordVerificationStatus
dkimVerificationStatus :: Maybe DnsRecordVerificationStatus
$sel:dkimVerificationStatus:GetMailDomainResponse' :: GetMailDomainResponse -> Maybe DnsRecordVerificationStatus
dkimVerificationStatus} -> Maybe DnsRecordVerificationStatus
dkimVerificationStatus) (\s :: GetMailDomainResponse
s@GetMailDomainResponse' {} Maybe DnsRecordVerificationStatus
a -> GetMailDomainResponse
s {$sel:dkimVerificationStatus:GetMailDomainResponse' :: Maybe DnsRecordVerificationStatus
dkimVerificationStatus = Maybe DnsRecordVerificationStatus
a} :: GetMailDomainResponse)

-- | Specifies whether the domain is the default domain for your
-- organization.
getMailDomainResponse_isDefault :: Lens.Lens' GetMailDomainResponse (Prelude.Maybe Prelude.Bool)
getMailDomainResponse_isDefault :: (Maybe Bool -> f (Maybe Bool))
-> GetMailDomainResponse -> f GetMailDomainResponse
getMailDomainResponse_isDefault = (GetMailDomainResponse -> Maybe Bool)
-> (GetMailDomainResponse -> Maybe Bool -> GetMailDomainResponse)
-> Lens
     GetMailDomainResponse
     GetMailDomainResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMailDomainResponse' {Maybe Bool
isDefault :: Maybe Bool
$sel:isDefault:GetMailDomainResponse' :: GetMailDomainResponse -> Maybe Bool
isDefault} -> Maybe Bool
isDefault) (\s :: GetMailDomainResponse
s@GetMailDomainResponse' {} Maybe Bool
a -> GetMailDomainResponse
s {$sel:isDefault:GetMailDomainResponse' :: Maybe Bool
isDefault = Maybe Bool
a} :: GetMailDomainResponse)

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

instance Prelude.NFData GetMailDomainResponse