{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.OrganizationAffectedEntitiesErrorItem
-- 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)
module Amazonka.AWSHealth.Types.OrganizationAffectedEntitiesErrorItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Error information returned when a
-- <https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeAffectedEntitiesForOrganization.html DescribeAffectedEntitiesForOrganization>
-- operation can\'t find or process a specific entity.
--
-- /See:/ 'newOrganizationAffectedEntitiesErrorItem' smart constructor.
data OrganizationAffectedEntitiesErrorItem = OrganizationAffectedEntitiesErrorItem'
  { -- | The 12-digit AWS account numbers that contains the affected entities.
    OrganizationAffectedEntitiesErrorItem -> Maybe Text
awsAccountId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the event. The event ARN has the
    -- @arn:aws:health:event-region::event\/SERVICE\/EVENT_TYPE_CODE\/EVENT_TYPE_PLUS_ID @
    -- format.
    --
    -- For example, an event ARN might look like the following:
    --
    -- @arn:aws:health:us-east-1::event\/EC2\/EC2_INSTANCE_RETIREMENT_SCHEDULED\/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456@
    OrganizationAffectedEntitiesErrorItem -> Maybe Text
eventArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the error.
    OrganizationAffectedEntitiesErrorItem -> Maybe Text
errorName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the event type. The format is
    -- @AWS_SERVICE_DESCRIPTION@. For example,
    -- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
    OrganizationAffectedEntitiesErrorItem -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (OrganizationAffectedEntitiesErrorItem
-> OrganizationAffectedEntitiesErrorItem -> Bool
(OrganizationAffectedEntitiesErrorItem
 -> OrganizationAffectedEntitiesErrorItem -> Bool)
-> (OrganizationAffectedEntitiesErrorItem
    -> OrganizationAffectedEntitiesErrorItem -> Bool)
-> Eq OrganizationAffectedEntitiesErrorItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationAffectedEntitiesErrorItem
-> OrganizationAffectedEntitiesErrorItem -> Bool
$c/= :: OrganizationAffectedEntitiesErrorItem
-> OrganizationAffectedEntitiesErrorItem -> Bool
== :: OrganizationAffectedEntitiesErrorItem
-> OrganizationAffectedEntitiesErrorItem -> Bool
$c== :: OrganizationAffectedEntitiesErrorItem
-> OrganizationAffectedEntitiesErrorItem -> Bool
Prelude.Eq, ReadPrec [OrganizationAffectedEntitiesErrorItem]
ReadPrec OrganizationAffectedEntitiesErrorItem
Int -> ReadS OrganizationAffectedEntitiesErrorItem
ReadS [OrganizationAffectedEntitiesErrorItem]
(Int -> ReadS OrganizationAffectedEntitiesErrorItem)
-> ReadS [OrganizationAffectedEntitiesErrorItem]
-> ReadPrec OrganizationAffectedEntitiesErrorItem
-> ReadPrec [OrganizationAffectedEntitiesErrorItem]
-> Read OrganizationAffectedEntitiesErrorItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationAffectedEntitiesErrorItem]
$creadListPrec :: ReadPrec [OrganizationAffectedEntitiesErrorItem]
readPrec :: ReadPrec OrganizationAffectedEntitiesErrorItem
$creadPrec :: ReadPrec OrganizationAffectedEntitiesErrorItem
readList :: ReadS [OrganizationAffectedEntitiesErrorItem]
$creadList :: ReadS [OrganizationAffectedEntitiesErrorItem]
readsPrec :: Int -> ReadS OrganizationAffectedEntitiesErrorItem
$creadsPrec :: Int -> ReadS OrganizationAffectedEntitiesErrorItem
Prelude.Read, Int -> OrganizationAffectedEntitiesErrorItem -> ShowS
[OrganizationAffectedEntitiesErrorItem] -> ShowS
OrganizationAffectedEntitiesErrorItem -> String
(Int -> OrganizationAffectedEntitiesErrorItem -> ShowS)
-> (OrganizationAffectedEntitiesErrorItem -> String)
-> ([OrganizationAffectedEntitiesErrorItem] -> ShowS)
-> Show OrganizationAffectedEntitiesErrorItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationAffectedEntitiesErrorItem] -> ShowS
$cshowList :: [OrganizationAffectedEntitiesErrorItem] -> ShowS
show :: OrganizationAffectedEntitiesErrorItem -> String
$cshow :: OrganizationAffectedEntitiesErrorItem -> String
showsPrec :: Int -> OrganizationAffectedEntitiesErrorItem -> ShowS
$cshowsPrec :: Int -> OrganizationAffectedEntitiesErrorItem -> ShowS
Prelude.Show, (forall x.
 OrganizationAffectedEntitiesErrorItem
 -> Rep OrganizationAffectedEntitiesErrorItem x)
-> (forall x.
    Rep OrganizationAffectedEntitiesErrorItem x
    -> OrganizationAffectedEntitiesErrorItem)
-> Generic OrganizationAffectedEntitiesErrorItem
forall x.
Rep OrganizationAffectedEntitiesErrorItem x
-> OrganizationAffectedEntitiesErrorItem
forall x.
OrganizationAffectedEntitiesErrorItem
-> Rep OrganizationAffectedEntitiesErrorItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OrganizationAffectedEntitiesErrorItem x
-> OrganizationAffectedEntitiesErrorItem
$cfrom :: forall x.
OrganizationAffectedEntitiesErrorItem
-> Rep OrganizationAffectedEntitiesErrorItem x
Prelude.Generic)

-- |
-- Create a value of 'OrganizationAffectedEntitiesErrorItem' 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:
--
-- 'awsAccountId', 'organizationAffectedEntitiesErrorItem_awsAccountId' - The 12-digit AWS account numbers that contains the affected entities.
--
-- 'eventArn', 'organizationAffectedEntitiesErrorItem_eventArn' - The unique identifier for the event. The event ARN has the
-- @arn:aws:health:event-region::event\/SERVICE\/EVENT_TYPE_CODE\/EVENT_TYPE_PLUS_ID @
-- format.
--
-- For example, an event ARN might look like the following:
--
-- @arn:aws:health:us-east-1::event\/EC2\/EC2_INSTANCE_RETIREMENT_SCHEDULED\/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456@
--
-- 'errorName', 'organizationAffectedEntitiesErrorItem_errorName' - The name of the error.
--
-- 'errorMessage', 'organizationAffectedEntitiesErrorItem_errorMessage' - The unique identifier for the event type. The format is
-- @AWS_SERVICE_DESCRIPTION@. For example,
-- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
newOrganizationAffectedEntitiesErrorItem ::
  OrganizationAffectedEntitiesErrorItem
newOrganizationAffectedEntitiesErrorItem :: OrganizationAffectedEntitiesErrorItem
newOrganizationAffectedEntitiesErrorItem =
  OrganizationAffectedEntitiesErrorItem' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OrganizationAffectedEntitiesErrorItem
OrganizationAffectedEntitiesErrorItem'
    { $sel:awsAccountId:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
awsAccountId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventArn:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
eventArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorName:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
errorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The 12-digit AWS account numbers that contains the affected entities.
organizationAffectedEntitiesErrorItem_awsAccountId :: Lens.Lens' OrganizationAffectedEntitiesErrorItem (Prelude.Maybe Prelude.Text)
organizationAffectedEntitiesErrorItem_awsAccountId :: (Maybe Text -> f (Maybe Text))
-> OrganizationAffectedEntitiesErrorItem
-> f OrganizationAffectedEntitiesErrorItem
organizationAffectedEntitiesErrorItem_awsAccountId = (OrganizationAffectedEntitiesErrorItem -> Maybe Text)
-> (OrganizationAffectedEntitiesErrorItem
    -> Maybe Text -> OrganizationAffectedEntitiesErrorItem)
-> Lens
     OrganizationAffectedEntitiesErrorItem
     OrganizationAffectedEntitiesErrorItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationAffectedEntitiesErrorItem' {Maybe Text
awsAccountId :: Maybe Text
$sel:awsAccountId:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
awsAccountId} -> Maybe Text
awsAccountId) (\s :: OrganizationAffectedEntitiesErrorItem
s@OrganizationAffectedEntitiesErrorItem' {} Maybe Text
a -> OrganizationAffectedEntitiesErrorItem
s {$sel:awsAccountId:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
awsAccountId = Maybe Text
a} :: OrganizationAffectedEntitiesErrorItem)

-- | The unique identifier for the event. The event ARN has the
-- @arn:aws:health:event-region::event\/SERVICE\/EVENT_TYPE_CODE\/EVENT_TYPE_PLUS_ID @
-- format.
--
-- For example, an event ARN might look like the following:
--
-- @arn:aws:health:us-east-1::event\/EC2\/EC2_INSTANCE_RETIREMENT_SCHEDULED\/EC2_INSTANCE_RETIREMENT_SCHEDULED_ABC123-DEF456@
organizationAffectedEntitiesErrorItem_eventArn :: Lens.Lens' OrganizationAffectedEntitiesErrorItem (Prelude.Maybe Prelude.Text)
organizationAffectedEntitiesErrorItem_eventArn :: (Maybe Text -> f (Maybe Text))
-> OrganizationAffectedEntitiesErrorItem
-> f OrganizationAffectedEntitiesErrorItem
organizationAffectedEntitiesErrorItem_eventArn = (OrganizationAffectedEntitiesErrorItem -> Maybe Text)
-> (OrganizationAffectedEntitiesErrorItem
    -> Maybe Text -> OrganizationAffectedEntitiesErrorItem)
-> Lens
     OrganizationAffectedEntitiesErrorItem
     OrganizationAffectedEntitiesErrorItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationAffectedEntitiesErrorItem' {Maybe Text
eventArn :: Maybe Text
$sel:eventArn:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
eventArn} -> Maybe Text
eventArn) (\s :: OrganizationAffectedEntitiesErrorItem
s@OrganizationAffectedEntitiesErrorItem' {} Maybe Text
a -> OrganizationAffectedEntitiesErrorItem
s {$sel:eventArn:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
eventArn = Maybe Text
a} :: OrganizationAffectedEntitiesErrorItem)

-- | The name of the error.
organizationAffectedEntitiesErrorItem_errorName :: Lens.Lens' OrganizationAffectedEntitiesErrorItem (Prelude.Maybe Prelude.Text)
organizationAffectedEntitiesErrorItem_errorName :: (Maybe Text -> f (Maybe Text))
-> OrganizationAffectedEntitiesErrorItem
-> f OrganizationAffectedEntitiesErrorItem
organizationAffectedEntitiesErrorItem_errorName = (OrganizationAffectedEntitiesErrorItem -> Maybe Text)
-> (OrganizationAffectedEntitiesErrorItem
    -> Maybe Text -> OrganizationAffectedEntitiesErrorItem)
-> Lens
     OrganizationAffectedEntitiesErrorItem
     OrganizationAffectedEntitiesErrorItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationAffectedEntitiesErrorItem' {Maybe Text
errorName :: Maybe Text
$sel:errorName:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
errorName} -> Maybe Text
errorName) (\s :: OrganizationAffectedEntitiesErrorItem
s@OrganizationAffectedEntitiesErrorItem' {} Maybe Text
a -> OrganizationAffectedEntitiesErrorItem
s {$sel:errorName:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
errorName = Maybe Text
a} :: OrganizationAffectedEntitiesErrorItem)

-- | The unique identifier for the event type. The format is
-- @AWS_SERVICE_DESCRIPTION@. For example,
-- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
organizationAffectedEntitiesErrorItem_errorMessage :: Lens.Lens' OrganizationAffectedEntitiesErrorItem (Prelude.Maybe Prelude.Text)
organizationAffectedEntitiesErrorItem_errorMessage :: (Maybe Text -> f (Maybe Text))
-> OrganizationAffectedEntitiesErrorItem
-> f OrganizationAffectedEntitiesErrorItem
organizationAffectedEntitiesErrorItem_errorMessage = (OrganizationAffectedEntitiesErrorItem -> Maybe Text)
-> (OrganizationAffectedEntitiesErrorItem
    -> Maybe Text -> OrganizationAffectedEntitiesErrorItem)
-> Lens
     OrganizationAffectedEntitiesErrorItem
     OrganizationAffectedEntitiesErrorItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationAffectedEntitiesErrorItem' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: OrganizationAffectedEntitiesErrorItem
s@OrganizationAffectedEntitiesErrorItem' {} Maybe Text
a -> OrganizationAffectedEntitiesErrorItem
s {$sel:errorMessage:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
errorMessage = Maybe Text
a} :: OrganizationAffectedEntitiesErrorItem)

instance
  Core.FromJSON
    OrganizationAffectedEntitiesErrorItem
  where
  parseJSON :: Value -> Parser OrganizationAffectedEntitiesErrorItem
parseJSON =
    String
-> (Object -> Parser OrganizationAffectedEntitiesErrorItem)
-> Value
-> Parser OrganizationAffectedEntitiesErrorItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OrganizationAffectedEntitiesErrorItem"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OrganizationAffectedEntitiesErrorItem
OrganizationAffectedEntitiesErrorItem'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> OrganizationAffectedEntitiesErrorItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> OrganizationAffectedEntitiesErrorItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"awsAccountId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> OrganizationAffectedEntitiesErrorItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> OrganizationAffectedEntitiesErrorItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventArn")
            Parser
  (Maybe Text -> Maybe Text -> OrganizationAffectedEntitiesErrorItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> OrganizationAffectedEntitiesErrorItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorName")
            Parser (Maybe Text -> OrganizationAffectedEntitiesErrorItem)
-> Parser (Maybe Text)
-> Parser OrganizationAffectedEntitiesErrorItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorMessage")
      )

instance
  Prelude.Hashable
    OrganizationAffectedEntitiesErrorItem

instance
  Prelude.NFData
    OrganizationAffectedEntitiesErrorItem