{-# 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.BatchScheduleActionCreateRequest
-- 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.BatchScheduleActionCreateRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.ScheduleAction
import qualified Amazonka.Prelude as Prelude

-- | A list of schedule actions to create (in a request) or that have been
-- created (in a response).
--
-- /See:/ 'newBatchScheduleActionCreateRequest' smart constructor.
data BatchScheduleActionCreateRequest = BatchScheduleActionCreateRequest'
  { -- | A list of schedule actions to create.
    BatchScheduleActionCreateRequest -> [ScheduleAction]
scheduleActions :: [ScheduleAction]
  }
  deriving (BatchScheduleActionCreateRequest
-> BatchScheduleActionCreateRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchScheduleActionCreateRequest
-> BatchScheduleActionCreateRequest -> Bool
$c/= :: BatchScheduleActionCreateRequest
-> BatchScheduleActionCreateRequest -> Bool
== :: BatchScheduleActionCreateRequest
-> BatchScheduleActionCreateRequest -> Bool
$c== :: BatchScheduleActionCreateRequest
-> BatchScheduleActionCreateRequest -> Bool
Prelude.Eq, ReadPrec [BatchScheduleActionCreateRequest]
ReadPrec BatchScheduleActionCreateRequest
Int -> ReadS BatchScheduleActionCreateRequest
ReadS [BatchScheduleActionCreateRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchScheduleActionCreateRequest]
$creadListPrec :: ReadPrec [BatchScheduleActionCreateRequest]
readPrec :: ReadPrec BatchScheduleActionCreateRequest
$creadPrec :: ReadPrec BatchScheduleActionCreateRequest
readList :: ReadS [BatchScheduleActionCreateRequest]
$creadList :: ReadS [BatchScheduleActionCreateRequest]
readsPrec :: Int -> ReadS BatchScheduleActionCreateRequest
$creadsPrec :: Int -> ReadS BatchScheduleActionCreateRequest
Prelude.Read, Int -> BatchScheduleActionCreateRequest -> ShowS
[BatchScheduleActionCreateRequest] -> ShowS
BatchScheduleActionCreateRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchScheduleActionCreateRequest] -> ShowS
$cshowList :: [BatchScheduleActionCreateRequest] -> ShowS
show :: BatchScheduleActionCreateRequest -> String
$cshow :: BatchScheduleActionCreateRequest -> String
showsPrec :: Int -> BatchScheduleActionCreateRequest -> ShowS
$cshowsPrec :: Int -> BatchScheduleActionCreateRequest -> ShowS
Prelude.Show, forall x.
Rep BatchScheduleActionCreateRequest x
-> BatchScheduleActionCreateRequest
forall x.
BatchScheduleActionCreateRequest
-> Rep BatchScheduleActionCreateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchScheduleActionCreateRequest x
-> BatchScheduleActionCreateRequest
$cfrom :: forall x.
BatchScheduleActionCreateRequest
-> Rep BatchScheduleActionCreateRequest x
Prelude.Generic)

-- |
-- Create a value of 'BatchScheduleActionCreateRequest' 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:
--
-- 'scheduleActions', 'batchScheduleActionCreateRequest_scheduleActions' - A list of schedule actions to create.
newBatchScheduleActionCreateRequest ::
  BatchScheduleActionCreateRequest
newBatchScheduleActionCreateRequest :: BatchScheduleActionCreateRequest
newBatchScheduleActionCreateRequest =
  BatchScheduleActionCreateRequest'
    { $sel:scheduleActions:BatchScheduleActionCreateRequest' :: [ScheduleAction]
scheduleActions =
        forall a. Monoid a => a
Prelude.mempty
    }

-- | A list of schedule actions to create.
batchScheduleActionCreateRequest_scheduleActions :: Lens.Lens' BatchScheduleActionCreateRequest [ScheduleAction]
batchScheduleActionCreateRequest_scheduleActions :: Lens' BatchScheduleActionCreateRequest [ScheduleAction]
batchScheduleActionCreateRequest_scheduleActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchScheduleActionCreateRequest' {[ScheduleAction]
scheduleActions :: [ScheduleAction]
$sel:scheduleActions:BatchScheduleActionCreateRequest' :: BatchScheduleActionCreateRequest -> [ScheduleAction]
scheduleActions} -> [ScheduleAction]
scheduleActions) (\s :: BatchScheduleActionCreateRequest
s@BatchScheduleActionCreateRequest' {} [ScheduleAction]
a -> BatchScheduleActionCreateRequest
s {$sel:scheduleActions:BatchScheduleActionCreateRequest' :: [ScheduleAction]
scheduleActions = [ScheduleAction]
a} :: BatchScheduleActionCreateRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.Hashable
    BatchScheduleActionCreateRequest
  where
  hashWithSalt :: Int -> BatchScheduleActionCreateRequest -> Int
hashWithSalt
    Int
_salt
    BatchScheduleActionCreateRequest' {[ScheduleAction]
scheduleActions :: [ScheduleAction]
$sel:scheduleActions:BatchScheduleActionCreateRequest' :: BatchScheduleActionCreateRequest -> [ScheduleAction]
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [ScheduleAction]
scheduleActions

instance
  Prelude.NFData
    BatchScheduleActionCreateRequest
  where
  rnf :: BatchScheduleActionCreateRequest -> ()
rnf BatchScheduleActionCreateRequest' {[ScheduleAction]
scheduleActions :: [ScheduleAction]
$sel:scheduleActions:BatchScheduleActionCreateRequest' :: BatchScheduleActionCreateRequest -> [ScheduleAction]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf [ScheduleAction]
scheduleActions

instance Data.ToJSON BatchScheduleActionCreateRequest where
  toJSON :: BatchScheduleActionCreateRequest -> Value
toJSON BatchScheduleActionCreateRequest' {[ScheduleAction]
scheduleActions :: [ScheduleAction]
$sel:scheduleActions:BatchScheduleActionCreateRequest' :: BatchScheduleActionCreateRequest -> [ScheduleAction]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"scheduleActions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [ScheduleAction]
scheduleActions)
          ]
      )