{-# 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.AWSHealth.DescribeEventDetailsForOrganization
-- 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)
--
-- Returns detailed information about one or more specified events for one
-- or more AWS accounts in your organization. This information includes
-- standard event data (such as the AWS Region and service), an event
-- description, and (depending on the event) possible metadata. This
-- operation doesn\'t return affected entities, such as the resources
-- related to the event. To return affected entities, use the
-- <https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeAffectedEntitiesForOrganization.html DescribeAffectedEntitiesForOrganization>
-- operation.
--
-- Before you can call this operation, you must first enable AWS Health to
-- work with AWS Organizations. To do this, call the
-- <https://docs.aws.amazon.com/health/latest/APIReference/API_EnableHealthServiceAccessForOrganization.html EnableHealthServiceAccessForOrganization>
-- operation from your organization\'s management account.
--
-- When you call the @DescribeEventDetailsForOrganization@ operation,
-- specify the @organizationEventDetailFilters@ object in the request.
-- Depending on the AWS Health event type, note the following differences:
--
-- -   To return event details for a public event, you must specify a null
--     value for the @awsAccountId@ parameter. If you specify an account ID
--     for a public event, AWS Health returns an error message because
--     public events aren\'t specific to an account.
--
-- -   To return event details for an event that is specific to an account
--     in your organization, you must specify the @awsAccountId@ parameter
--     in the request. If you don\'t specify an account ID, AWS Health
--     returns an error message because the event is specific to an account
--     in your organization.
--
-- For more information, see
-- <https://docs.aws.amazon.com/health/latest/APIReference/API_Event.html Event>.
--
-- This operation doesn\'t support resource-level permissions. You can\'t
-- use this operation to allow or deny access to specific AWS Health
-- events. For more information, see
-- <https://docs.aws.amazon.com/health/latest/ug/security_iam_id-based-policy-examples.html#resource-action-based-conditions Resource- and action-based conditions>
-- in the /AWS Health User Guide/.
module Amazonka.AWSHealth.DescribeEventDetailsForOrganization
  ( -- * Creating a Request
    DescribeEventDetailsForOrganization (..),
    newDescribeEventDetailsForOrganization,

    -- * Request Lenses
    describeEventDetailsForOrganization_locale,
    describeEventDetailsForOrganization_organizationEventDetailFilters,

    -- * Destructuring the Response
    DescribeEventDetailsForOrganizationResponse (..),
    newDescribeEventDetailsForOrganizationResponse,

    -- * Response Lenses
    describeEventDetailsForOrganizationResponse_successfulSet,
    describeEventDetailsForOrganizationResponse_failedSet,
    describeEventDetailsForOrganizationResponse_httpStatus,
  )
where

import Amazonka.AWSHealth.Types
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

-- | /See:/ 'newDescribeEventDetailsForOrganization' smart constructor.
data DescribeEventDetailsForOrganization = DescribeEventDetailsForOrganization'
  { -- | The locale (language) to return information in. English (en) is the
    -- default and the only supported value at this time.
    DescribeEventDetailsForOrganization -> Maybe Text
locale :: Prelude.Maybe Prelude.Text,
    -- | A set of JSON elements that includes the @awsAccountId@ and the
    -- @eventArn@.
    DescribeEventDetailsForOrganization -> NonEmpty EventAccountFilter
organizationEventDetailFilters :: Prelude.NonEmpty EventAccountFilter
  }
  deriving (DescribeEventDetailsForOrganization
-> DescribeEventDetailsForOrganization -> Bool
(DescribeEventDetailsForOrganization
 -> DescribeEventDetailsForOrganization -> Bool)
-> (DescribeEventDetailsForOrganization
    -> DescribeEventDetailsForOrganization -> Bool)
-> Eq DescribeEventDetailsForOrganization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventDetailsForOrganization
-> DescribeEventDetailsForOrganization -> Bool
$c/= :: DescribeEventDetailsForOrganization
-> DescribeEventDetailsForOrganization -> Bool
== :: DescribeEventDetailsForOrganization
-> DescribeEventDetailsForOrganization -> Bool
$c== :: DescribeEventDetailsForOrganization
-> DescribeEventDetailsForOrganization -> Bool
Prelude.Eq, ReadPrec [DescribeEventDetailsForOrganization]
ReadPrec DescribeEventDetailsForOrganization
Int -> ReadS DescribeEventDetailsForOrganization
ReadS [DescribeEventDetailsForOrganization]
(Int -> ReadS DescribeEventDetailsForOrganization)
-> ReadS [DescribeEventDetailsForOrganization]
-> ReadPrec DescribeEventDetailsForOrganization
-> ReadPrec [DescribeEventDetailsForOrganization]
-> Read DescribeEventDetailsForOrganization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventDetailsForOrganization]
$creadListPrec :: ReadPrec [DescribeEventDetailsForOrganization]
readPrec :: ReadPrec DescribeEventDetailsForOrganization
$creadPrec :: ReadPrec DescribeEventDetailsForOrganization
readList :: ReadS [DescribeEventDetailsForOrganization]
$creadList :: ReadS [DescribeEventDetailsForOrganization]
readsPrec :: Int -> ReadS DescribeEventDetailsForOrganization
$creadsPrec :: Int -> ReadS DescribeEventDetailsForOrganization
Prelude.Read, Int -> DescribeEventDetailsForOrganization -> ShowS
[DescribeEventDetailsForOrganization] -> ShowS
DescribeEventDetailsForOrganization -> String
(Int -> DescribeEventDetailsForOrganization -> ShowS)
-> (DescribeEventDetailsForOrganization -> String)
-> ([DescribeEventDetailsForOrganization] -> ShowS)
-> Show DescribeEventDetailsForOrganization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventDetailsForOrganization] -> ShowS
$cshowList :: [DescribeEventDetailsForOrganization] -> ShowS
show :: DescribeEventDetailsForOrganization -> String
$cshow :: DescribeEventDetailsForOrganization -> String
showsPrec :: Int -> DescribeEventDetailsForOrganization -> ShowS
$cshowsPrec :: Int -> DescribeEventDetailsForOrganization -> ShowS
Prelude.Show, (forall x.
 DescribeEventDetailsForOrganization
 -> Rep DescribeEventDetailsForOrganization x)
-> (forall x.
    Rep DescribeEventDetailsForOrganization x
    -> DescribeEventDetailsForOrganization)
-> Generic DescribeEventDetailsForOrganization
forall x.
Rep DescribeEventDetailsForOrganization x
-> DescribeEventDetailsForOrganization
forall x.
DescribeEventDetailsForOrganization
-> Rep DescribeEventDetailsForOrganization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventDetailsForOrganization x
-> DescribeEventDetailsForOrganization
$cfrom :: forall x.
DescribeEventDetailsForOrganization
-> Rep DescribeEventDetailsForOrganization x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventDetailsForOrganization' 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:
--
-- 'locale', 'describeEventDetailsForOrganization_locale' - The locale (language) to return information in. English (en) is the
-- default and the only supported value at this time.
--
-- 'organizationEventDetailFilters', 'describeEventDetailsForOrganization_organizationEventDetailFilters' - A set of JSON elements that includes the @awsAccountId@ and the
-- @eventArn@.
newDescribeEventDetailsForOrganization ::
  -- | 'organizationEventDetailFilters'
  Prelude.NonEmpty EventAccountFilter ->
  DescribeEventDetailsForOrganization
newDescribeEventDetailsForOrganization :: NonEmpty EventAccountFilter -> DescribeEventDetailsForOrganization
newDescribeEventDetailsForOrganization
  NonEmpty EventAccountFilter
pOrganizationEventDetailFilters_ =
    DescribeEventDetailsForOrganization' :: Maybe Text
-> NonEmpty EventAccountFilter
-> DescribeEventDetailsForOrganization
DescribeEventDetailsForOrganization'
      { $sel:locale:DescribeEventDetailsForOrganization' :: Maybe Text
locale =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:organizationEventDetailFilters:DescribeEventDetailsForOrganization' :: NonEmpty EventAccountFilter
organizationEventDetailFilters =
          Tagged
  (NonEmpty EventAccountFilter)
  (Identity (NonEmpty EventAccountFilter))
-> Tagged
     (NonEmpty EventAccountFilter)
     (Identity (NonEmpty EventAccountFilter))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            (Tagged
   (NonEmpty EventAccountFilter)
   (Identity (NonEmpty EventAccountFilter))
 -> Tagged
      (NonEmpty EventAccountFilter)
      (Identity (NonEmpty EventAccountFilter)))
-> NonEmpty EventAccountFilter -> NonEmpty EventAccountFilter
forall t b. AReview t b -> b -> t
Lens.# NonEmpty EventAccountFilter
pOrganizationEventDetailFilters_
      }

-- | The locale (language) to return information in. English (en) is the
-- default and the only supported value at this time.
describeEventDetailsForOrganization_locale :: Lens.Lens' DescribeEventDetailsForOrganization (Prelude.Maybe Prelude.Text)
describeEventDetailsForOrganization_locale :: (Maybe Text -> f (Maybe Text))
-> DescribeEventDetailsForOrganization
-> f DescribeEventDetailsForOrganization
describeEventDetailsForOrganization_locale = (DescribeEventDetailsForOrganization -> Maybe Text)
-> (DescribeEventDetailsForOrganization
    -> Maybe Text -> DescribeEventDetailsForOrganization)
-> Lens
     DescribeEventDetailsForOrganization
     DescribeEventDetailsForOrganization
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventDetailsForOrganization' {Maybe Text
locale :: Maybe Text
$sel:locale:DescribeEventDetailsForOrganization' :: DescribeEventDetailsForOrganization -> Maybe Text
locale} -> Maybe Text
locale) (\s :: DescribeEventDetailsForOrganization
s@DescribeEventDetailsForOrganization' {} Maybe Text
a -> DescribeEventDetailsForOrganization
s {$sel:locale:DescribeEventDetailsForOrganization' :: Maybe Text
locale = Maybe Text
a} :: DescribeEventDetailsForOrganization)

-- | A set of JSON elements that includes the @awsAccountId@ and the
-- @eventArn@.
describeEventDetailsForOrganization_organizationEventDetailFilters :: Lens.Lens' DescribeEventDetailsForOrganization (Prelude.NonEmpty EventAccountFilter)
describeEventDetailsForOrganization_organizationEventDetailFilters :: (NonEmpty EventAccountFilter -> f (NonEmpty EventAccountFilter))
-> DescribeEventDetailsForOrganization
-> f DescribeEventDetailsForOrganization
describeEventDetailsForOrganization_organizationEventDetailFilters = (DescribeEventDetailsForOrganization
 -> NonEmpty EventAccountFilter)
-> (DescribeEventDetailsForOrganization
    -> NonEmpty EventAccountFilter
    -> DescribeEventDetailsForOrganization)
-> Lens
     DescribeEventDetailsForOrganization
     DescribeEventDetailsForOrganization
     (NonEmpty EventAccountFilter)
     (NonEmpty EventAccountFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventDetailsForOrganization' {NonEmpty EventAccountFilter
organizationEventDetailFilters :: NonEmpty EventAccountFilter
$sel:organizationEventDetailFilters:DescribeEventDetailsForOrganization' :: DescribeEventDetailsForOrganization -> NonEmpty EventAccountFilter
organizationEventDetailFilters} -> NonEmpty EventAccountFilter
organizationEventDetailFilters) (\s :: DescribeEventDetailsForOrganization
s@DescribeEventDetailsForOrganization' {} NonEmpty EventAccountFilter
a -> DescribeEventDetailsForOrganization
s {$sel:organizationEventDetailFilters:DescribeEventDetailsForOrganization' :: NonEmpty EventAccountFilter
organizationEventDetailFilters = NonEmpty EventAccountFilter
a} :: DescribeEventDetailsForOrganization) ((NonEmpty EventAccountFilter -> f (NonEmpty EventAccountFilter))
 -> DescribeEventDetailsForOrganization
 -> f DescribeEventDetailsForOrganization)
-> ((NonEmpty EventAccountFilter
     -> f (NonEmpty EventAccountFilter))
    -> NonEmpty EventAccountFilter -> f (NonEmpty EventAccountFilter))
-> (NonEmpty EventAccountFilter -> f (NonEmpty EventAccountFilter))
-> DescribeEventDetailsForOrganization
-> f DescribeEventDetailsForOrganization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty EventAccountFilter -> f (NonEmpty EventAccountFilter))
-> NonEmpty EventAccountFilter -> f (NonEmpty EventAccountFilter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    DescribeEventDetailsForOrganization
  where
  type
    AWSResponse DescribeEventDetailsForOrganization =
      DescribeEventDetailsForOrganizationResponse
  request :: DescribeEventDetailsForOrganization
-> Request DescribeEventDetailsForOrganization
request = Service
-> DescribeEventDetailsForOrganization
-> Request DescribeEventDetailsForOrganization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeEventDetailsForOrganization
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeEventDetailsForOrganization)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeEventDetailsForOrganization))
-> Logger
-> Service
-> Proxy DescribeEventDetailsForOrganization
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeEventDetailsForOrganization)))
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 [OrganizationEventDetails]
-> Maybe [OrganizationEventDetailsErrorItem]
-> Int
-> DescribeEventDetailsForOrganizationResponse
DescribeEventDetailsForOrganizationResponse'
            (Maybe [OrganizationEventDetails]
 -> Maybe [OrganizationEventDetailsErrorItem]
 -> Int
 -> DescribeEventDetailsForOrganizationResponse)
-> Either String (Maybe [OrganizationEventDetails])
-> Either
     String
     (Maybe [OrganizationEventDetailsErrorItem]
      -> Int -> DescribeEventDetailsForOrganizationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [OrganizationEventDetails]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"successfulSet" Either String (Maybe (Maybe [OrganizationEventDetails]))
-> Maybe [OrganizationEventDetails]
-> Either String (Maybe [OrganizationEventDetails])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [OrganizationEventDetails]
forall a. Monoid a => a
Prelude.mempty)
              Either
  String
  (Maybe [OrganizationEventDetailsErrorItem]
   -> Int -> DescribeEventDetailsForOrganizationResponse)
-> Either String (Maybe [OrganizationEventDetailsErrorItem])
-> Either
     String (Int -> DescribeEventDetailsForOrganizationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either
     String (Maybe (Maybe [OrganizationEventDetailsErrorItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failedSet" Either String (Maybe (Maybe [OrganizationEventDetailsErrorItem]))
-> Maybe [OrganizationEventDetailsErrorItem]
-> Either String (Maybe [OrganizationEventDetailsErrorItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [OrganizationEventDetailsErrorItem]
forall a. Monoid a => a
Prelude.mempty)
              Either String (Int -> DescribeEventDetailsForOrganizationResponse)
-> Either String Int
-> Either String DescribeEventDetailsForOrganizationResponse
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
    DescribeEventDetailsForOrganization

instance
  Prelude.NFData
    DescribeEventDetailsForOrganization

instance
  Core.ToHeaders
    DescribeEventDetailsForOrganization
  where
  toHeaders :: DescribeEventDetailsForOrganization -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeEventDetailsForOrganization -> 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
"AWSHealth_20160804.DescribeEventDetailsForOrganization" ::
                          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
    DescribeEventDetailsForOrganization
  where
  toJSON :: DescribeEventDetailsForOrganization -> Value
toJSON DescribeEventDetailsForOrganization' {Maybe Text
NonEmpty EventAccountFilter
organizationEventDetailFilters :: NonEmpty EventAccountFilter
locale :: Maybe Text
$sel:organizationEventDetailFilters:DescribeEventDetailsForOrganization' :: DescribeEventDetailsForOrganization -> NonEmpty EventAccountFilter
$sel:locale:DescribeEventDetailsForOrganization' :: DescribeEventDetailsForOrganization -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"locale" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
locale,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"organizationEventDetailFilters"
                  Text -> NonEmpty EventAccountFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty EventAccountFilter
organizationEventDetailFilters
              )
          ]
      )

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

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

-- | /See:/ 'newDescribeEventDetailsForOrganizationResponse' smart constructor.
data DescribeEventDetailsForOrganizationResponse = DescribeEventDetailsForOrganizationResponse'
  { -- | Information about the events that could be retrieved.
    DescribeEventDetailsForOrganizationResponse
-> Maybe [OrganizationEventDetails]
successfulSet :: Prelude.Maybe [OrganizationEventDetails],
    -- | Error messages for any events that could not be retrieved.
    DescribeEventDetailsForOrganizationResponse
-> Maybe [OrganizationEventDetailsErrorItem]
failedSet :: Prelude.Maybe [OrganizationEventDetailsErrorItem],
    -- | The response's http status code.
    DescribeEventDetailsForOrganizationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeEventDetailsForOrganizationResponse
-> DescribeEventDetailsForOrganizationResponse -> Bool
(DescribeEventDetailsForOrganizationResponse
 -> DescribeEventDetailsForOrganizationResponse -> Bool)
-> (DescribeEventDetailsForOrganizationResponse
    -> DescribeEventDetailsForOrganizationResponse -> Bool)
-> Eq DescribeEventDetailsForOrganizationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventDetailsForOrganizationResponse
-> DescribeEventDetailsForOrganizationResponse -> Bool
$c/= :: DescribeEventDetailsForOrganizationResponse
-> DescribeEventDetailsForOrganizationResponse -> Bool
== :: DescribeEventDetailsForOrganizationResponse
-> DescribeEventDetailsForOrganizationResponse -> Bool
$c== :: DescribeEventDetailsForOrganizationResponse
-> DescribeEventDetailsForOrganizationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEventDetailsForOrganizationResponse]
ReadPrec DescribeEventDetailsForOrganizationResponse
Int -> ReadS DescribeEventDetailsForOrganizationResponse
ReadS [DescribeEventDetailsForOrganizationResponse]
(Int -> ReadS DescribeEventDetailsForOrganizationResponse)
-> ReadS [DescribeEventDetailsForOrganizationResponse]
-> ReadPrec DescribeEventDetailsForOrganizationResponse
-> ReadPrec [DescribeEventDetailsForOrganizationResponse]
-> Read DescribeEventDetailsForOrganizationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventDetailsForOrganizationResponse]
$creadListPrec :: ReadPrec [DescribeEventDetailsForOrganizationResponse]
readPrec :: ReadPrec DescribeEventDetailsForOrganizationResponse
$creadPrec :: ReadPrec DescribeEventDetailsForOrganizationResponse
readList :: ReadS [DescribeEventDetailsForOrganizationResponse]
$creadList :: ReadS [DescribeEventDetailsForOrganizationResponse]
readsPrec :: Int -> ReadS DescribeEventDetailsForOrganizationResponse
$creadsPrec :: Int -> ReadS DescribeEventDetailsForOrganizationResponse
Prelude.Read, Int -> DescribeEventDetailsForOrganizationResponse -> ShowS
[DescribeEventDetailsForOrganizationResponse] -> ShowS
DescribeEventDetailsForOrganizationResponse -> String
(Int -> DescribeEventDetailsForOrganizationResponse -> ShowS)
-> (DescribeEventDetailsForOrganizationResponse -> String)
-> ([DescribeEventDetailsForOrganizationResponse] -> ShowS)
-> Show DescribeEventDetailsForOrganizationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventDetailsForOrganizationResponse] -> ShowS
$cshowList :: [DescribeEventDetailsForOrganizationResponse] -> ShowS
show :: DescribeEventDetailsForOrganizationResponse -> String
$cshow :: DescribeEventDetailsForOrganizationResponse -> String
showsPrec :: Int -> DescribeEventDetailsForOrganizationResponse -> ShowS
$cshowsPrec :: Int -> DescribeEventDetailsForOrganizationResponse -> ShowS
Prelude.Show, (forall x.
 DescribeEventDetailsForOrganizationResponse
 -> Rep DescribeEventDetailsForOrganizationResponse x)
-> (forall x.
    Rep DescribeEventDetailsForOrganizationResponse x
    -> DescribeEventDetailsForOrganizationResponse)
-> Generic DescribeEventDetailsForOrganizationResponse
forall x.
Rep DescribeEventDetailsForOrganizationResponse x
-> DescribeEventDetailsForOrganizationResponse
forall x.
DescribeEventDetailsForOrganizationResponse
-> Rep DescribeEventDetailsForOrganizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventDetailsForOrganizationResponse x
-> DescribeEventDetailsForOrganizationResponse
$cfrom :: forall x.
DescribeEventDetailsForOrganizationResponse
-> Rep DescribeEventDetailsForOrganizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventDetailsForOrganizationResponse' 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:
--
-- 'successfulSet', 'describeEventDetailsForOrganizationResponse_successfulSet' - Information about the events that could be retrieved.
--
-- 'failedSet', 'describeEventDetailsForOrganizationResponse_failedSet' - Error messages for any events that could not be retrieved.
--
-- 'httpStatus', 'describeEventDetailsForOrganizationResponse_httpStatus' - The response's http status code.
newDescribeEventDetailsForOrganizationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeEventDetailsForOrganizationResponse
newDescribeEventDetailsForOrganizationResponse :: Int -> DescribeEventDetailsForOrganizationResponse
newDescribeEventDetailsForOrganizationResponse
  Int
pHttpStatus_ =
    DescribeEventDetailsForOrganizationResponse' :: Maybe [OrganizationEventDetails]
-> Maybe [OrganizationEventDetailsErrorItem]
-> Int
-> DescribeEventDetailsForOrganizationResponse
DescribeEventDetailsForOrganizationResponse'
      { $sel:successfulSet:DescribeEventDetailsForOrganizationResponse' :: Maybe [OrganizationEventDetails]
successfulSet =
          Maybe [OrganizationEventDetails]
forall a. Maybe a
Prelude.Nothing,
        $sel:failedSet:DescribeEventDetailsForOrganizationResponse' :: Maybe [OrganizationEventDetailsErrorItem]
failedSet = Maybe [OrganizationEventDetailsErrorItem]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeEventDetailsForOrganizationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the events that could be retrieved.
describeEventDetailsForOrganizationResponse_successfulSet :: Lens.Lens' DescribeEventDetailsForOrganizationResponse (Prelude.Maybe [OrganizationEventDetails])
describeEventDetailsForOrganizationResponse_successfulSet :: (Maybe [OrganizationEventDetails]
 -> f (Maybe [OrganizationEventDetails]))
-> DescribeEventDetailsForOrganizationResponse
-> f DescribeEventDetailsForOrganizationResponse
describeEventDetailsForOrganizationResponse_successfulSet = (DescribeEventDetailsForOrganizationResponse
 -> Maybe [OrganizationEventDetails])
-> (DescribeEventDetailsForOrganizationResponse
    -> Maybe [OrganizationEventDetails]
    -> DescribeEventDetailsForOrganizationResponse)
-> Lens
     DescribeEventDetailsForOrganizationResponse
     DescribeEventDetailsForOrganizationResponse
     (Maybe [OrganizationEventDetails])
     (Maybe [OrganizationEventDetails])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventDetailsForOrganizationResponse' {Maybe [OrganizationEventDetails]
successfulSet :: Maybe [OrganizationEventDetails]
$sel:successfulSet:DescribeEventDetailsForOrganizationResponse' :: DescribeEventDetailsForOrganizationResponse
-> Maybe [OrganizationEventDetails]
successfulSet} -> Maybe [OrganizationEventDetails]
successfulSet) (\s :: DescribeEventDetailsForOrganizationResponse
s@DescribeEventDetailsForOrganizationResponse' {} Maybe [OrganizationEventDetails]
a -> DescribeEventDetailsForOrganizationResponse
s {$sel:successfulSet:DescribeEventDetailsForOrganizationResponse' :: Maybe [OrganizationEventDetails]
successfulSet = Maybe [OrganizationEventDetails]
a} :: DescribeEventDetailsForOrganizationResponse) ((Maybe [OrganizationEventDetails]
  -> f (Maybe [OrganizationEventDetails]))
 -> DescribeEventDetailsForOrganizationResponse
 -> f DescribeEventDetailsForOrganizationResponse)
-> ((Maybe [OrganizationEventDetails]
     -> f (Maybe [OrganizationEventDetails]))
    -> Maybe [OrganizationEventDetails]
    -> f (Maybe [OrganizationEventDetails]))
-> (Maybe [OrganizationEventDetails]
    -> f (Maybe [OrganizationEventDetails]))
-> DescribeEventDetailsForOrganizationResponse
-> f DescribeEventDetailsForOrganizationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OrganizationEventDetails]
  [OrganizationEventDetails]
  [OrganizationEventDetails]
  [OrganizationEventDetails]
-> Iso
     (Maybe [OrganizationEventDetails])
     (Maybe [OrganizationEventDetails])
     (Maybe [OrganizationEventDetails])
     (Maybe [OrganizationEventDetails])
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
  [OrganizationEventDetails]
  [OrganizationEventDetails]
  [OrganizationEventDetails]
  [OrganizationEventDetails]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Error messages for any events that could not be retrieved.
describeEventDetailsForOrganizationResponse_failedSet :: Lens.Lens' DescribeEventDetailsForOrganizationResponse (Prelude.Maybe [OrganizationEventDetailsErrorItem])
describeEventDetailsForOrganizationResponse_failedSet :: (Maybe [OrganizationEventDetailsErrorItem]
 -> f (Maybe [OrganizationEventDetailsErrorItem]))
-> DescribeEventDetailsForOrganizationResponse
-> f DescribeEventDetailsForOrganizationResponse
describeEventDetailsForOrganizationResponse_failedSet = (DescribeEventDetailsForOrganizationResponse
 -> Maybe [OrganizationEventDetailsErrorItem])
-> (DescribeEventDetailsForOrganizationResponse
    -> Maybe [OrganizationEventDetailsErrorItem]
    -> DescribeEventDetailsForOrganizationResponse)
-> Lens
     DescribeEventDetailsForOrganizationResponse
     DescribeEventDetailsForOrganizationResponse
     (Maybe [OrganizationEventDetailsErrorItem])
     (Maybe [OrganizationEventDetailsErrorItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventDetailsForOrganizationResponse' {Maybe [OrganizationEventDetailsErrorItem]
failedSet :: Maybe [OrganizationEventDetailsErrorItem]
$sel:failedSet:DescribeEventDetailsForOrganizationResponse' :: DescribeEventDetailsForOrganizationResponse
-> Maybe [OrganizationEventDetailsErrorItem]
failedSet} -> Maybe [OrganizationEventDetailsErrorItem]
failedSet) (\s :: DescribeEventDetailsForOrganizationResponse
s@DescribeEventDetailsForOrganizationResponse' {} Maybe [OrganizationEventDetailsErrorItem]
a -> DescribeEventDetailsForOrganizationResponse
s {$sel:failedSet:DescribeEventDetailsForOrganizationResponse' :: Maybe [OrganizationEventDetailsErrorItem]
failedSet = Maybe [OrganizationEventDetailsErrorItem]
a} :: DescribeEventDetailsForOrganizationResponse) ((Maybe [OrganizationEventDetailsErrorItem]
  -> f (Maybe [OrganizationEventDetailsErrorItem]))
 -> DescribeEventDetailsForOrganizationResponse
 -> f DescribeEventDetailsForOrganizationResponse)
-> ((Maybe [OrganizationEventDetailsErrorItem]
     -> f (Maybe [OrganizationEventDetailsErrorItem]))
    -> Maybe [OrganizationEventDetailsErrorItem]
    -> f (Maybe [OrganizationEventDetailsErrorItem]))
-> (Maybe [OrganizationEventDetailsErrorItem]
    -> f (Maybe [OrganizationEventDetailsErrorItem]))
-> DescribeEventDetailsForOrganizationResponse
-> f DescribeEventDetailsForOrganizationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OrganizationEventDetailsErrorItem]
  [OrganizationEventDetailsErrorItem]
  [OrganizationEventDetailsErrorItem]
  [OrganizationEventDetailsErrorItem]
-> Iso
     (Maybe [OrganizationEventDetailsErrorItem])
     (Maybe [OrganizationEventDetailsErrorItem])
     (Maybe [OrganizationEventDetailsErrorItem])
     (Maybe [OrganizationEventDetailsErrorItem])
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
  [OrganizationEventDetailsErrorItem]
  [OrganizationEventDetailsErrorItem]
  [OrganizationEventDetailsErrorItem]
  [OrganizationEventDetailsErrorItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeEventDetailsForOrganizationResponse