{-# 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.DescribeOrganization
-- 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)
--
-- Provides more information regarding a given organization based on its
-- identifier.
module Amazonka.WorkMail.DescribeOrganization
  ( -- * Creating a Request
    DescribeOrganization (..),
    newDescribeOrganization,

    -- * Request Lenses
    describeOrganization_organizationId,

    -- * Destructuring the Response
    DescribeOrganizationResponse (..),
    newDescribeOrganizationResponse,

    -- * Response Lenses
    describeOrganizationResponse_directoryId,
    describeOrganizationResponse_state,
    describeOrganizationResponse_arn,
    describeOrganizationResponse_alias,
    describeOrganizationResponse_completedDate,
    describeOrganizationResponse_directoryType,
    describeOrganizationResponse_defaultMailDomain,
    describeOrganizationResponse_errorMessage,
    describeOrganizationResponse_organizationId,
    describeOrganizationResponse_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:/ 'newDescribeOrganization' smart constructor.
data DescribeOrganization = DescribeOrganization'
  { -- | The identifier for the organization to be described.
    DescribeOrganization -> Text
organizationId :: Prelude.Text
  }
  deriving (DescribeOrganization -> DescribeOrganization -> Bool
(DescribeOrganization -> DescribeOrganization -> Bool)
-> (DescribeOrganization -> DescribeOrganization -> Bool)
-> Eq DescribeOrganization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOrganization -> DescribeOrganization -> Bool
$c/= :: DescribeOrganization -> DescribeOrganization -> Bool
== :: DescribeOrganization -> DescribeOrganization -> Bool
$c== :: DescribeOrganization -> DescribeOrganization -> Bool
Prelude.Eq, ReadPrec [DescribeOrganization]
ReadPrec DescribeOrganization
Int -> ReadS DescribeOrganization
ReadS [DescribeOrganization]
(Int -> ReadS DescribeOrganization)
-> ReadS [DescribeOrganization]
-> ReadPrec DescribeOrganization
-> ReadPrec [DescribeOrganization]
-> Read DescribeOrganization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOrganization]
$creadListPrec :: ReadPrec [DescribeOrganization]
readPrec :: ReadPrec DescribeOrganization
$creadPrec :: ReadPrec DescribeOrganization
readList :: ReadS [DescribeOrganization]
$creadList :: ReadS [DescribeOrganization]
readsPrec :: Int -> ReadS DescribeOrganization
$creadsPrec :: Int -> ReadS DescribeOrganization
Prelude.Read, Int -> DescribeOrganization -> ShowS
[DescribeOrganization] -> ShowS
DescribeOrganization -> String
(Int -> DescribeOrganization -> ShowS)
-> (DescribeOrganization -> String)
-> ([DescribeOrganization] -> ShowS)
-> Show DescribeOrganization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOrganization] -> ShowS
$cshowList :: [DescribeOrganization] -> ShowS
show :: DescribeOrganization -> String
$cshow :: DescribeOrganization -> String
showsPrec :: Int -> DescribeOrganization -> ShowS
$cshowsPrec :: Int -> DescribeOrganization -> ShowS
Prelude.Show, (forall x. DescribeOrganization -> Rep DescribeOrganization x)
-> (forall x. Rep DescribeOrganization x -> DescribeOrganization)
-> Generic DescribeOrganization
forall x. Rep DescribeOrganization x -> DescribeOrganization
forall x. DescribeOrganization -> Rep DescribeOrganization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeOrganization x -> DescribeOrganization
$cfrom :: forall x. DescribeOrganization -> Rep DescribeOrganization x
Prelude.Generic)

-- |
-- Create a value of 'DescribeOrganization' 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', 'describeOrganization_organizationId' - The identifier for the organization to be described.
newDescribeOrganization ::
  -- | 'organizationId'
  Prelude.Text ->
  DescribeOrganization
newDescribeOrganization :: Text -> DescribeOrganization
newDescribeOrganization Text
pOrganizationId_ =
  DescribeOrganization' :: Text -> DescribeOrganization
DescribeOrganization'
    { $sel:organizationId:DescribeOrganization' :: Text
organizationId =
        Text
pOrganizationId_
    }

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

instance Core.AWSRequest DescribeOrganization where
  type
    AWSResponse DescribeOrganization =
      DescribeOrganizationResponse
  request :: DescribeOrganization -> Request DescribeOrganization
request = Service -> DescribeOrganization -> Request DescribeOrganization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeOrganization)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeOrganization))
-> Logger
-> Service
-> Proxy DescribeOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeOrganization)))
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeOrganizationResponse
DescribeOrganizationResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeOrganizationResponse)
forall (f :: * -> *) a b. Functor 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
"DirectoryId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeOrganizationResponse)
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
"State")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeOrganizationResponse)
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
"ARN")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeOrganizationResponse)
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
"Alias")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeOrganizationResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeOrganizationResponse)
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
"CompletedDate")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> DescribeOrganizationResponse)
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
"DirectoryType")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> DescribeOrganizationResponse)
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
"DefaultMailDomain")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> DescribeOrganizationResponse)
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
"ErrorMessage")
            Either String (Maybe Text -> Int -> DescribeOrganizationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeOrganizationResponse)
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
"OrganizationId")
            Either String (Int -> DescribeOrganizationResponse)
-> Either String Int -> Either String DescribeOrganizationResponse
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 DescribeOrganization

instance Prelude.NFData DescribeOrganization

instance Core.ToHeaders DescribeOrganization where
  toHeaders :: DescribeOrganization -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeOrganization -> 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.DescribeOrganization" ::
                          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 DescribeOrganization where
  toJSON :: DescribeOrganization -> Value
toJSON DescribeOrganization' {Text
organizationId :: Text
$sel:organizationId:DescribeOrganization' :: DescribeOrganization -> 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)
          ]
      )

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

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

-- | /See:/ 'newDescribeOrganizationResponse' smart constructor.
data DescribeOrganizationResponse = DescribeOrganizationResponse'
  { -- | The identifier for the directory associated with an Amazon WorkMail
    -- organization.
    DescribeOrganizationResponse -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The state of an organization.
    DescribeOrganizationResponse -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the organization.
    DescribeOrganizationResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The alias for an organization.
    DescribeOrganizationResponse -> Maybe Text
alias :: Prelude.Maybe Prelude.Text,
    -- | The date at which the organization became usable in the WorkMail
    -- context, in UNIX epoch time format.
    DescribeOrganizationResponse -> Maybe POSIX
completedDate :: Prelude.Maybe Core.POSIX,
    -- | The type of directory associated with the WorkMail organization.
    DescribeOrganizationResponse -> Maybe Text
directoryType :: Prelude.Maybe Prelude.Text,
    -- | The default mail domain associated with the organization.
    DescribeOrganizationResponse -> Maybe Text
defaultMailDomain :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The error message indicating if unexpected behavior was
    -- encountered with regards to the organization.
    DescribeOrganizationResponse -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The identifier of an organization.
    DescribeOrganizationResponse -> Maybe Text
organizationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeOrganizationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeOrganizationResponse
-> DescribeOrganizationResponse -> Bool
(DescribeOrganizationResponse
 -> DescribeOrganizationResponse -> Bool)
-> (DescribeOrganizationResponse
    -> DescribeOrganizationResponse -> Bool)
-> Eq DescribeOrganizationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOrganizationResponse
-> DescribeOrganizationResponse -> Bool
$c/= :: DescribeOrganizationResponse
-> DescribeOrganizationResponse -> Bool
== :: DescribeOrganizationResponse
-> DescribeOrganizationResponse -> Bool
$c== :: DescribeOrganizationResponse
-> DescribeOrganizationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeOrganizationResponse]
ReadPrec DescribeOrganizationResponse
Int -> ReadS DescribeOrganizationResponse
ReadS [DescribeOrganizationResponse]
(Int -> ReadS DescribeOrganizationResponse)
-> ReadS [DescribeOrganizationResponse]
-> ReadPrec DescribeOrganizationResponse
-> ReadPrec [DescribeOrganizationResponse]
-> Read DescribeOrganizationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOrganizationResponse]
$creadListPrec :: ReadPrec [DescribeOrganizationResponse]
readPrec :: ReadPrec DescribeOrganizationResponse
$creadPrec :: ReadPrec DescribeOrganizationResponse
readList :: ReadS [DescribeOrganizationResponse]
$creadList :: ReadS [DescribeOrganizationResponse]
readsPrec :: Int -> ReadS DescribeOrganizationResponse
$creadsPrec :: Int -> ReadS DescribeOrganizationResponse
Prelude.Read, Int -> DescribeOrganizationResponse -> ShowS
[DescribeOrganizationResponse] -> ShowS
DescribeOrganizationResponse -> String
(Int -> DescribeOrganizationResponse -> ShowS)
-> (DescribeOrganizationResponse -> String)
-> ([DescribeOrganizationResponse] -> ShowS)
-> Show DescribeOrganizationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOrganizationResponse] -> ShowS
$cshowList :: [DescribeOrganizationResponse] -> ShowS
show :: DescribeOrganizationResponse -> String
$cshow :: DescribeOrganizationResponse -> String
showsPrec :: Int -> DescribeOrganizationResponse -> ShowS
$cshowsPrec :: Int -> DescribeOrganizationResponse -> ShowS
Prelude.Show, (forall x.
 DescribeOrganizationResponse -> Rep DescribeOrganizationResponse x)
-> (forall x.
    Rep DescribeOrganizationResponse x -> DescribeOrganizationResponse)
-> Generic DescribeOrganizationResponse
forall x.
Rep DescribeOrganizationResponse x -> DescribeOrganizationResponse
forall x.
DescribeOrganizationResponse -> Rep DescribeOrganizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeOrganizationResponse x -> DescribeOrganizationResponse
$cfrom :: forall x.
DescribeOrganizationResponse -> Rep DescribeOrganizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeOrganizationResponse' 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:
--
-- 'directoryId', 'describeOrganizationResponse_directoryId' - The identifier for the directory associated with an Amazon WorkMail
-- organization.
--
-- 'state', 'describeOrganizationResponse_state' - The state of an organization.
--
-- 'arn', 'describeOrganizationResponse_arn' - The Amazon Resource Name (ARN) of the organization.
--
-- 'alias', 'describeOrganizationResponse_alias' - The alias for an organization.
--
-- 'completedDate', 'describeOrganizationResponse_completedDate' - The date at which the organization became usable in the WorkMail
-- context, in UNIX epoch time format.
--
-- 'directoryType', 'describeOrganizationResponse_directoryType' - The type of directory associated with the WorkMail organization.
--
-- 'defaultMailDomain', 'describeOrganizationResponse_defaultMailDomain' - The default mail domain associated with the organization.
--
-- 'errorMessage', 'describeOrganizationResponse_errorMessage' - (Optional) The error message indicating if unexpected behavior was
-- encountered with regards to the organization.
--
-- 'organizationId', 'describeOrganizationResponse_organizationId' - The identifier of an organization.
--
-- 'httpStatus', 'describeOrganizationResponse_httpStatus' - The response's http status code.
newDescribeOrganizationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeOrganizationResponse
newDescribeOrganizationResponse :: Int -> DescribeOrganizationResponse
newDescribeOrganizationResponse Int
pHttpStatus_ =
  DescribeOrganizationResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeOrganizationResponse
DescribeOrganizationResponse'
    { $sel:directoryId:DescribeOrganizationResponse' :: Maybe Text
directoryId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:state:DescribeOrganizationResponse' :: Maybe Text
state = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DescribeOrganizationResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alias:DescribeOrganizationResponse' :: Maybe Text
alias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:completedDate:DescribeOrganizationResponse' :: Maybe POSIX
completedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:directoryType:DescribeOrganizationResponse' :: Maybe Text
directoryType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultMailDomain:DescribeOrganizationResponse' :: Maybe Text
defaultMailDomain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:DescribeOrganizationResponse' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationId:DescribeOrganizationResponse' :: Maybe Text
organizationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeOrganizationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier for the directory associated with an Amazon WorkMail
-- organization.
describeOrganizationResponse_directoryId :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_directoryId :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_directoryId = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:directoryId:DescribeOrganizationResponse' :: Maybe Text
directoryId = Maybe Text
a} :: DescribeOrganizationResponse)

-- | The state of an organization.
describeOrganizationResponse_state :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_state :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_state = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
state :: Maybe Text
$sel:state:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
state} -> Maybe Text
state) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:state:DescribeOrganizationResponse' :: Maybe Text
state = Maybe Text
a} :: DescribeOrganizationResponse)

-- | The Amazon Resource Name (ARN) of the organization.
describeOrganizationResponse_arn :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_arn :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_arn = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:arn:DescribeOrganizationResponse' :: Maybe Text
arn = Maybe Text
a} :: DescribeOrganizationResponse)

-- | The alias for an organization.
describeOrganizationResponse_alias :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_alias :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_alias = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
alias :: Maybe Text
$sel:alias:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
alias} -> Maybe Text
alias) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:alias:DescribeOrganizationResponse' :: Maybe Text
alias = Maybe Text
a} :: DescribeOrganizationResponse)

-- | The date at which the organization became usable in the WorkMail
-- context, in UNIX epoch time format.
describeOrganizationResponse_completedDate :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.UTCTime)
describeOrganizationResponse_completedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_completedDate = (DescribeOrganizationResponse -> Maybe POSIX)
-> (DescribeOrganizationResponse
    -> Maybe POSIX -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe POSIX
completedDate :: Maybe POSIX
$sel:completedDate:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe POSIX
completedDate} -> Maybe POSIX
completedDate) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe POSIX
a -> DescribeOrganizationResponse
s {$sel:completedDate:DescribeOrganizationResponse' :: Maybe POSIX
completedDate = Maybe POSIX
a} :: DescribeOrganizationResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeOrganizationResponse -> f DescribeOrganizationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeOrganizationResponse
-> f DescribeOrganizationResponse
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 type of directory associated with the WorkMail organization.
describeOrganizationResponse_directoryType :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_directoryType :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_directoryType = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
directoryType :: Maybe Text
$sel:directoryType:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
directoryType} -> Maybe Text
directoryType) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:directoryType:DescribeOrganizationResponse' :: Maybe Text
directoryType = Maybe Text
a} :: DescribeOrganizationResponse)

-- | The default mail domain associated with the organization.
describeOrganizationResponse_defaultMailDomain :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_defaultMailDomain :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_defaultMailDomain = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
defaultMailDomain :: Maybe Text
$sel:defaultMailDomain:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
defaultMailDomain} -> Maybe Text
defaultMailDomain) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:defaultMailDomain:DescribeOrganizationResponse' :: Maybe Text
defaultMailDomain = Maybe Text
a} :: DescribeOrganizationResponse)

-- | (Optional) The error message indicating if unexpected behavior was
-- encountered with regards to the organization.
describeOrganizationResponse_errorMessage :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_errorMessage :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_errorMessage = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:errorMessage:DescribeOrganizationResponse' :: Maybe Text
errorMessage = Maybe Text
a} :: DescribeOrganizationResponse)

-- | The identifier of an organization.
describeOrganizationResponse_organizationId :: Lens.Lens' DescribeOrganizationResponse (Prelude.Maybe Prelude.Text)
describeOrganizationResponse_organizationId :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationResponse -> f DescribeOrganizationResponse
describeOrganizationResponse_organizationId = (DescribeOrganizationResponse -> Maybe Text)
-> (DescribeOrganizationResponse
    -> Maybe Text -> DescribeOrganizationResponse)
-> Lens
     DescribeOrganizationResponse
     DescribeOrganizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationResponse' {Maybe Text
organizationId :: Maybe Text
$sel:organizationId:DescribeOrganizationResponse' :: DescribeOrganizationResponse -> Maybe Text
organizationId} -> Maybe Text
organizationId) (\s :: DescribeOrganizationResponse
s@DescribeOrganizationResponse' {} Maybe Text
a -> DescribeOrganizationResponse
s {$sel:organizationId:DescribeOrganizationResponse' :: Maybe Text
organizationId = Maybe Text
a} :: DescribeOrganizationResponse)

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

instance Prelude.NFData DescribeOrganizationResponse