{-# 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.EC2.DescribeInstanceEventWindows
-- 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 the specified event windows or all event windows.
--
-- If you specify event window IDs, the output includes information for
-- only the specified event windows. If you specify filters, the output
-- includes information for only those event windows that meet the filter
-- criteria. If you do not specify event windows IDs or filters, the output
-- includes information for all event windows, which can affect
-- performance. We recommend that you use pagination to ensure that the
-- operation returns quickly and successfully.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html Define event windows for scheduled events>
-- in the /Amazon EC2 User Guide/.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeInstanceEventWindows
  ( -- * Creating a Request
    DescribeInstanceEventWindows (..),
    newDescribeInstanceEventWindows,

    -- * Request Lenses
    describeInstanceEventWindows_dryRun,
    describeInstanceEventWindows_filters,
    describeInstanceEventWindows_instanceEventWindowIds,
    describeInstanceEventWindows_maxResults,
    describeInstanceEventWindows_nextToken,

    -- * Destructuring the Response
    DescribeInstanceEventWindowsResponse (..),
    newDescribeInstanceEventWindowsResponse,

    -- * Response Lenses
    describeInstanceEventWindowsResponse_instanceEventWindows,
    describeInstanceEventWindowsResponse_nextToken,
    describeInstanceEventWindowsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Describe instance event windows by InstanceEventWindow.
--
-- /See:/ 'newDescribeInstanceEventWindows' smart constructor.
data DescribeInstanceEventWindows = DescribeInstanceEventWindows'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribeInstanceEventWindows -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @dedicated-host-id@ - The event windows associated with the
    --     specified Dedicated Host ID.
    --
    -- -   @event-window-name@ - The event windows associated with the
    --     specified names.
    --
    -- -   @instance-id@ - The event windows associated with the specified
    --     instance ID.
    --
    -- -   @instance-tag@ - The event windows associated with the specified tag
    --     and value.
    --
    -- -   @instance-tag-key@ - The event windows associated with the specified
    --     tag key, regardless of the value.
    --
    -- -   @instance-tag-value@ - The event windows associated with the
    --     specified tag value, regardless of the key.
    --
    -- -   @tag:\<key>@ - The key\/value combination of a tag assigned to the
    --     event window. Use the tag key in the filter name and the tag value
    --     as the filter value. For example, to find all resources that have a
    --     tag with the key @Owner@ and the value @CMX@, specify @tag:Owner@
    --     for the filter name and @CMX@ for the filter value.
    --
    -- -   @tag-key@ - The key of a tag assigned to the event window. Use this
    --     filter to find all event windows that have a tag with a specific
    --     key, regardless of the tag value.
    --
    -- -   @tag-value@ - The value of a tag assigned to the event window. Use
    --     this filter to find all event windows that have a tag with a
    --     specific value, regardless of the tag key.
    DescribeInstanceEventWindows -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The IDs of the event windows.
    DescribeInstanceEventWindows -> Maybe [Text]
instanceEventWindowIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return in a single call. To retrieve
    -- the remaining results, make another call with the returned @NextToken@
    -- value. This value can be between 20 and 500. You cannot specify this
    -- parameter and the event window IDs parameter in the same call.
    DescribeInstanceEventWindows -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to request the next page of results.
    DescribeInstanceEventWindows -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeInstanceEventWindows
-> DescribeInstanceEventWindows -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstanceEventWindows
-> DescribeInstanceEventWindows -> Bool
$c/= :: DescribeInstanceEventWindows
-> DescribeInstanceEventWindows -> Bool
== :: DescribeInstanceEventWindows
-> DescribeInstanceEventWindows -> Bool
$c== :: DescribeInstanceEventWindows
-> DescribeInstanceEventWindows -> Bool
Prelude.Eq, ReadPrec [DescribeInstanceEventWindows]
ReadPrec DescribeInstanceEventWindows
Int -> ReadS DescribeInstanceEventWindows
ReadS [DescribeInstanceEventWindows]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstanceEventWindows]
$creadListPrec :: ReadPrec [DescribeInstanceEventWindows]
readPrec :: ReadPrec DescribeInstanceEventWindows
$creadPrec :: ReadPrec DescribeInstanceEventWindows
readList :: ReadS [DescribeInstanceEventWindows]
$creadList :: ReadS [DescribeInstanceEventWindows]
readsPrec :: Int -> ReadS DescribeInstanceEventWindows
$creadsPrec :: Int -> ReadS DescribeInstanceEventWindows
Prelude.Read, Int -> DescribeInstanceEventWindows -> ShowS
[DescribeInstanceEventWindows] -> ShowS
DescribeInstanceEventWindows -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstanceEventWindows] -> ShowS
$cshowList :: [DescribeInstanceEventWindows] -> ShowS
show :: DescribeInstanceEventWindows -> String
$cshow :: DescribeInstanceEventWindows -> String
showsPrec :: Int -> DescribeInstanceEventWindows -> ShowS
$cshowsPrec :: Int -> DescribeInstanceEventWindows -> ShowS
Prelude.Show, forall x.
Rep DescribeInstanceEventWindows x -> DescribeInstanceEventWindows
forall x.
DescribeInstanceEventWindows -> Rep DescribeInstanceEventWindows x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstanceEventWindows x -> DescribeInstanceEventWindows
$cfrom :: forall x.
DescribeInstanceEventWindows -> Rep DescribeInstanceEventWindows x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstanceEventWindows' 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:
--
-- 'dryRun', 'describeInstanceEventWindows_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeInstanceEventWindows_filters' - One or more filters.
--
-- -   @dedicated-host-id@ - The event windows associated with the
--     specified Dedicated Host ID.
--
-- -   @event-window-name@ - The event windows associated with the
--     specified names.
--
-- -   @instance-id@ - The event windows associated with the specified
--     instance ID.
--
-- -   @instance-tag@ - The event windows associated with the specified tag
--     and value.
--
-- -   @instance-tag-key@ - The event windows associated with the specified
--     tag key, regardless of the value.
--
-- -   @instance-tag-value@ - The event windows associated with the
--     specified tag value, regardless of the key.
--
-- -   @tag:\<key>@ - The key\/value combination of a tag assigned to the
--     event window. Use the tag key in the filter name and the tag value
--     as the filter value. For example, to find all resources that have a
--     tag with the key @Owner@ and the value @CMX@, specify @tag:Owner@
--     for the filter name and @CMX@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the event window. Use this
--     filter to find all event windows that have a tag with a specific
--     key, regardless of the tag value.
--
-- -   @tag-value@ - The value of a tag assigned to the event window. Use
--     this filter to find all event windows that have a tag with a
--     specific value, regardless of the tag key.
--
-- 'instanceEventWindowIds', 'describeInstanceEventWindows_instanceEventWindowIds' - The IDs of the event windows.
--
-- 'maxResults', 'describeInstanceEventWindows_maxResults' - The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned @NextToken@
-- value. This value can be between 20 and 500. You cannot specify this
-- parameter and the event window IDs parameter in the same call.
--
-- 'nextToken', 'describeInstanceEventWindows_nextToken' - The token to request the next page of results.
newDescribeInstanceEventWindows ::
  DescribeInstanceEventWindows
newDescribeInstanceEventWindows :: DescribeInstanceEventWindows
newDescribeInstanceEventWindows =
  DescribeInstanceEventWindows'
    { $sel:dryRun:DescribeInstanceEventWindows' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeInstanceEventWindows' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceEventWindowIds:DescribeInstanceEventWindows' :: Maybe [Text]
instanceEventWindowIds = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeInstanceEventWindows' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstanceEventWindows' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeInstanceEventWindows_dryRun :: Lens.Lens' DescribeInstanceEventWindows (Prelude.Maybe Prelude.Bool)
describeInstanceEventWindows_dryRun :: Lens' DescribeInstanceEventWindows (Maybe Bool)
describeInstanceEventWindows_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceEventWindows' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeInstanceEventWindows
s@DescribeInstanceEventWindows' {} Maybe Bool
a -> DescribeInstanceEventWindows
s {$sel:dryRun:DescribeInstanceEventWindows' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeInstanceEventWindows)

-- | One or more filters.
--
-- -   @dedicated-host-id@ - The event windows associated with the
--     specified Dedicated Host ID.
--
-- -   @event-window-name@ - The event windows associated with the
--     specified names.
--
-- -   @instance-id@ - The event windows associated with the specified
--     instance ID.
--
-- -   @instance-tag@ - The event windows associated with the specified tag
--     and value.
--
-- -   @instance-tag-key@ - The event windows associated with the specified
--     tag key, regardless of the value.
--
-- -   @instance-tag-value@ - The event windows associated with the
--     specified tag value, regardless of the key.
--
-- -   @tag:\<key>@ - The key\/value combination of a tag assigned to the
--     event window. Use the tag key in the filter name and the tag value
--     as the filter value. For example, to find all resources that have a
--     tag with the key @Owner@ and the value @CMX@, specify @tag:Owner@
--     for the filter name and @CMX@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the event window. Use this
--     filter to find all event windows that have a tag with a specific
--     key, regardless of the tag value.
--
-- -   @tag-value@ - The value of a tag assigned to the event window. Use
--     this filter to find all event windows that have a tag with a
--     specific value, regardless of the tag key.
describeInstanceEventWindows_filters :: Lens.Lens' DescribeInstanceEventWindows (Prelude.Maybe [Filter])
describeInstanceEventWindows_filters :: Lens' DescribeInstanceEventWindows (Maybe [Filter])
describeInstanceEventWindows_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceEventWindows' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeInstanceEventWindows
s@DescribeInstanceEventWindows' {} Maybe [Filter]
a -> DescribeInstanceEventWindows
s {$sel:filters:DescribeInstanceEventWindows' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeInstanceEventWindows) 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 IDs of the event windows.
describeInstanceEventWindows_instanceEventWindowIds :: Lens.Lens' DescribeInstanceEventWindows (Prelude.Maybe [Prelude.Text])
describeInstanceEventWindows_instanceEventWindowIds :: Lens' DescribeInstanceEventWindows (Maybe [Text])
describeInstanceEventWindows_instanceEventWindowIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceEventWindows' {Maybe [Text]
instanceEventWindowIds :: Maybe [Text]
$sel:instanceEventWindowIds:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Text]
instanceEventWindowIds} -> Maybe [Text]
instanceEventWindowIds) (\s :: DescribeInstanceEventWindows
s@DescribeInstanceEventWindows' {} Maybe [Text]
a -> DescribeInstanceEventWindows
s {$sel:instanceEventWindowIds:DescribeInstanceEventWindows' :: Maybe [Text]
instanceEventWindowIds = Maybe [Text]
a} :: DescribeInstanceEventWindows) 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 maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned @NextToken@
-- value. This value can be between 20 and 500. You cannot specify this
-- parameter and the event window IDs parameter in the same call.
describeInstanceEventWindows_maxResults :: Lens.Lens' DescribeInstanceEventWindows (Prelude.Maybe Prelude.Natural)
describeInstanceEventWindows_maxResults :: Lens' DescribeInstanceEventWindows (Maybe Natural)
describeInstanceEventWindows_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceEventWindows' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeInstanceEventWindows
s@DescribeInstanceEventWindows' {} Maybe Natural
a -> DescribeInstanceEventWindows
s {$sel:maxResults:DescribeInstanceEventWindows' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeInstanceEventWindows)

-- | The token to request the next page of results.
describeInstanceEventWindows_nextToken :: Lens.Lens' DescribeInstanceEventWindows (Prelude.Maybe Prelude.Text)
describeInstanceEventWindows_nextToken :: Lens' DescribeInstanceEventWindows (Maybe Text)
describeInstanceEventWindows_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceEventWindows' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstanceEventWindows
s@DescribeInstanceEventWindows' {} Maybe Text
a -> DescribeInstanceEventWindows
s {$sel:nextToken:DescribeInstanceEventWindows' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstanceEventWindows)

instance Core.AWSPager DescribeInstanceEventWindows where
  page :: DescribeInstanceEventWindows
-> AWSResponse DescribeInstanceEventWindows
-> Maybe DescribeInstanceEventWindows
page DescribeInstanceEventWindows
rq AWSResponse DescribeInstanceEventWindows
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstanceEventWindows
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstanceEventWindowsResponse (Maybe Text)
describeInstanceEventWindowsResponse_nextToken
            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 DescribeInstanceEventWindows
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeInstanceEventWindowsResponse (Maybe [InstanceEventWindow])
describeInstanceEventWindowsResponse_instanceEventWindows
            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.$ DescribeInstanceEventWindows
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeInstanceEventWindows (Maybe Text)
describeInstanceEventWindows_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeInstanceEventWindows
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstanceEventWindowsResponse (Maybe Text)
describeInstanceEventWindowsResponse_nextToken
          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 DescribeInstanceEventWindows where
  type
    AWSResponse DescribeInstanceEventWindows =
      DescribeInstanceEventWindowsResponse
  request :: (Service -> Service)
-> DescribeInstanceEventWindows
-> Request DescribeInstanceEventWindows
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 DescribeInstanceEventWindows
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstanceEventWindows)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [InstanceEventWindow]
-> Maybe Text -> Int -> DescribeInstanceEventWindowsResponse
DescribeInstanceEventWindowsResponse'
            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
"instanceEventWindowSet"
                            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
"item")
                        )
            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
"nextToken")
            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
    DescribeInstanceEventWindows
  where
  hashWithSalt :: Int -> DescribeInstanceEventWindows -> Int
hashWithSalt Int
_salt DescribeInstanceEventWindows' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instanceEventWindowIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Text
$sel:maxResults:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Natural
$sel:instanceEventWindowIds:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Text]
$sel:filters:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Filter]
$sel:dryRun:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
instanceEventWindowIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeInstanceEventWindows where
  rnf :: DescribeInstanceEventWindows -> ()
rnf DescribeInstanceEventWindows' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instanceEventWindowIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Text
$sel:maxResults:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Natural
$sel:instanceEventWindowIds:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Text]
$sel:filters:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Filter]
$sel:dryRun:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
instanceEventWindowIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

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

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

instance Data.ToQuery DescribeInstanceEventWindows where
  toQuery :: DescribeInstanceEventWindows -> QueryString
toQuery DescribeInstanceEventWindows' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instanceEventWindowIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Text
$sel:maxResults:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Natural
$sel:instanceEventWindowIds:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Text]
$sel:filters:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe [Filter]
$sel:dryRun:DescribeInstanceEventWindows' :: DescribeInstanceEventWindows -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeInstanceEventWindows" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"InstanceEventWindowId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
instanceEventWindowIds
          ),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newDescribeInstanceEventWindowsResponse' smart constructor.
data DescribeInstanceEventWindowsResponse = DescribeInstanceEventWindowsResponse'
  { -- | Information about the event windows.
    DescribeInstanceEventWindowsResponse -> Maybe [InstanceEventWindow]
instanceEventWindows :: Prelude.Maybe [InstanceEventWindow],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeInstanceEventWindowsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeInstanceEventWindowsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstanceEventWindowsResponse
-> DescribeInstanceEventWindowsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstanceEventWindowsResponse
-> DescribeInstanceEventWindowsResponse -> Bool
$c/= :: DescribeInstanceEventWindowsResponse
-> DescribeInstanceEventWindowsResponse -> Bool
== :: DescribeInstanceEventWindowsResponse
-> DescribeInstanceEventWindowsResponse -> Bool
$c== :: DescribeInstanceEventWindowsResponse
-> DescribeInstanceEventWindowsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeInstanceEventWindowsResponse]
ReadPrec DescribeInstanceEventWindowsResponse
Int -> ReadS DescribeInstanceEventWindowsResponse
ReadS [DescribeInstanceEventWindowsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstanceEventWindowsResponse]
$creadListPrec :: ReadPrec [DescribeInstanceEventWindowsResponse]
readPrec :: ReadPrec DescribeInstanceEventWindowsResponse
$creadPrec :: ReadPrec DescribeInstanceEventWindowsResponse
readList :: ReadS [DescribeInstanceEventWindowsResponse]
$creadList :: ReadS [DescribeInstanceEventWindowsResponse]
readsPrec :: Int -> ReadS DescribeInstanceEventWindowsResponse
$creadsPrec :: Int -> ReadS DescribeInstanceEventWindowsResponse
Prelude.Read, Int -> DescribeInstanceEventWindowsResponse -> ShowS
[DescribeInstanceEventWindowsResponse] -> ShowS
DescribeInstanceEventWindowsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstanceEventWindowsResponse] -> ShowS
$cshowList :: [DescribeInstanceEventWindowsResponse] -> ShowS
show :: DescribeInstanceEventWindowsResponse -> String
$cshow :: DescribeInstanceEventWindowsResponse -> String
showsPrec :: Int -> DescribeInstanceEventWindowsResponse -> ShowS
$cshowsPrec :: Int -> DescribeInstanceEventWindowsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeInstanceEventWindowsResponse x
-> DescribeInstanceEventWindowsResponse
forall x.
DescribeInstanceEventWindowsResponse
-> Rep DescribeInstanceEventWindowsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstanceEventWindowsResponse x
-> DescribeInstanceEventWindowsResponse
$cfrom :: forall x.
DescribeInstanceEventWindowsResponse
-> Rep DescribeInstanceEventWindowsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstanceEventWindowsResponse' 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:
--
-- 'instanceEventWindows', 'describeInstanceEventWindowsResponse_instanceEventWindows' - Information about the event windows.
--
-- 'nextToken', 'describeInstanceEventWindowsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeInstanceEventWindowsResponse_httpStatus' - The response's http status code.
newDescribeInstanceEventWindowsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstanceEventWindowsResponse
newDescribeInstanceEventWindowsResponse :: Int -> DescribeInstanceEventWindowsResponse
newDescribeInstanceEventWindowsResponse Int
pHttpStatus_ =
  DescribeInstanceEventWindowsResponse'
    { $sel:instanceEventWindows:DescribeInstanceEventWindowsResponse' :: Maybe [InstanceEventWindow]
instanceEventWindows =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstanceEventWindowsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstanceEventWindowsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the event windows.
describeInstanceEventWindowsResponse_instanceEventWindows :: Lens.Lens' DescribeInstanceEventWindowsResponse (Prelude.Maybe [InstanceEventWindow])
describeInstanceEventWindowsResponse_instanceEventWindows :: Lens'
  DescribeInstanceEventWindowsResponse (Maybe [InstanceEventWindow])
describeInstanceEventWindowsResponse_instanceEventWindows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceEventWindowsResponse' {Maybe [InstanceEventWindow]
instanceEventWindows :: Maybe [InstanceEventWindow]
$sel:instanceEventWindows:DescribeInstanceEventWindowsResponse' :: DescribeInstanceEventWindowsResponse -> Maybe [InstanceEventWindow]
instanceEventWindows} -> Maybe [InstanceEventWindow]
instanceEventWindows) (\s :: DescribeInstanceEventWindowsResponse
s@DescribeInstanceEventWindowsResponse' {} Maybe [InstanceEventWindow]
a -> DescribeInstanceEventWindowsResponse
s {$sel:instanceEventWindows:DescribeInstanceEventWindowsResponse' :: Maybe [InstanceEventWindow]
instanceEventWindows = Maybe [InstanceEventWindow]
a} :: DescribeInstanceEventWindowsResponse) 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 token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeInstanceEventWindowsResponse_nextToken :: Lens.Lens' DescribeInstanceEventWindowsResponse (Prelude.Maybe Prelude.Text)
describeInstanceEventWindowsResponse_nextToken :: Lens' DescribeInstanceEventWindowsResponse (Maybe Text)
describeInstanceEventWindowsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceEventWindowsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstanceEventWindowsResponse' :: DescribeInstanceEventWindowsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstanceEventWindowsResponse
s@DescribeInstanceEventWindowsResponse' {} Maybe Text
a -> DescribeInstanceEventWindowsResponse
s {$sel:nextToken:DescribeInstanceEventWindowsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstanceEventWindowsResponse)

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

instance
  Prelude.NFData
    DescribeInstanceEventWindowsResponse
  where
  rnf :: DescribeInstanceEventWindowsResponse -> ()
rnf DescribeInstanceEventWindowsResponse' {Int
Maybe [InstanceEventWindow]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
instanceEventWindows :: Maybe [InstanceEventWindow]
$sel:httpStatus:DescribeInstanceEventWindowsResponse' :: DescribeInstanceEventWindowsResponse -> Int
$sel:nextToken:DescribeInstanceEventWindowsResponse' :: DescribeInstanceEventWindowsResponse -> Maybe Text
$sel:instanceEventWindows:DescribeInstanceEventWindowsResponse' :: DescribeInstanceEventWindowsResponse -> Maybe [InstanceEventWindow]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceEventWindow]
instanceEventWindows
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus