{-# 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.ModifyInstanceEventWindow
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies the specified event window.
--
-- You can define either a set of time ranges or a cron expression when
-- modifying the event window, but not both.
--
-- To modify the targets associated with the event window, use the
-- AssociateInstanceEventWindow and DisassociateInstanceEventWindow API.
--
-- If Amazon Web Services has already scheduled an event, modifying an
-- event window won\'t change the time of the scheduled event.
--
-- 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/.
module Amazonka.EC2.ModifyInstanceEventWindow
  ( -- * Creating a Request
    ModifyInstanceEventWindow (..),
    newModifyInstanceEventWindow,

    -- * Request Lenses
    modifyInstanceEventWindow_cronExpression,
    modifyInstanceEventWindow_dryRun,
    modifyInstanceEventWindow_name,
    modifyInstanceEventWindow_timeRanges,
    modifyInstanceEventWindow_instanceEventWindowId,

    -- * Destructuring the Response
    ModifyInstanceEventWindowResponse (..),
    newModifyInstanceEventWindowResponse,

    -- * Response Lenses
    modifyInstanceEventWindowResponse_instanceEventWindow,
    modifyInstanceEventWindowResponse_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

-- | /See:/ 'newModifyInstanceEventWindow' smart constructor.
data ModifyInstanceEventWindow = ModifyInstanceEventWindow'
  { -- | The cron expression of the event window, for example,
    -- @* 0-4,20-23 * * 1,5@.
    --
    -- Constraints:
    --
    -- -   Only hour and day of the week values are supported.
    --
    -- -   For day of the week values, you can specify either integers @0@
    --     through @6@, or alternative single values @SUN@ through @SAT@.
    --
    -- -   The minute, month, and year must be specified by @*@.
    --
    -- -   The hour value must be one or a multiple range, for example, @0-4@
    --     or @0-4,20-23@.
    --
    -- -   Each hour range must be >= 2 hours, for example, @0-2@ or @20-23@.
    --
    -- -   The event window must be >= 4 hours. The combined total time ranges
    --     in the event window must be >= 4 hours.
    --
    -- For more information about cron expressions, see
    -- <https://en.wikipedia.org/wiki/Cron cron> on the /Wikipedia website/.
    ModifyInstanceEventWindow -> Maybe Text
cronExpression :: Prelude.Maybe Prelude.Text,
    -- | 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@.
    ModifyInstanceEventWindow -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The name of the event window.
    ModifyInstanceEventWindow -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The time ranges of the event window.
    ModifyInstanceEventWindow
-> Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges :: Prelude.Maybe [InstanceEventWindowTimeRangeRequest],
    -- | The ID of the event window.
    ModifyInstanceEventWindow -> Text
instanceEventWindowId :: Prelude.Text
  }
  deriving (ModifyInstanceEventWindow -> ModifyInstanceEventWindow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyInstanceEventWindow -> ModifyInstanceEventWindow -> Bool
$c/= :: ModifyInstanceEventWindow -> ModifyInstanceEventWindow -> Bool
== :: ModifyInstanceEventWindow -> ModifyInstanceEventWindow -> Bool
$c== :: ModifyInstanceEventWindow -> ModifyInstanceEventWindow -> Bool
Prelude.Eq, ReadPrec [ModifyInstanceEventWindow]
ReadPrec ModifyInstanceEventWindow
Int -> ReadS ModifyInstanceEventWindow
ReadS [ModifyInstanceEventWindow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyInstanceEventWindow]
$creadListPrec :: ReadPrec [ModifyInstanceEventWindow]
readPrec :: ReadPrec ModifyInstanceEventWindow
$creadPrec :: ReadPrec ModifyInstanceEventWindow
readList :: ReadS [ModifyInstanceEventWindow]
$creadList :: ReadS [ModifyInstanceEventWindow]
readsPrec :: Int -> ReadS ModifyInstanceEventWindow
$creadsPrec :: Int -> ReadS ModifyInstanceEventWindow
Prelude.Read, Int -> ModifyInstanceEventWindow -> ShowS
[ModifyInstanceEventWindow] -> ShowS
ModifyInstanceEventWindow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyInstanceEventWindow] -> ShowS
$cshowList :: [ModifyInstanceEventWindow] -> ShowS
show :: ModifyInstanceEventWindow -> String
$cshow :: ModifyInstanceEventWindow -> String
showsPrec :: Int -> ModifyInstanceEventWindow -> ShowS
$cshowsPrec :: Int -> ModifyInstanceEventWindow -> ShowS
Prelude.Show, forall x.
Rep ModifyInstanceEventWindow x -> ModifyInstanceEventWindow
forall x.
ModifyInstanceEventWindow -> Rep ModifyInstanceEventWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyInstanceEventWindow x -> ModifyInstanceEventWindow
$cfrom :: forall x.
ModifyInstanceEventWindow -> Rep ModifyInstanceEventWindow x
Prelude.Generic)

-- |
-- Create a value of 'ModifyInstanceEventWindow' 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:
--
-- 'cronExpression', 'modifyInstanceEventWindow_cronExpression' - The cron expression of the event window, for example,
-- @* 0-4,20-23 * * 1,5@.
--
-- Constraints:
--
-- -   Only hour and day of the week values are supported.
--
-- -   For day of the week values, you can specify either integers @0@
--     through @6@, or alternative single values @SUN@ through @SAT@.
--
-- -   The minute, month, and year must be specified by @*@.
--
-- -   The hour value must be one or a multiple range, for example, @0-4@
--     or @0-4,20-23@.
--
-- -   Each hour range must be >= 2 hours, for example, @0-2@ or @20-23@.
--
-- -   The event window must be >= 4 hours. The combined total time ranges
--     in the event window must be >= 4 hours.
--
-- For more information about cron expressions, see
-- <https://en.wikipedia.org/wiki/Cron cron> on the /Wikipedia website/.
--
-- 'dryRun', 'modifyInstanceEventWindow_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@.
--
-- 'name', 'modifyInstanceEventWindow_name' - The name of the event window.
--
-- 'timeRanges', 'modifyInstanceEventWindow_timeRanges' - The time ranges of the event window.
--
-- 'instanceEventWindowId', 'modifyInstanceEventWindow_instanceEventWindowId' - The ID of the event window.
newModifyInstanceEventWindow ::
  -- | 'instanceEventWindowId'
  Prelude.Text ->
  ModifyInstanceEventWindow
newModifyInstanceEventWindow :: Text -> ModifyInstanceEventWindow
newModifyInstanceEventWindow Text
pInstanceEventWindowId_ =
  ModifyInstanceEventWindow'
    { $sel:cronExpression:ModifyInstanceEventWindow' :: Maybe Text
cronExpression =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:ModifyInstanceEventWindow' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ModifyInstanceEventWindow' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:timeRanges:ModifyInstanceEventWindow' :: Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceEventWindowId:ModifyInstanceEventWindow' :: Text
instanceEventWindowId = Text
pInstanceEventWindowId_
    }

-- | The cron expression of the event window, for example,
-- @* 0-4,20-23 * * 1,5@.
--
-- Constraints:
--
-- -   Only hour and day of the week values are supported.
--
-- -   For day of the week values, you can specify either integers @0@
--     through @6@, or alternative single values @SUN@ through @SAT@.
--
-- -   The minute, month, and year must be specified by @*@.
--
-- -   The hour value must be one or a multiple range, for example, @0-4@
--     or @0-4,20-23@.
--
-- -   Each hour range must be >= 2 hours, for example, @0-2@ or @20-23@.
--
-- -   The event window must be >= 4 hours. The combined total time ranges
--     in the event window must be >= 4 hours.
--
-- For more information about cron expressions, see
-- <https://en.wikipedia.org/wiki/Cron cron> on the /Wikipedia website/.
modifyInstanceEventWindow_cronExpression :: Lens.Lens' ModifyInstanceEventWindow (Prelude.Maybe Prelude.Text)
modifyInstanceEventWindow_cronExpression :: Lens' ModifyInstanceEventWindow (Maybe Text)
modifyInstanceEventWindow_cronExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyInstanceEventWindow' {Maybe Text
cronExpression :: Maybe Text
$sel:cronExpression:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
cronExpression} -> Maybe Text
cronExpression) (\s :: ModifyInstanceEventWindow
s@ModifyInstanceEventWindow' {} Maybe Text
a -> ModifyInstanceEventWindow
s {$sel:cronExpression:ModifyInstanceEventWindow' :: Maybe Text
cronExpression = Maybe Text
a} :: ModifyInstanceEventWindow)

-- | 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@.
modifyInstanceEventWindow_dryRun :: Lens.Lens' ModifyInstanceEventWindow (Prelude.Maybe Prelude.Bool)
modifyInstanceEventWindow_dryRun :: Lens' ModifyInstanceEventWindow (Maybe Bool)
modifyInstanceEventWindow_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyInstanceEventWindow' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: ModifyInstanceEventWindow
s@ModifyInstanceEventWindow' {} Maybe Bool
a -> ModifyInstanceEventWindow
s {$sel:dryRun:ModifyInstanceEventWindow' :: Maybe Bool
dryRun = Maybe Bool
a} :: ModifyInstanceEventWindow)

-- | The name of the event window.
modifyInstanceEventWindow_name :: Lens.Lens' ModifyInstanceEventWindow (Prelude.Maybe Prelude.Text)
modifyInstanceEventWindow_name :: Lens' ModifyInstanceEventWindow (Maybe Text)
modifyInstanceEventWindow_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyInstanceEventWindow' {Maybe Text
name :: Maybe Text
$sel:name:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
name} -> Maybe Text
name) (\s :: ModifyInstanceEventWindow
s@ModifyInstanceEventWindow' {} Maybe Text
a -> ModifyInstanceEventWindow
s {$sel:name:ModifyInstanceEventWindow' :: Maybe Text
name = Maybe Text
a} :: ModifyInstanceEventWindow)

-- | The time ranges of the event window.
modifyInstanceEventWindow_timeRanges :: Lens.Lens' ModifyInstanceEventWindow (Prelude.Maybe [InstanceEventWindowTimeRangeRequest])
modifyInstanceEventWindow_timeRanges :: Lens'
  ModifyInstanceEventWindow
  (Maybe [InstanceEventWindowTimeRangeRequest])
modifyInstanceEventWindow_timeRanges = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyInstanceEventWindow' {Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges :: Maybe [InstanceEventWindowTimeRangeRequest]
$sel:timeRanges:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow
-> Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges} -> Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges) (\s :: ModifyInstanceEventWindow
s@ModifyInstanceEventWindow' {} Maybe [InstanceEventWindowTimeRangeRequest]
a -> ModifyInstanceEventWindow
s {$sel:timeRanges:ModifyInstanceEventWindow' :: Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges = Maybe [InstanceEventWindowTimeRangeRequest]
a} :: ModifyInstanceEventWindow) 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 ID of the event window.
modifyInstanceEventWindow_instanceEventWindowId :: Lens.Lens' ModifyInstanceEventWindow Prelude.Text
modifyInstanceEventWindow_instanceEventWindowId :: Lens' ModifyInstanceEventWindow Text
modifyInstanceEventWindow_instanceEventWindowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyInstanceEventWindow' {Text
instanceEventWindowId :: Text
$sel:instanceEventWindowId:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Text
instanceEventWindowId} -> Text
instanceEventWindowId) (\s :: ModifyInstanceEventWindow
s@ModifyInstanceEventWindow' {} Text
a -> ModifyInstanceEventWindow
s {$sel:instanceEventWindowId:ModifyInstanceEventWindow' :: Text
instanceEventWindowId = Text
a} :: ModifyInstanceEventWindow)

instance Core.AWSRequest ModifyInstanceEventWindow where
  type
    AWSResponse ModifyInstanceEventWindow =
      ModifyInstanceEventWindowResponse
  request :: (Service -> Service)
-> ModifyInstanceEventWindow -> Request ModifyInstanceEventWindow
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 ModifyInstanceEventWindow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyInstanceEventWindow)))
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
-> Int -> ModifyInstanceEventWindowResponse
ModifyInstanceEventWindowResponse'
            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
"instanceEventWindow")
            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 ModifyInstanceEventWindow where
  hashWithSalt :: Int -> ModifyInstanceEventWindow -> Int
hashWithSalt Int
_salt ModifyInstanceEventWindow' {Maybe Bool
Maybe [InstanceEventWindowTimeRangeRequest]
Maybe Text
Text
instanceEventWindowId :: Text
timeRanges :: Maybe [InstanceEventWindowTimeRangeRequest]
name :: Maybe Text
dryRun :: Maybe Bool
cronExpression :: Maybe Text
$sel:instanceEventWindowId:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Text
$sel:timeRanges:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow
-> Maybe [InstanceEventWindowTimeRangeRequest]
$sel:name:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
$sel:dryRun:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Bool
$sel:cronExpression:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cronExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceEventWindowId

instance Prelude.NFData ModifyInstanceEventWindow where
  rnf :: ModifyInstanceEventWindow -> ()
rnf ModifyInstanceEventWindow' {Maybe Bool
Maybe [InstanceEventWindowTimeRangeRequest]
Maybe Text
Text
instanceEventWindowId :: Text
timeRanges :: Maybe [InstanceEventWindowTimeRangeRequest]
name :: Maybe Text
dryRun :: Maybe Bool
cronExpression :: Maybe Text
$sel:instanceEventWindowId:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Text
$sel:timeRanges:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow
-> Maybe [InstanceEventWindowTimeRangeRequest]
$sel:name:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
$sel:dryRun:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Bool
$sel:cronExpression:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cronExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceEventWindowId

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

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

instance Data.ToQuery ModifyInstanceEventWindow where
  toQuery :: ModifyInstanceEventWindow -> QueryString
toQuery ModifyInstanceEventWindow' {Maybe Bool
Maybe [InstanceEventWindowTimeRangeRequest]
Maybe Text
Text
instanceEventWindowId :: Text
timeRanges :: Maybe [InstanceEventWindowTimeRangeRequest]
name :: Maybe Text
dryRun :: Maybe Bool
cronExpression :: Maybe Text
$sel:instanceEventWindowId:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Text
$sel:timeRanges:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow
-> Maybe [InstanceEventWindowTimeRangeRequest]
$sel:name:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
$sel:dryRun:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Bool
$sel:cronExpression:ModifyInstanceEventWindow' :: ModifyInstanceEventWindow -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyInstanceEventWindow" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"CronExpression" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
cronExpression,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"Name" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
name,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TimeRange"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceEventWindowTimeRangeRequest]
timeRanges
          ),
        ByteString
"InstanceEventWindowId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
instanceEventWindowId
      ]

-- | /See:/ 'newModifyInstanceEventWindowResponse' smart constructor.
data ModifyInstanceEventWindowResponse = ModifyInstanceEventWindowResponse'
  { -- | Information about the event window.
    ModifyInstanceEventWindowResponse -> Maybe InstanceEventWindow
instanceEventWindow :: Prelude.Maybe InstanceEventWindow,
    -- | The response's http status code.
    ModifyInstanceEventWindowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyInstanceEventWindowResponse
-> ModifyInstanceEventWindowResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyInstanceEventWindowResponse
-> ModifyInstanceEventWindowResponse -> Bool
$c/= :: ModifyInstanceEventWindowResponse
-> ModifyInstanceEventWindowResponse -> Bool
== :: ModifyInstanceEventWindowResponse
-> ModifyInstanceEventWindowResponse -> Bool
$c== :: ModifyInstanceEventWindowResponse
-> ModifyInstanceEventWindowResponse -> Bool
Prelude.Eq, ReadPrec [ModifyInstanceEventWindowResponse]
ReadPrec ModifyInstanceEventWindowResponse
Int -> ReadS ModifyInstanceEventWindowResponse
ReadS [ModifyInstanceEventWindowResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyInstanceEventWindowResponse]
$creadListPrec :: ReadPrec [ModifyInstanceEventWindowResponse]
readPrec :: ReadPrec ModifyInstanceEventWindowResponse
$creadPrec :: ReadPrec ModifyInstanceEventWindowResponse
readList :: ReadS [ModifyInstanceEventWindowResponse]
$creadList :: ReadS [ModifyInstanceEventWindowResponse]
readsPrec :: Int -> ReadS ModifyInstanceEventWindowResponse
$creadsPrec :: Int -> ReadS ModifyInstanceEventWindowResponse
Prelude.Read, Int -> ModifyInstanceEventWindowResponse -> ShowS
[ModifyInstanceEventWindowResponse] -> ShowS
ModifyInstanceEventWindowResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyInstanceEventWindowResponse] -> ShowS
$cshowList :: [ModifyInstanceEventWindowResponse] -> ShowS
show :: ModifyInstanceEventWindowResponse -> String
$cshow :: ModifyInstanceEventWindowResponse -> String
showsPrec :: Int -> ModifyInstanceEventWindowResponse -> ShowS
$cshowsPrec :: Int -> ModifyInstanceEventWindowResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyInstanceEventWindowResponse x
-> ModifyInstanceEventWindowResponse
forall x.
ModifyInstanceEventWindowResponse
-> Rep ModifyInstanceEventWindowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyInstanceEventWindowResponse x
-> ModifyInstanceEventWindowResponse
$cfrom :: forall x.
ModifyInstanceEventWindowResponse
-> Rep ModifyInstanceEventWindowResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyInstanceEventWindowResponse' 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:
--
-- 'instanceEventWindow', 'modifyInstanceEventWindowResponse_instanceEventWindow' - Information about the event window.
--
-- 'httpStatus', 'modifyInstanceEventWindowResponse_httpStatus' - The response's http status code.
newModifyInstanceEventWindowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyInstanceEventWindowResponse
newModifyInstanceEventWindowResponse :: Int -> ModifyInstanceEventWindowResponse
newModifyInstanceEventWindowResponse Int
pHttpStatus_ =
  ModifyInstanceEventWindowResponse'
    { $sel:instanceEventWindow:ModifyInstanceEventWindowResponse' :: Maybe InstanceEventWindow
instanceEventWindow =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyInstanceEventWindowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the event window.
modifyInstanceEventWindowResponse_instanceEventWindow :: Lens.Lens' ModifyInstanceEventWindowResponse (Prelude.Maybe InstanceEventWindow)
modifyInstanceEventWindowResponse_instanceEventWindow :: Lens' ModifyInstanceEventWindowResponse (Maybe InstanceEventWindow)
modifyInstanceEventWindowResponse_instanceEventWindow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyInstanceEventWindowResponse' {Maybe InstanceEventWindow
instanceEventWindow :: Maybe InstanceEventWindow
$sel:instanceEventWindow:ModifyInstanceEventWindowResponse' :: ModifyInstanceEventWindowResponse -> Maybe InstanceEventWindow
instanceEventWindow} -> Maybe InstanceEventWindow
instanceEventWindow) (\s :: ModifyInstanceEventWindowResponse
s@ModifyInstanceEventWindowResponse' {} Maybe InstanceEventWindow
a -> ModifyInstanceEventWindowResponse
s {$sel:instanceEventWindow:ModifyInstanceEventWindowResponse' :: Maybe InstanceEventWindow
instanceEventWindow = Maybe InstanceEventWindow
a} :: ModifyInstanceEventWindowResponse)

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

instance
  Prelude.NFData
    ModifyInstanceEventWindowResponse
  where
  rnf :: ModifyInstanceEventWindowResponse -> ()
rnf ModifyInstanceEventWindowResponse' {Int
Maybe InstanceEventWindow
httpStatus :: Int
instanceEventWindow :: Maybe InstanceEventWindow
$sel:httpStatus:ModifyInstanceEventWindowResponse' :: ModifyInstanceEventWindowResponse -> Int
$sel:instanceEventWindow:ModifyInstanceEventWindowResponse' :: ModifyInstanceEventWindowResponse -> Maybe InstanceEventWindow
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceEventWindow
instanceEventWindow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus