{-# 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.MediaLive.Types.BatchSuccessfulResultModel
-- 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.MediaLive.Types.BatchSuccessfulResultModel 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

-- | Details from a successful operation
--
-- /See:/ 'newBatchSuccessfulResultModel' smart constructor.
data BatchSuccessfulResultModel = BatchSuccessfulResultModel'
  { -- | ARN of the resource
    BatchSuccessfulResultModel -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | ID of the resource
    BatchSuccessfulResultModel -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Current state of the resource
    BatchSuccessfulResultModel -> Maybe Text
state :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchSuccessfulResultModel -> BatchSuccessfulResultModel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchSuccessfulResultModel -> BatchSuccessfulResultModel -> Bool
$c/= :: BatchSuccessfulResultModel -> BatchSuccessfulResultModel -> Bool
== :: BatchSuccessfulResultModel -> BatchSuccessfulResultModel -> Bool
$c== :: BatchSuccessfulResultModel -> BatchSuccessfulResultModel -> Bool
Prelude.Eq, ReadPrec [BatchSuccessfulResultModel]
ReadPrec BatchSuccessfulResultModel
Int -> ReadS BatchSuccessfulResultModel
ReadS [BatchSuccessfulResultModel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchSuccessfulResultModel]
$creadListPrec :: ReadPrec [BatchSuccessfulResultModel]
readPrec :: ReadPrec BatchSuccessfulResultModel
$creadPrec :: ReadPrec BatchSuccessfulResultModel
readList :: ReadS [BatchSuccessfulResultModel]
$creadList :: ReadS [BatchSuccessfulResultModel]
readsPrec :: Int -> ReadS BatchSuccessfulResultModel
$creadsPrec :: Int -> ReadS BatchSuccessfulResultModel
Prelude.Read, Int -> BatchSuccessfulResultModel -> ShowS
[BatchSuccessfulResultModel] -> ShowS
BatchSuccessfulResultModel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchSuccessfulResultModel] -> ShowS
$cshowList :: [BatchSuccessfulResultModel] -> ShowS
show :: BatchSuccessfulResultModel -> String
$cshow :: BatchSuccessfulResultModel -> String
showsPrec :: Int -> BatchSuccessfulResultModel -> ShowS
$cshowsPrec :: Int -> BatchSuccessfulResultModel -> ShowS
Prelude.Show, forall x.
Rep BatchSuccessfulResultModel x -> BatchSuccessfulResultModel
forall x.
BatchSuccessfulResultModel -> Rep BatchSuccessfulResultModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchSuccessfulResultModel x -> BatchSuccessfulResultModel
$cfrom :: forall x.
BatchSuccessfulResultModel -> Rep BatchSuccessfulResultModel x
Prelude.Generic)

-- |
-- Create a value of 'BatchSuccessfulResultModel' 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:
--
-- 'arn', 'batchSuccessfulResultModel_arn' - ARN of the resource
--
-- 'id', 'batchSuccessfulResultModel_id' - ID of the resource
--
-- 'state', 'batchSuccessfulResultModel_state' - Current state of the resource
newBatchSuccessfulResultModel ::
  BatchSuccessfulResultModel
newBatchSuccessfulResultModel :: BatchSuccessfulResultModel
newBatchSuccessfulResultModel =
  BatchSuccessfulResultModel'
    { $sel:arn:BatchSuccessfulResultModel' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:BatchSuccessfulResultModel' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:state:BatchSuccessfulResultModel' :: Maybe Text
state = forall a. Maybe a
Prelude.Nothing
    }

-- | ARN of the resource
batchSuccessfulResultModel_arn :: Lens.Lens' BatchSuccessfulResultModel (Prelude.Maybe Prelude.Text)
batchSuccessfulResultModel_arn :: Lens' BatchSuccessfulResultModel (Maybe Text)
batchSuccessfulResultModel_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSuccessfulResultModel' {Maybe Text
arn :: Maybe Text
$sel:arn:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
arn} -> Maybe Text
arn) (\s :: BatchSuccessfulResultModel
s@BatchSuccessfulResultModel' {} Maybe Text
a -> BatchSuccessfulResultModel
s {$sel:arn:BatchSuccessfulResultModel' :: Maybe Text
arn = Maybe Text
a} :: BatchSuccessfulResultModel)

-- | ID of the resource
batchSuccessfulResultModel_id :: Lens.Lens' BatchSuccessfulResultModel (Prelude.Maybe Prelude.Text)
batchSuccessfulResultModel_id :: Lens' BatchSuccessfulResultModel (Maybe Text)
batchSuccessfulResultModel_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSuccessfulResultModel' {Maybe Text
id :: Maybe Text
$sel:id:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
id} -> Maybe Text
id) (\s :: BatchSuccessfulResultModel
s@BatchSuccessfulResultModel' {} Maybe Text
a -> BatchSuccessfulResultModel
s {$sel:id:BatchSuccessfulResultModel' :: Maybe Text
id = Maybe Text
a} :: BatchSuccessfulResultModel)

-- | Current state of the resource
batchSuccessfulResultModel_state :: Lens.Lens' BatchSuccessfulResultModel (Prelude.Maybe Prelude.Text)
batchSuccessfulResultModel_state :: Lens' BatchSuccessfulResultModel (Maybe Text)
batchSuccessfulResultModel_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSuccessfulResultModel' {Maybe Text
state :: Maybe Text
$sel:state:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
state} -> Maybe Text
state) (\s :: BatchSuccessfulResultModel
s@BatchSuccessfulResultModel' {} Maybe Text
a -> BatchSuccessfulResultModel
s {$sel:state:BatchSuccessfulResultModel' :: Maybe Text
state = Maybe Text
a} :: BatchSuccessfulResultModel)

instance Data.FromJSON BatchSuccessfulResultModel where
  parseJSON :: Value -> Parser BatchSuccessfulResultModel
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchSuccessfulResultModel"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> BatchSuccessfulResultModel
BatchSuccessfulResultModel'
            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
"arn")
            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
"id")
            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
"state")
      )

instance Prelude.Hashable BatchSuccessfulResultModel where
  hashWithSalt :: Int -> BatchSuccessfulResultModel -> Int
hashWithSalt Int
_salt BatchSuccessfulResultModel' {Maybe Text
state :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:state:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
$sel:id:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
$sel:arn:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
state

instance Prelude.NFData BatchSuccessfulResultModel where
  rnf :: BatchSuccessfulResultModel -> ()
rnf BatchSuccessfulResultModel' {Maybe Text
state :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:state:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
$sel:id:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
$sel:arn:BatchSuccessfulResultModel' :: BatchSuccessfulResultModel -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
state