{-# 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.DescribeResource
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the data available for the resource.
module Amazonka.WorkMail.DescribeResource
  ( -- * Creating a Request
    DescribeResource (..),
    newDescribeResource,

    -- * Request Lenses
    describeResource_organizationId,
    describeResource_resourceId,

    -- * Destructuring the Response
    DescribeResourceResponse (..),
    newDescribeResourceResponse,

    -- * Response Lenses
    describeResourceResponse_bookingOptions,
    describeResourceResponse_disabledDate,
    describeResourceResponse_email,
    describeResourceResponse_enabledDate,
    describeResourceResponse_name,
    describeResourceResponse_resourceId,
    describeResourceResponse_state,
    describeResourceResponse_type,
    describeResourceResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeResource' smart constructor.
data DescribeResource = DescribeResource'
  { -- | The identifier associated with the organization for which the resource
    -- is described.
    DescribeResource -> Text
organizationId :: Prelude.Text,
    -- | The identifier of the resource to be described.
    DescribeResource -> Text
resourceId :: Prelude.Text
  }
  deriving (DescribeResource -> DescribeResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeResource -> DescribeResource -> Bool
$c/= :: DescribeResource -> DescribeResource -> Bool
== :: DescribeResource -> DescribeResource -> Bool
$c== :: DescribeResource -> DescribeResource -> Bool
Prelude.Eq, ReadPrec [DescribeResource]
ReadPrec DescribeResource
Int -> ReadS DescribeResource
ReadS [DescribeResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeResource]
$creadListPrec :: ReadPrec [DescribeResource]
readPrec :: ReadPrec DescribeResource
$creadPrec :: ReadPrec DescribeResource
readList :: ReadS [DescribeResource]
$creadList :: ReadS [DescribeResource]
readsPrec :: Int -> ReadS DescribeResource
$creadsPrec :: Int -> ReadS DescribeResource
Prelude.Read, Int -> DescribeResource -> ShowS
[DescribeResource] -> ShowS
DescribeResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeResource] -> ShowS
$cshowList :: [DescribeResource] -> ShowS
show :: DescribeResource -> String
$cshow :: DescribeResource -> String
showsPrec :: Int -> DescribeResource -> ShowS
$cshowsPrec :: Int -> DescribeResource -> ShowS
Prelude.Show, forall x. Rep DescribeResource x -> DescribeResource
forall x. DescribeResource -> Rep DescribeResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeResource x -> DescribeResource
$cfrom :: forall x. DescribeResource -> Rep DescribeResource x
Prelude.Generic)

-- |
-- Create a value of 'DescribeResource' 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', 'describeResource_organizationId' - The identifier associated with the organization for which the resource
-- is described.
--
-- 'resourceId', 'describeResource_resourceId' - The identifier of the resource to be described.
newDescribeResource ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'resourceId'
  Prelude.Text ->
  DescribeResource
newDescribeResource :: Text -> Text -> DescribeResource
newDescribeResource Text
pOrganizationId_ Text
pResourceId_ =
  DescribeResource'
    { $sel:organizationId:DescribeResource' :: Text
organizationId =
        Text
pOrganizationId_,
      $sel:resourceId:DescribeResource' :: Text
resourceId = Text
pResourceId_
    }

-- | The identifier associated with the organization for which the resource
-- is described.
describeResource_organizationId :: Lens.Lens' DescribeResource Prelude.Text
describeResource_organizationId :: Lens' DescribeResource Text
describeResource_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResource' {Text
organizationId :: Text
$sel:organizationId:DescribeResource' :: DescribeResource -> Text
organizationId} -> Text
organizationId) (\s :: DescribeResource
s@DescribeResource' {} Text
a -> DescribeResource
s {$sel:organizationId:DescribeResource' :: Text
organizationId = Text
a} :: DescribeResource)

-- | The identifier of the resource to be described.
describeResource_resourceId :: Lens.Lens' DescribeResource Prelude.Text
describeResource_resourceId :: Lens' DescribeResource Text
describeResource_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResource' {Text
resourceId :: Text
$sel:resourceId:DescribeResource' :: DescribeResource -> Text
resourceId} -> Text
resourceId) (\s :: DescribeResource
s@DescribeResource' {} Text
a -> DescribeResource
s {$sel:resourceId:DescribeResource' :: Text
resourceId = Text
a} :: DescribeResource)

instance Core.AWSRequest DescribeResource where
  type
    AWSResponse DescribeResource =
      DescribeResourceResponse
  request :: (Service -> Service)
-> DescribeResource -> Request DescribeResource
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeResource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeResource)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe BookingOptions
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe EntityState
-> Maybe ResourceType
-> Int
-> DescribeResourceResponse
DescribeResourceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BookingOptions")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DisabledDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Email")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EnabledDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ResourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"State")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Type")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeResource where
  hashWithSalt :: Int -> DescribeResource -> Int
hashWithSalt Int
_salt DescribeResource' {Text
resourceId :: Text
organizationId :: Text
$sel:resourceId:DescribeResource' :: DescribeResource -> Text
$sel:organizationId:DescribeResource' :: DescribeResource -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId

instance Prelude.NFData DescribeResource where
  rnf :: DescribeResource -> ()
rnf DescribeResource' {Text
resourceId :: Text
organizationId :: Text
$sel:resourceId:DescribeResource' :: DescribeResource -> Text
$sel:organizationId:DescribeResource' :: DescribeResource -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId

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

instance Data.ToJSON DescribeResource where
  toJSON :: DescribeResource -> Value
toJSON DescribeResource' {Text
resourceId :: Text
organizationId :: Text
$sel:resourceId:DescribeResource' :: DescribeResource -> Text
$sel:organizationId:DescribeResource' :: DescribeResource -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId),
            forall a. a -> Maybe a
Prelude.Just (Key
"ResourceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceId)
          ]
      )

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

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

-- | /See:/ 'newDescribeResourceResponse' smart constructor.
data DescribeResourceResponse = DescribeResourceResponse'
  { -- | The booking options for the described resource.
    DescribeResourceResponse -> Maybe BookingOptions
bookingOptions :: Prelude.Maybe BookingOptions,
    -- | The date and time when a resource was disabled from WorkMail, in UNIX
    -- epoch time format.
    DescribeResourceResponse -> Maybe POSIX
disabledDate :: Prelude.Maybe Data.POSIX,
    -- | The email of the described resource.
    DescribeResourceResponse -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
    -- | The date and time when a resource was enabled for WorkMail, in UNIX
    -- epoch time format.
    DescribeResourceResponse -> Maybe POSIX
enabledDate :: Prelude.Maybe Data.POSIX,
    -- | The name of the described resource.
    DescribeResourceResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the described resource.
    DescribeResourceResponse -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The state of the resource: enabled (registered to WorkMail), disabled
    -- (deregistered or never registered to WorkMail), or deleted.
    DescribeResourceResponse -> Maybe EntityState
state :: Prelude.Maybe EntityState,
    -- | The type of the described resource.
    DescribeResourceResponse -> Maybe ResourceType
type' :: Prelude.Maybe ResourceType,
    -- | The response's http status code.
    DescribeResourceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeResourceResponse -> DescribeResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
$c/= :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
== :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
$c== :: DescribeResourceResponse -> DescribeResourceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeResourceResponse]
ReadPrec DescribeResourceResponse
Int -> ReadS DescribeResourceResponse
ReadS [DescribeResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeResourceResponse]
$creadListPrec :: ReadPrec [DescribeResourceResponse]
readPrec :: ReadPrec DescribeResourceResponse
$creadPrec :: ReadPrec DescribeResourceResponse
readList :: ReadS [DescribeResourceResponse]
$creadList :: ReadS [DescribeResourceResponse]
readsPrec :: Int -> ReadS DescribeResourceResponse
$creadsPrec :: Int -> ReadS DescribeResourceResponse
Prelude.Read, Int -> DescribeResourceResponse -> ShowS
[DescribeResourceResponse] -> ShowS
DescribeResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeResourceResponse] -> ShowS
$cshowList :: [DescribeResourceResponse] -> ShowS
show :: DescribeResourceResponse -> String
$cshow :: DescribeResourceResponse -> String
showsPrec :: Int -> DescribeResourceResponse -> ShowS
$cshowsPrec :: Int -> DescribeResourceResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeResourceResponse x -> DescribeResourceResponse
forall x.
DescribeResourceResponse -> Rep DescribeResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeResourceResponse x -> DescribeResourceResponse
$cfrom :: forall x.
DescribeResourceResponse -> Rep DescribeResourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeResourceResponse' 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:
--
-- 'bookingOptions', 'describeResourceResponse_bookingOptions' - The booking options for the described resource.
--
-- 'disabledDate', 'describeResourceResponse_disabledDate' - The date and time when a resource was disabled from WorkMail, in UNIX
-- epoch time format.
--
-- 'email', 'describeResourceResponse_email' - The email of the described resource.
--
-- 'enabledDate', 'describeResourceResponse_enabledDate' - The date and time when a resource was enabled for WorkMail, in UNIX
-- epoch time format.
--
-- 'name', 'describeResourceResponse_name' - The name of the described resource.
--
-- 'resourceId', 'describeResourceResponse_resourceId' - The identifier of the described resource.
--
-- 'state', 'describeResourceResponse_state' - The state of the resource: enabled (registered to WorkMail), disabled
-- (deregistered or never registered to WorkMail), or deleted.
--
-- 'type'', 'describeResourceResponse_type' - The type of the described resource.
--
-- 'httpStatus', 'describeResourceResponse_httpStatus' - The response's http status code.
newDescribeResourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeResourceResponse
newDescribeResourceResponse :: Int -> DescribeResourceResponse
newDescribeResourceResponse Int
pHttpStatus_ =
  DescribeResourceResponse'
    { $sel:bookingOptions:DescribeResourceResponse' :: Maybe BookingOptions
bookingOptions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:disabledDate:DescribeResourceResponse' :: Maybe POSIX
disabledDate = forall a. Maybe a
Prelude.Nothing,
      $sel:email:DescribeResourceResponse' :: Maybe Text
email = forall a. Maybe a
Prelude.Nothing,
      $sel:enabledDate:DescribeResourceResponse' :: Maybe POSIX
enabledDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeResourceResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:DescribeResourceResponse' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:state:DescribeResourceResponse' :: Maybe EntityState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:type':DescribeResourceResponse' :: Maybe ResourceType
type' = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The booking options for the described resource.
describeResourceResponse_bookingOptions :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe BookingOptions)
describeResourceResponse_bookingOptions :: Lens' DescribeResourceResponse (Maybe BookingOptions)
describeResourceResponse_bookingOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe BookingOptions
bookingOptions :: Maybe BookingOptions
$sel:bookingOptions:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe BookingOptions
bookingOptions} -> Maybe BookingOptions
bookingOptions) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe BookingOptions
a -> DescribeResourceResponse
s {$sel:bookingOptions:DescribeResourceResponse' :: Maybe BookingOptions
bookingOptions = Maybe BookingOptions
a} :: DescribeResourceResponse)

-- | The date and time when a resource was disabled from WorkMail, in UNIX
-- epoch time format.
describeResourceResponse_disabledDate :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe Prelude.UTCTime)
describeResourceResponse_disabledDate :: Lens' DescribeResourceResponse (Maybe UTCTime)
describeResourceResponse_disabledDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe POSIX
disabledDate :: Maybe POSIX
$sel:disabledDate:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe POSIX
disabledDate} -> Maybe POSIX
disabledDate) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe POSIX
a -> DescribeResourceResponse
s {$sel:disabledDate:DescribeResourceResponse' :: Maybe POSIX
disabledDate = Maybe POSIX
a} :: DescribeResourceResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The email of the described resource.
describeResourceResponse_email :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe Prelude.Text)
describeResourceResponse_email :: Lens' DescribeResourceResponse (Maybe Text)
describeResourceResponse_email = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe Text
email :: Maybe Text
$sel:email:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe Text
email} -> Maybe Text
email) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe Text
a -> DescribeResourceResponse
s {$sel:email:DescribeResourceResponse' :: Maybe Text
email = Maybe Text
a} :: DescribeResourceResponse)

-- | The date and time when a resource was enabled for WorkMail, in UNIX
-- epoch time format.
describeResourceResponse_enabledDate :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe Prelude.UTCTime)
describeResourceResponse_enabledDate :: Lens' DescribeResourceResponse (Maybe UTCTime)
describeResourceResponse_enabledDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe POSIX
enabledDate :: Maybe POSIX
$sel:enabledDate:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe POSIX
enabledDate} -> Maybe POSIX
enabledDate) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe POSIX
a -> DescribeResourceResponse
s {$sel:enabledDate:DescribeResourceResponse' :: Maybe POSIX
enabledDate = Maybe POSIX
a} :: DescribeResourceResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the described resource.
describeResourceResponse_name :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe Prelude.Text)
describeResourceResponse_name :: Lens' DescribeResourceResponse (Maybe Text)
describeResourceResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe Text
a -> DescribeResourceResponse
s {$sel:name:DescribeResourceResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeResourceResponse)

-- | The identifier of the described resource.
describeResourceResponse_resourceId :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe Prelude.Text)
describeResourceResponse_resourceId :: Lens' DescribeResourceResponse (Maybe Text)
describeResourceResponse_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe Text
a -> DescribeResourceResponse
s {$sel:resourceId:DescribeResourceResponse' :: Maybe Text
resourceId = Maybe Text
a} :: DescribeResourceResponse)

-- | The state of the resource: enabled (registered to WorkMail), disabled
-- (deregistered or never registered to WorkMail), or deleted.
describeResourceResponse_state :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe EntityState)
describeResourceResponse_state :: Lens' DescribeResourceResponse (Maybe EntityState)
describeResourceResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe EntityState
state :: Maybe EntityState
$sel:state:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe EntityState
state} -> Maybe EntityState
state) (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe EntityState
a -> DescribeResourceResponse
s {$sel:state:DescribeResourceResponse' :: Maybe EntityState
state = Maybe EntityState
a} :: DescribeResourceResponse)

-- | The type of the described resource.
describeResourceResponse_type :: Lens.Lens' DescribeResourceResponse (Prelude.Maybe ResourceType)
describeResourceResponse_type :: Lens' DescribeResourceResponse (Maybe ResourceType)
describeResourceResponse_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResourceResponse' {Maybe ResourceType
type' :: Maybe ResourceType
$sel:type':DescribeResourceResponse' :: DescribeResourceResponse -> Maybe ResourceType
type'} -> Maybe ResourceType
type') (\s :: DescribeResourceResponse
s@DescribeResourceResponse' {} Maybe ResourceType
a -> DescribeResourceResponse
s {$sel:type':DescribeResourceResponse' :: Maybe ResourceType
type' = Maybe ResourceType
a} :: DescribeResourceResponse)

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

instance Prelude.NFData DescribeResourceResponse where
  rnf :: DescribeResourceResponse -> ()
rnf DescribeResourceResponse' {Int
Maybe Text
Maybe POSIX
Maybe BookingOptions
Maybe EntityState
Maybe ResourceType
httpStatus :: Int
type' :: Maybe ResourceType
state :: Maybe EntityState
resourceId :: Maybe Text
name :: Maybe Text
enabledDate :: Maybe POSIX
email :: Maybe Text
disabledDate :: Maybe POSIX
bookingOptions :: Maybe BookingOptions
$sel:httpStatus:DescribeResourceResponse' :: DescribeResourceResponse -> Int
$sel:type':DescribeResourceResponse' :: DescribeResourceResponse -> Maybe ResourceType
$sel:state:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe EntityState
$sel:resourceId:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe Text
$sel:name:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe Text
$sel:enabledDate:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe POSIX
$sel:email:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe Text
$sel:disabledDate:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe POSIX
$sel:bookingOptions:DescribeResourceResponse' :: DescribeResourceResponse -> Maybe BookingOptions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe BookingOptions
bookingOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
disabledDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
email
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
enabledDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EntityState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus