{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AWSHealth.Types.OrganizationAffectedEntitiesErrorItem 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

-- | 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 Amazon Web Services account numbers that contains the
    -- affected entities.
    OrganizationAffectedEntitiesErrorItem -> Maybe Text
awsAccountId :: 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,
    -- | The name of the error.
    OrganizationAffectedEntitiesErrorItem -> Maybe Text
errorName :: 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
  }
  deriving (OrganizationAffectedEntitiesErrorItem
-> OrganizationAffectedEntitiesErrorItem -> Bool
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]
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
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.
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 Amazon Web Services account numbers that contains the
-- affected entities.
--
-- 'errorMessage', 'organizationAffectedEntitiesErrorItem_errorMessage' - The unique identifier for the event type. The format is
-- @AWS_SERVICE_DESCRIPTION@. For example,
-- @AWS_EC2_SYSTEM_MAINTENANCE_EVENT@.
--
-- 'errorName', 'organizationAffectedEntitiesErrorItem_errorName' - The name of the error.
--
-- '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@
newOrganizationAffectedEntitiesErrorItem ::
  OrganizationAffectedEntitiesErrorItem
newOrganizationAffectedEntitiesErrorItem :: OrganizationAffectedEntitiesErrorItem
newOrganizationAffectedEntitiesErrorItem =
  OrganizationAffectedEntitiesErrorItem'
    { $sel:awsAccountId:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
awsAccountId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:errorName:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
errorName = forall a. Maybe a
Prelude.Nothing,
      $sel:eventArn:OrganizationAffectedEntitiesErrorItem' :: Maybe Text
eventArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The 12-digit Amazon Web Services account numbers that contains the
-- affected entities.
organizationAffectedEntitiesErrorItem_awsAccountId :: Lens.Lens' OrganizationAffectedEntitiesErrorItem (Prelude.Maybe Prelude.Text)
organizationAffectedEntitiesErrorItem_awsAccountId :: Lens' OrganizationAffectedEntitiesErrorItem (Maybe Text)
organizationAffectedEntitiesErrorItem_awsAccountId = 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 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 :: Lens' OrganizationAffectedEntitiesErrorItem (Maybe Text)
organizationAffectedEntitiesErrorItem_errorMessage = 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)

-- | The name of the error.
organizationAffectedEntitiesErrorItem_errorName :: Lens.Lens' OrganizationAffectedEntitiesErrorItem (Prelude.Maybe Prelude.Text)
organizationAffectedEntitiesErrorItem_errorName :: Lens' OrganizationAffectedEntitiesErrorItem (Maybe Text)
organizationAffectedEntitiesErrorItem_errorName = 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. 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 :: Lens' OrganizationAffectedEntitiesErrorItem (Maybe Text)
organizationAffectedEntitiesErrorItem_eventArn = 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)

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

instance
  Prelude.Hashable
    OrganizationAffectedEntitiesErrorItem
  where
  hashWithSalt :: Int -> OrganizationAffectedEntitiesErrorItem -> Int
hashWithSalt
    Int
_salt
    OrganizationAffectedEntitiesErrorItem' {Maybe Text
eventArn :: Maybe Text
errorName :: Maybe Text
errorMessage :: Maybe Text
awsAccountId :: Maybe Text
$sel:eventArn:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
$sel:errorName:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
$sel:errorMessage:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
$sel:awsAccountId:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
awsAccountId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventArn

instance
  Prelude.NFData
    OrganizationAffectedEntitiesErrorItem
  where
  rnf :: OrganizationAffectedEntitiesErrorItem -> ()
rnf OrganizationAffectedEntitiesErrorItem' {Maybe Text
eventArn :: Maybe Text
errorName :: Maybe Text
errorMessage :: Maybe Text
awsAccountId :: Maybe Text
$sel:eventArn:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
$sel:errorName:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
$sel:errorMessage:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
$sel:awsAccountId:OrganizationAffectedEntitiesErrorItem' :: OrganizationAffectedEntitiesErrorItem -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
awsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventArn