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

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

-- | Details from a successful operation
--
-- /See:/ 'newBatchSuccessfulResultModel' smart constructor.
data BatchSuccessfulResultModel = BatchSuccessfulResultModel'
  { -- | Current state of the resource
    BatchSuccessfulResultModel -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | ARN of the resource
    BatchSuccessfulResultModel -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | ID of the resource
    BatchSuccessfulResultModel -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchSuccessfulResultModel -> BatchSuccessfulResultModel -> Bool
(BatchSuccessfulResultModel -> BatchSuccessfulResultModel -> Bool)
-> (BatchSuccessfulResultModel
    -> BatchSuccessfulResultModel -> Bool)
-> Eq BatchSuccessfulResultModel
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]
(Int -> ReadS BatchSuccessfulResultModel)
-> ReadS [BatchSuccessfulResultModel]
-> ReadPrec BatchSuccessfulResultModel
-> ReadPrec [BatchSuccessfulResultModel]
-> Read 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
(Int -> BatchSuccessfulResultModel -> ShowS)
-> (BatchSuccessfulResultModel -> String)
-> ([BatchSuccessfulResultModel] -> ShowS)
-> Show BatchSuccessfulResultModel
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.
 BatchSuccessfulResultModel -> Rep BatchSuccessfulResultModel x)
-> (forall x.
    Rep BatchSuccessfulResultModel x -> BatchSuccessfulResultModel)
-> Generic BatchSuccessfulResultModel
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:
--
-- 'state', 'batchSuccessfulResultModel_state' - Current state of the resource
--
-- 'arn', 'batchSuccessfulResultModel_arn' - ARN of the resource
--
-- 'id', 'batchSuccessfulResultModel_id' - ID of the resource
newBatchSuccessfulResultModel ::
  BatchSuccessfulResultModel
newBatchSuccessfulResultModel :: BatchSuccessfulResultModel
newBatchSuccessfulResultModel =
  BatchSuccessfulResultModel' :: Maybe Text
-> Maybe Text -> Maybe Text -> BatchSuccessfulResultModel
BatchSuccessfulResultModel'
    { $sel:state:BatchSuccessfulResultModel' :: Maybe Text
state =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:BatchSuccessfulResultModel' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:BatchSuccessfulResultModel' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Current state of the resource
batchSuccessfulResultModel_state :: Lens.Lens' BatchSuccessfulResultModel (Prelude.Maybe Prelude.Text)
batchSuccessfulResultModel_state :: (Maybe Text -> f (Maybe Text))
-> BatchSuccessfulResultModel -> f BatchSuccessfulResultModel
batchSuccessfulResultModel_state = (BatchSuccessfulResultModel -> Maybe Text)
-> (BatchSuccessfulResultModel
    -> Maybe Text -> BatchSuccessfulResultModel)
-> Lens
     BatchSuccessfulResultModel
     BatchSuccessfulResultModel
     (Maybe Text)
     (Maybe Text)
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)

-- | ARN of the resource
batchSuccessfulResultModel_arn :: Lens.Lens' BatchSuccessfulResultModel (Prelude.Maybe Prelude.Text)
batchSuccessfulResultModel_arn :: (Maybe Text -> f (Maybe Text))
-> BatchSuccessfulResultModel -> f BatchSuccessfulResultModel
batchSuccessfulResultModel_arn = (BatchSuccessfulResultModel -> Maybe Text)
-> (BatchSuccessfulResultModel
    -> Maybe Text -> BatchSuccessfulResultModel)
-> Lens
     BatchSuccessfulResultModel
     BatchSuccessfulResultModel
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> BatchSuccessfulResultModel -> f BatchSuccessfulResultModel
batchSuccessfulResultModel_id = (BatchSuccessfulResultModel -> Maybe Text)
-> (BatchSuccessfulResultModel
    -> Maybe Text -> BatchSuccessfulResultModel)
-> Lens
     BatchSuccessfulResultModel
     BatchSuccessfulResultModel
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.Hashable BatchSuccessfulResultModel

instance Prelude.NFData BatchSuccessfulResultModel