{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Redshift.DescribeScheduledActions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes properties of scheduled actions.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeScheduledActions
  ( -- * Creating a Request
    DescribeScheduledActions (..),
    newDescribeScheduledActions,

    -- * Request Lenses
    describeScheduledActions_active,
    describeScheduledActions_endTime,
    describeScheduledActions_filters,
    describeScheduledActions_marker,
    describeScheduledActions_maxRecords,
    describeScheduledActions_scheduledActionName,
    describeScheduledActions_startTime,
    describeScheduledActions_targetActionType,

    -- * Destructuring the Response
    DescribeScheduledActionsResponse (..),
    newDescribeScheduledActionsResponse,

    -- * Response Lenses
    describeScheduledActionsResponse_marker,
    describeScheduledActionsResponse_scheduledActions,
    describeScheduledActionsResponse_httpStatus,
  )
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
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeScheduledActions' smart constructor.
data DescribeScheduledActions = DescribeScheduledActions'
  { -- | If true, retrieve only active scheduled actions. If false, retrieve only
    -- disabled scheduled actions.
    DescribeScheduledActions -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
    -- | The end time in UTC of the scheduled action to retrieve. Only active
    -- scheduled actions that have invocations before this time are retrieved.
    DescribeScheduledActions -> Maybe ISO8601
endTime :: Prelude.Maybe Data.ISO8601,
    -- | List of scheduled action filters.
    DescribeScheduledActions -> Maybe [ScheduledActionFilter]
filters :: Prelude.Maybe [ScheduledActionFilter],
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeScheduledActions
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    DescribeScheduledActions -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    --
    -- Default: @100@
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeScheduledActions -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The name of the scheduled action to retrieve.
    DescribeScheduledActions -> Maybe Text
scheduledActionName :: Prelude.Maybe Prelude.Text,
    -- | The start time in UTC of the scheduled actions to retrieve. Only active
    -- scheduled actions that have invocations after this time are retrieved.
    DescribeScheduledActions -> Maybe ISO8601
startTime :: Prelude.Maybe Data.ISO8601,
    -- | The type of the scheduled actions to retrieve.
    DescribeScheduledActions -> Maybe ScheduledActionTypeValues
targetActionType :: Prelude.Maybe ScheduledActionTypeValues
  }
  deriving (DescribeScheduledActions -> DescribeScheduledActions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScheduledActions -> DescribeScheduledActions -> Bool
$c/= :: DescribeScheduledActions -> DescribeScheduledActions -> Bool
== :: DescribeScheduledActions -> DescribeScheduledActions -> Bool
$c== :: DescribeScheduledActions -> DescribeScheduledActions -> Bool
Prelude.Eq, ReadPrec [DescribeScheduledActions]
ReadPrec DescribeScheduledActions
Int -> ReadS DescribeScheduledActions
ReadS [DescribeScheduledActions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScheduledActions]
$creadListPrec :: ReadPrec [DescribeScheduledActions]
readPrec :: ReadPrec DescribeScheduledActions
$creadPrec :: ReadPrec DescribeScheduledActions
readList :: ReadS [DescribeScheduledActions]
$creadList :: ReadS [DescribeScheduledActions]
readsPrec :: Int -> ReadS DescribeScheduledActions
$creadsPrec :: Int -> ReadS DescribeScheduledActions
Prelude.Read, Int -> DescribeScheduledActions -> ShowS
[DescribeScheduledActions] -> ShowS
DescribeScheduledActions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScheduledActions] -> ShowS
$cshowList :: [DescribeScheduledActions] -> ShowS
show :: DescribeScheduledActions -> String
$cshow :: DescribeScheduledActions -> String
showsPrec :: Int -> DescribeScheduledActions -> ShowS
$cshowsPrec :: Int -> DescribeScheduledActions -> ShowS
Prelude.Show, forall x.
Rep DescribeScheduledActions x -> DescribeScheduledActions
forall x.
DescribeScheduledActions -> Rep DescribeScheduledActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeScheduledActions x -> DescribeScheduledActions
$cfrom :: forall x.
DescribeScheduledActions -> Rep DescribeScheduledActions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScheduledActions' 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:
--
-- 'active', 'describeScheduledActions_active' - If true, retrieve only active scheduled actions. If false, retrieve only
-- disabled scheduled actions.
--
-- 'endTime', 'describeScheduledActions_endTime' - The end time in UTC of the scheduled action to retrieve. Only active
-- scheduled actions that have invocations before this time are retrieved.
--
-- 'filters', 'describeScheduledActions_filters' - List of scheduled action filters.
--
-- 'marker', 'describeScheduledActions_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeScheduledActions
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- 'maxRecords', 'describeScheduledActions_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
--
-- 'scheduledActionName', 'describeScheduledActions_scheduledActionName' - The name of the scheduled action to retrieve.
--
-- 'startTime', 'describeScheduledActions_startTime' - The start time in UTC of the scheduled actions to retrieve. Only active
-- scheduled actions that have invocations after this time are retrieved.
--
-- 'targetActionType', 'describeScheduledActions_targetActionType' - The type of the scheduled actions to retrieve.
newDescribeScheduledActions ::
  DescribeScheduledActions
newDescribeScheduledActions :: DescribeScheduledActions
newDescribeScheduledActions =
  DescribeScheduledActions'
    { $sel:active:DescribeScheduledActions' :: Maybe Bool
active = forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:DescribeScheduledActions' :: Maybe ISO8601
endTime = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeScheduledActions' :: Maybe [ScheduledActionFilter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeScheduledActions' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeScheduledActions' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:scheduledActionName:DescribeScheduledActions' :: Maybe Text
scheduledActionName = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:DescribeScheduledActions' :: Maybe ISO8601
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:targetActionType:DescribeScheduledActions' :: Maybe ScheduledActionTypeValues
targetActionType = forall a. Maybe a
Prelude.Nothing
    }

-- | If true, retrieve only active scheduled actions. If false, retrieve only
-- disabled scheduled actions.
describeScheduledActions_active :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe Prelude.Bool)
describeScheduledActions_active :: Lens' DescribeScheduledActions (Maybe Bool)
describeScheduledActions_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe Bool
active :: Maybe Bool
$sel:active:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Bool
active} -> Maybe Bool
active) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe Bool
a -> DescribeScheduledActions
s {$sel:active:DescribeScheduledActions' :: Maybe Bool
active = Maybe Bool
a} :: DescribeScheduledActions)

-- | The end time in UTC of the scheduled action to retrieve. Only active
-- scheduled actions that have invocations before this time are retrieved.
describeScheduledActions_endTime :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe Prelude.UTCTime)
describeScheduledActions_endTime :: Lens' DescribeScheduledActions (Maybe UTCTime)
describeScheduledActions_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe ISO8601
endTime :: Maybe ISO8601
$sel:endTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
endTime} -> Maybe ISO8601
endTime) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe ISO8601
a -> DescribeScheduledActions
s {$sel:endTime:DescribeScheduledActions' :: Maybe ISO8601
endTime = Maybe ISO8601
a} :: DescribeScheduledActions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | List of scheduled action filters.
describeScheduledActions_filters :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe [ScheduledActionFilter])
describeScheduledActions_filters :: Lens' DescribeScheduledActions (Maybe [ScheduledActionFilter])
describeScheduledActions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe [ScheduledActionFilter]
filters :: Maybe [ScheduledActionFilter]
$sel:filters:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe [ScheduledActionFilter]
filters} -> Maybe [ScheduledActionFilter]
filters) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe [ScheduledActionFilter]
a -> DescribeScheduledActions
s {$sel:filters:DescribeScheduledActions' :: Maybe [ScheduledActionFilter]
filters = Maybe [ScheduledActionFilter]
a} :: DescribeScheduledActions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeScheduledActions
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
describeScheduledActions_marker :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe Prelude.Text)
describeScheduledActions_marker :: Lens' DescribeScheduledActions (Maybe Text)
describeScheduledActions_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe Text
a -> DescribeScheduledActions
s {$sel:marker:DescribeScheduledActions' :: Maybe Text
marker = Maybe Text
a} :: DescribeScheduledActions)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
describeScheduledActions_maxRecords :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe Prelude.Int)
describeScheduledActions_maxRecords :: Lens' DescribeScheduledActions (Maybe Int)
describeScheduledActions_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe Int
a -> DescribeScheduledActions
s {$sel:maxRecords:DescribeScheduledActions' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeScheduledActions)

-- | The name of the scheduled action to retrieve.
describeScheduledActions_scheduledActionName :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe Prelude.Text)
describeScheduledActions_scheduledActionName :: Lens' DescribeScheduledActions (Maybe Text)
describeScheduledActions_scheduledActionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe Text
scheduledActionName :: Maybe Text
$sel:scheduledActionName:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
scheduledActionName} -> Maybe Text
scheduledActionName) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe Text
a -> DescribeScheduledActions
s {$sel:scheduledActionName:DescribeScheduledActions' :: Maybe Text
scheduledActionName = Maybe Text
a} :: DescribeScheduledActions)

-- | The start time in UTC of the scheduled actions to retrieve. Only active
-- scheduled actions that have invocations after this time are retrieved.
describeScheduledActions_startTime :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe Prelude.UTCTime)
describeScheduledActions_startTime :: Lens' DescribeScheduledActions (Maybe UTCTime)
describeScheduledActions_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe ISO8601
a -> DescribeScheduledActions
s {$sel:startTime:DescribeScheduledActions' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: DescribeScheduledActions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The type of the scheduled actions to retrieve.
describeScheduledActions_targetActionType :: Lens.Lens' DescribeScheduledActions (Prelude.Maybe ScheduledActionTypeValues)
describeScheduledActions_targetActionType :: Lens' DescribeScheduledActions (Maybe ScheduledActionTypeValues)
describeScheduledActions_targetActionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActions' {Maybe ScheduledActionTypeValues
targetActionType :: Maybe ScheduledActionTypeValues
$sel:targetActionType:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ScheduledActionTypeValues
targetActionType} -> Maybe ScheduledActionTypeValues
targetActionType) (\s :: DescribeScheduledActions
s@DescribeScheduledActions' {} Maybe ScheduledActionTypeValues
a -> DescribeScheduledActions
s {$sel:targetActionType:DescribeScheduledActions' :: Maybe ScheduledActionTypeValues
targetActionType = Maybe ScheduledActionTypeValues
a} :: DescribeScheduledActions)

instance Core.AWSPager DescribeScheduledActions where
  page :: DescribeScheduledActions
-> AWSResponse DescribeScheduledActions
-> Maybe DescribeScheduledActions
page DescribeScheduledActions
rq AWSResponse DescribeScheduledActions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeScheduledActions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScheduledActionsResponse (Maybe Text)
describeScheduledActionsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeScheduledActions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScheduledActionsResponse (Maybe [ScheduledAction])
describeScheduledActionsResponse_scheduledActions
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeScheduledActions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeScheduledActions (Maybe Text)
describeScheduledActions_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeScheduledActions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScheduledActionsResponse (Maybe Text)
describeScheduledActionsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeScheduledActions where
  type
    AWSResponse DescribeScheduledActions =
      DescribeScheduledActionsResponse
  request :: (Service -> Service)
-> DescribeScheduledActions -> Request DescribeScheduledActions
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeScheduledActions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeScheduledActions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeScheduledActionsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [ScheduledAction]
-> Int
-> DescribeScheduledActionsResponse
DescribeScheduledActionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ScheduledActions"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"ScheduledAction")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeScheduledActions where
  hashWithSalt :: Int -> DescribeScheduledActions -> Int
hashWithSalt Int
_salt DescribeScheduledActions' {Maybe Bool
Maybe Int
Maybe [ScheduledActionFilter]
Maybe Text
Maybe ISO8601
Maybe ScheduledActionTypeValues
targetActionType :: Maybe ScheduledActionTypeValues
startTime :: Maybe ISO8601
scheduledActionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [ScheduledActionFilter]
endTime :: Maybe ISO8601
active :: Maybe Bool
$sel:targetActionType:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ScheduledActionTypeValues
$sel:startTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
$sel:scheduledActionName:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
$sel:maxRecords:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Int
$sel:marker:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
$sel:filters:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe [ScheduledActionFilter]
$sel:endTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
$sel:active:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ScheduledActionFilter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduledActionName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScheduledActionTypeValues
targetActionType

instance Prelude.NFData DescribeScheduledActions where
  rnf :: DescribeScheduledActions -> ()
rnf DescribeScheduledActions' {Maybe Bool
Maybe Int
Maybe [ScheduledActionFilter]
Maybe Text
Maybe ISO8601
Maybe ScheduledActionTypeValues
targetActionType :: Maybe ScheduledActionTypeValues
startTime :: Maybe ISO8601
scheduledActionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [ScheduledActionFilter]
endTime :: Maybe ISO8601
active :: Maybe Bool
$sel:targetActionType:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ScheduledActionTypeValues
$sel:startTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
$sel:scheduledActionName:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
$sel:maxRecords:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Int
$sel:marker:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
$sel:filters:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe [ScheduledActionFilter]
$sel:endTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
$sel:active:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ScheduledActionFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduledActionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ScheduledActionTypeValues
targetActionType

instance Data.ToHeaders DescribeScheduledActions where
  toHeaders :: DescribeScheduledActions -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DescribeScheduledActions where
  toPath :: DescribeScheduledActions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeScheduledActions where
  toQuery :: DescribeScheduledActions -> QueryString
toQuery DescribeScheduledActions' {Maybe Bool
Maybe Int
Maybe [ScheduledActionFilter]
Maybe Text
Maybe ISO8601
Maybe ScheduledActionTypeValues
targetActionType :: Maybe ScheduledActionTypeValues
startTime :: Maybe ISO8601
scheduledActionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [ScheduledActionFilter]
endTime :: Maybe ISO8601
active :: Maybe Bool
$sel:targetActionType:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ScheduledActionTypeValues
$sel:startTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
$sel:scheduledActionName:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
$sel:maxRecords:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Int
$sel:marker:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Text
$sel:filters:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe [ScheduledActionFilter]
$sel:endTime:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe ISO8601
$sel:active:DescribeScheduledActions' :: DescribeScheduledActions -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeScheduledActions" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"Active" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
active,
        ByteString
"EndTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ISO8601
endTime,
        ByteString
"Filters"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"ScheduledActionFilter"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ScheduledActionFilter]
filters
            ),
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
        ByteString
"ScheduledActionName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
scheduledActionName,
        ByteString
"StartTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ISO8601
startTime,
        ByteString
"TargetActionType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ScheduledActionTypeValues
targetActionType
      ]

-- | /See:/ 'newDescribeScheduledActionsResponse' smart constructor.
data DescribeScheduledActionsResponse = DescribeScheduledActionsResponse'
  { -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeScheduledActions
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    DescribeScheduledActionsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | List of retrieved scheduled actions.
    DescribeScheduledActionsResponse -> Maybe [ScheduledAction]
scheduledActions :: Prelude.Maybe [ScheduledAction],
    -- | The response's http status code.
    DescribeScheduledActionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeScheduledActionsResponse
-> DescribeScheduledActionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScheduledActionsResponse
-> DescribeScheduledActionsResponse -> Bool
$c/= :: DescribeScheduledActionsResponse
-> DescribeScheduledActionsResponse -> Bool
== :: DescribeScheduledActionsResponse
-> DescribeScheduledActionsResponse -> Bool
$c== :: DescribeScheduledActionsResponse
-> DescribeScheduledActionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeScheduledActionsResponse]
ReadPrec DescribeScheduledActionsResponse
Int -> ReadS DescribeScheduledActionsResponse
ReadS [DescribeScheduledActionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScheduledActionsResponse]
$creadListPrec :: ReadPrec [DescribeScheduledActionsResponse]
readPrec :: ReadPrec DescribeScheduledActionsResponse
$creadPrec :: ReadPrec DescribeScheduledActionsResponse
readList :: ReadS [DescribeScheduledActionsResponse]
$creadList :: ReadS [DescribeScheduledActionsResponse]
readsPrec :: Int -> ReadS DescribeScheduledActionsResponse
$creadsPrec :: Int -> ReadS DescribeScheduledActionsResponse
Prelude.Read, Int -> DescribeScheduledActionsResponse -> ShowS
[DescribeScheduledActionsResponse] -> ShowS
DescribeScheduledActionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScheduledActionsResponse] -> ShowS
$cshowList :: [DescribeScheduledActionsResponse] -> ShowS
show :: DescribeScheduledActionsResponse -> String
$cshow :: DescribeScheduledActionsResponse -> String
showsPrec :: Int -> DescribeScheduledActionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeScheduledActionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeScheduledActionsResponse x
-> DescribeScheduledActionsResponse
forall x.
DescribeScheduledActionsResponse
-> Rep DescribeScheduledActionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeScheduledActionsResponse x
-> DescribeScheduledActionsResponse
$cfrom :: forall x.
DescribeScheduledActionsResponse
-> Rep DescribeScheduledActionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScheduledActionsResponse' 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:
--
-- 'marker', 'describeScheduledActionsResponse_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeScheduledActions
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- 'scheduledActions', 'describeScheduledActionsResponse_scheduledActions' - List of retrieved scheduled actions.
--
-- 'httpStatus', 'describeScheduledActionsResponse_httpStatus' - The response's http status code.
newDescribeScheduledActionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeScheduledActionsResponse
newDescribeScheduledActionsResponse :: Int -> DescribeScheduledActionsResponse
newDescribeScheduledActionsResponse Int
pHttpStatus_ =
  DescribeScheduledActionsResponse'
    { $sel:marker:DescribeScheduledActionsResponse' :: Maybe Text
marker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:scheduledActions:DescribeScheduledActionsResponse' :: Maybe [ScheduledAction]
scheduledActions = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeScheduledActionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeScheduledActions
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
describeScheduledActionsResponse_marker :: Lens.Lens' DescribeScheduledActionsResponse (Prelude.Maybe Prelude.Text)
describeScheduledActionsResponse_marker :: Lens' DescribeScheduledActionsResponse (Maybe Text)
describeScheduledActionsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActionsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeScheduledActionsResponse' :: DescribeScheduledActionsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeScheduledActionsResponse
s@DescribeScheduledActionsResponse' {} Maybe Text
a -> DescribeScheduledActionsResponse
s {$sel:marker:DescribeScheduledActionsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeScheduledActionsResponse)

-- | List of retrieved scheduled actions.
describeScheduledActionsResponse_scheduledActions :: Lens.Lens' DescribeScheduledActionsResponse (Prelude.Maybe [ScheduledAction])
describeScheduledActionsResponse_scheduledActions :: Lens' DescribeScheduledActionsResponse (Maybe [ScheduledAction])
describeScheduledActionsResponse_scheduledActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActionsResponse' {Maybe [ScheduledAction]
scheduledActions :: Maybe [ScheduledAction]
$sel:scheduledActions:DescribeScheduledActionsResponse' :: DescribeScheduledActionsResponse -> Maybe [ScheduledAction]
scheduledActions} -> Maybe [ScheduledAction]
scheduledActions) (\s :: DescribeScheduledActionsResponse
s@DescribeScheduledActionsResponse' {} Maybe [ScheduledAction]
a -> DescribeScheduledActionsResponse
s {$sel:scheduledActions:DescribeScheduledActionsResponse' :: Maybe [ScheduledAction]
scheduledActions = Maybe [ScheduledAction]
a} :: DescribeScheduledActionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeScheduledActionsResponse_httpStatus :: Lens.Lens' DescribeScheduledActionsResponse Prelude.Int
describeScheduledActionsResponse_httpStatus :: Lens' DescribeScheduledActionsResponse Int
describeScheduledActionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScheduledActionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeScheduledActionsResponse' :: DescribeScheduledActionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeScheduledActionsResponse
s@DescribeScheduledActionsResponse' {} Int
a -> DescribeScheduledActionsResponse
s {$sel:httpStatus:DescribeScheduledActionsResponse' :: Int
httpStatus = Int
a} :: DescribeScheduledActionsResponse)

instance
  Prelude.NFData
    DescribeScheduledActionsResponse
  where
  rnf :: DescribeScheduledActionsResponse -> ()
rnf DescribeScheduledActionsResponse' {Int
Maybe [ScheduledAction]
Maybe Text
httpStatus :: Int
scheduledActions :: Maybe [ScheduledAction]
marker :: Maybe Text
$sel:httpStatus:DescribeScheduledActionsResponse' :: DescribeScheduledActionsResponse -> Int
$sel:scheduledActions:DescribeScheduledActionsResponse' :: DescribeScheduledActionsResponse -> Maybe [ScheduledAction]
$sel:marker:DescribeScheduledActionsResponse' :: DescribeScheduledActionsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ScheduledAction]
scheduledActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus