{-# 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 #-}
module Amazonka.SSM.CreateMaintenanceWindow
(
CreateMaintenanceWindow (..),
newCreateMaintenanceWindow,
createMaintenanceWindow_clientToken,
createMaintenanceWindow_scheduleOffset,
createMaintenanceWindow_endDate,
createMaintenanceWindow_scheduleTimezone,
createMaintenanceWindow_startDate,
createMaintenanceWindow_description,
createMaintenanceWindow_tags,
createMaintenanceWindow_name,
createMaintenanceWindow_schedule,
createMaintenanceWindow_duration,
createMaintenanceWindow_cutoff,
createMaintenanceWindow_allowUnassociatedTargets,
CreateMaintenanceWindowResponse (..),
newCreateMaintenanceWindowResponse,
createMaintenanceWindowResponse_windowId,
createMaintenanceWindowResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types
data CreateMaintenanceWindow = CreateMaintenanceWindow'
{
CreateMaintenanceWindow -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
CreateMaintenanceWindow -> Maybe Natural
scheduleOffset :: Prelude.Maybe Prelude.Natural,
CreateMaintenanceWindow -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
CreateMaintenanceWindow -> Maybe Text
scheduleTimezone :: Prelude.Maybe Prelude.Text,
CreateMaintenanceWindow -> Maybe Text
startDate :: Prelude.Maybe Prelude.Text,
CreateMaintenanceWindow -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CreateMaintenanceWindow -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateMaintenanceWindow -> Text
name :: Prelude.Text,
CreateMaintenanceWindow -> Text
schedule :: Prelude.Text,
CreateMaintenanceWindow -> Natural
duration :: Prelude.Natural,
CreateMaintenanceWindow -> Natural
cutoff :: Prelude.Natural,
CreateMaintenanceWindow -> Bool
allowUnassociatedTargets :: Prelude.Bool
}
deriving (CreateMaintenanceWindow -> CreateMaintenanceWindow -> Bool
(CreateMaintenanceWindow -> CreateMaintenanceWindow -> Bool)
-> (CreateMaintenanceWindow -> CreateMaintenanceWindow -> Bool)
-> Eq CreateMaintenanceWindow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMaintenanceWindow -> CreateMaintenanceWindow -> Bool
$c/= :: CreateMaintenanceWindow -> CreateMaintenanceWindow -> Bool
== :: CreateMaintenanceWindow -> CreateMaintenanceWindow -> Bool
$c== :: CreateMaintenanceWindow -> CreateMaintenanceWindow -> Bool
Prelude.Eq, Int -> CreateMaintenanceWindow -> ShowS
[CreateMaintenanceWindow] -> ShowS
CreateMaintenanceWindow -> String
(Int -> CreateMaintenanceWindow -> ShowS)
-> (CreateMaintenanceWindow -> String)
-> ([CreateMaintenanceWindow] -> ShowS)
-> Show CreateMaintenanceWindow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMaintenanceWindow] -> ShowS
$cshowList :: [CreateMaintenanceWindow] -> ShowS
show :: CreateMaintenanceWindow -> String
$cshow :: CreateMaintenanceWindow -> String
showsPrec :: Int -> CreateMaintenanceWindow -> ShowS
$cshowsPrec :: Int -> CreateMaintenanceWindow -> ShowS
Prelude.Show, (forall x.
CreateMaintenanceWindow -> Rep CreateMaintenanceWindow x)
-> (forall x.
Rep CreateMaintenanceWindow x -> CreateMaintenanceWindow)
-> Generic CreateMaintenanceWindow
forall x. Rep CreateMaintenanceWindow x -> CreateMaintenanceWindow
forall x. CreateMaintenanceWindow -> Rep CreateMaintenanceWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMaintenanceWindow x -> CreateMaintenanceWindow
$cfrom :: forall x. CreateMaintenanceWindow -> Rep CreateMaintenanceWindow x
Prelude.Generic)
newCreateMaintenanceWindow ::
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
Prelude.Natural ->
Prelude.Bool ->
CreateMaintenanceWindow
newCreateMaintenanceWindow :: Text
-> Text -> Natural -> Natural -> Bool -> CreateMaintenanceWindow
newCreateMaintenanceWindow
Text
pName_
Text
pSchedule_
Natural
pDuration_
Natural
pCutoff_
Bool
pAllowUnassociatedTargets_ =
CreateMaintenanceWindow' :: Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [Tag]
-> Text
-> Text
-> Natural
-> Natural
-> Bool
-> CreateMaintenanceWindow
CreateMaintenanceWindow'
{ $sel:clientToken:CreateMaintenanceWindow' :: Maybe Text
clientToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scheduleOffset:CreateMaintenanceWindow' :: Maybe Natural
scheduleOffset = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:endDate:CreateMaintenanceWindow' :: Maybe Text
endDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scheduleTimezone:CreateMaintenanceWindow' :: Maybe Text
scheduleTimezone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:startDate:CreateMaintenanceWindow' :: Maybe Text
startDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateMaintenanceWindow' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateMaintenanceWindow' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateMaintenanceWindow' :: Text
name = Text
pName_,
$sel:schedule:CreateMaintenanceWindow' :: Text
schedule = Text
pSchedule_,
$sel:duration:CreateMaintenanceWindow' :: Natural
duration = Natural
pDuration_,
$sel:cutoff:CreateMaintenanceWindow' :: Natural
cutoff = Natural
pCutoff_,
$sel:allowUnassociatedTargets:CreateMaintenanceWindow' :: Bool
allowUnassociatedTargets =
Bool
pAllowUnassociatedTargets_
}
createMaintenanceWindow_clientToken :: Lens.Lens' CreateMaintenanceWindow (Prelude.Maybe Prelude.Text)
createMaintenanceWindow_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_clientToken = (CreateMaintenanceWindow -> Maybe Text)
-> (CreateMaintenanceWindow
-> Maybe Text -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow
CreateMaintenanceWindow
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Maybe Text
a -> CreateMaintenanceWindow
s {$sel:clientToken:CreateMaintenanceWindow' :: Maybe Text
clientToken = Maybe Text
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_scheduleOffset :: Lens.Lens' CreateMaintenanceWindow (Prelude.Maybe Prelude.Natural)
createMaintenanceWindow_scheduleOffset :: (Maybe Natural -> f (Maybe Natural))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_scheduleOffset = (CreateMaintenanceWindow -> Maybe Natural)
-> (CreateMaintenanceWindow
-> Maybe Natural -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow
CreateMaintenanceWindow
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Maybe Natural
scheduleOffset :: Maybe Natural
$sel:scheduleOffset:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Natural
scheduleOffset} -> Maybe Natural
scheduleOffset) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Maybe Natural
a -> CreateMaintenanceWindow
s {$sel:scheduleOffset:CreateMaintenanceWindow' :: Maybe Natural
scheduleOffset = Maybe Natural
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_endDate :: Lens.Lens' CreateMaintenanceWindow (Prelude.Maybe Prelude.Text)
createMaintenanceWindow_endDate :: (Maybe Text -> f (Maybe Text))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_endDate = (CreateMaintenanceWindow -> Maybe Text)
-> (CreateMaintenanceWindow
-> Maybe Text -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow
CreateMaintenanceWindow
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Maybe Text
endDate :: Maybe Text
$sel:endDate:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Maybe Text
a -> CreateMaintenanceWindow
s {$sel:endDate:CreateMaintenanceWindow' :: Maybe Text
endDate = Maybe Text
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_scheduleTimezone :: Lens.Lens' CreateMaintenanceWindow (Prelude.Maybe Prelude.Text)
createMaintenanceWindow_scheduleTimezone :: (Maybe Text -> f (Maybe Text))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_scheduleTimezone = (CreateMaintenanceWindow -> Maybe Text)
-> (CreateMaintenanceWindow
-> Maybe Text -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow
CreateMaintenanceWindow
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Maybe Text
scheduleTimezone :: Maybe Text
$sel:scheduleTimezone:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
scheduleTimezone} -> Maybe Text
scheduleTimezone) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Maybe Text
a -> CreateMaintenanceWindow
s {$sel:scheduleTimezone:CreateMaintenanceWindow' :: Maybe Text
scheduleTimezone = Maybe Text
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_startDate :: Lens.Lens' CreateMaintenanceWindow (Prelude.Maybe Prelude.Text)
createMaintenanceWindow_startDate :: (Maybe Text -> f (Maybe Text))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_startDate = (CreateMaintenanceWindow -> Maybe Text)
-> (CreateMaintenanceWindow
-> Maybe Text -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow
CreateMaintenanceWindow
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Maybe Text
startDate :: Maybe Text
$sel:startDate:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
startDate} -> Maybe Text
startDate) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Maybe Text
a -> CreateMaintenanceWindow
s {$sel:startDate:CreateMaintenanceWindow' :: Maybe Text
startDate = Maybe Text
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_description :: Lens.Lens' CreateMaintenanceWindow (Prelude.Maybe Prelude.Text)
createMaintenanceWindow_description :: (Maybe Text -> f (Maybe Text))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_description = (CreateMaintenanceWindow -> Maybe (Sensitive Text))
-> (CreateMaintenanceWindow
-> Maybe (Sensitive Text) -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow
CreateMaintenanceWindow
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Maybe (Sensitive Text)
a -> CreateMaintenanceWindow
s {$sel:description:CreateMaintenanceWindow' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: CreateMaintenanceWindow) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateMaintenanceWindow
-> f CreateMaintenanceWindow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
createMaintenanceWindow_tags :: Lens.Lens' CreateMaintenanceWindow (Prelude.Maybe [Tag])
createMaintenanceWindow_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_tags = (CreateMaintenanceWindow -> Maybe [Tag])
-> (CreateMaintenanceWindow
-> Maybe [Tag] -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow
CreateMaintenanceWindow
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Maybe [Tag]
a -> CreateMaintenanceWindow
s {$sel:tags:CreateMaintenanceWindow' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateMaintenanceWindow) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateMaintenanceWindow
-> f CreateMaintenanceWindow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createMaintenanceWindow_name :: Lens.Lens' CreateMaintenanceWindow Prelude.Text
createMaintenanceWindow_name :: (Text -> f Text)
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_name = (CreateMaintenanceWindow -> Text)
-> (CreateMaintenanceWindow -> Text -> CreateMaintenanceWindow)
-> Lens CreateMaintenanceWindow CreateMaintenanceWindow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Text
name :: Text
$sel:name:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Text
name} -> Text
name) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Text
a -> CreateMaintenanceWindow
s {$sel:name:CreateMaintenanceWindow' :: Text
name = Text
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_schedule :: Lens.Lens' CreateMaintenanceWindow Prelude.Text
createMaintenanceWindow_schedule :: (Text -> f Text)
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_schedule = (CreateMaintenanceWindow -> Text)
-> (CreateMaintenanceWindow -> Text -> CreateMaintenanceWindow)
-> Lens CreateMaintenanceWindow CreateMaintenanceWindow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Text
schedule :: Text
$sel:schedule:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Text
schedule} -> Text
schedule) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Text
a -> CreateMaintenanceWindow
s {$sel:schedule:CreateMaintenanceWindow' :: Text
schedule = Text
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_duration :: Lens.Lens' CreateMaintenanceWindow Prelude.Natural
createMaintenanceWindow_duration :: (Natural -> f Natural)
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_duration = (CreateMaintenanceWindow -> Natural)
-> (CreateMaintenanceWindow -> Natural -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow CreateMaintenanceWindow Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Natural
duration :: Natural
$sel:duration:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Natural
duration} -> Natural
duration) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Natural
a -> CreateMaintenanceWindow
s {$sel:duration:CreateMaintenanceWindow' :: Natural
duration = Natural
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_cutoff :: Lens.Lens' CreateMaintenanceWindow Prelude.Natural
createMaintenanceWindow_cutoff :: (Natural -> f Natural)
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_cutoff = (CreateMaintenanceWindow -> Natural)
-> (CreateMaintenanceWindow -> Natural -> CreateMaintenanceWindow)
-> Lens
CreateMaintenanceWindow CreateMaintenanceWindow Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Natural
cutoff :: Natural
$sel:cutoff:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Natural
cutoff} -> Natural
cutoff) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Natural
a -> CreateMaintenanceWindow
s {$sel:cutoff:CreateMaintenanceWindow' :: Natural
cutoff = Natural
a} :: CreateMaintenanceWindow)
createMaintenanceWindow_allowUnassociatedTargets :: Lens.Lens' CreateMaintenanceWindow Prelude.Bool
createMaintenanceWindow_allowUnassociatedTargets :: (Bool -> f Bool)
-> CreateMaintenanceWindow -> f CreateMaintenanceWindow
createMaintenanceWindow_allowUnassociatedTargets = (CreateMaintenanceWindow -> Bool)
-> (CreateMaintenanceWindow -> Bool -> CreateMaintenanceWindow)
-> Lens CreateMaintenanceWindow CreateMaintenanceWindow Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindow' {Bool
allowUnassociatedTargets :: Bool
$sel:allowUnassociatedTargets:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Bool
allowUnassociatedTargets} -> Bool
allowUnassociatedTargets) (\s :: CreateMaintenanceWindow
s@CreateMaintenanceWindow' {} Bool
a -> CreateMaintenanceWindow
s {$sel:allowUnassociatedTargets:CreateMaintenanceWindow' :: Bool
allowUnassociatedTargets = Bool
a} :: CreateMaintenanceWindow)
instance Core.AWSRequest CreateMaintenanceWindow where
type
AWSResponse CreateMaintenanceWindow =
CreateMaintenanceWindowResponse
request :: CreateMaintenanceWindow -> Request CreateMaintenanceWindow
request = Service
-> CreateMaintenanceWindow -> Request CreateMaintenanceWindow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateMaintenanceWindow)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateMaintenanceWindow))
-> Logger
-> Service
-> Proxy CreateMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateMaintenanceWindow)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> CreateMaintenanceWindowResponse
CreateMaintenanceWindowResponse'
(Maybe Text -> Int -> CreateMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"WindowId")
Either String (Int -> CreateMaintenanceWindowResponse)
-> Either String Int
-> Either String CreateMaintenanceWindowResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateMaintenanceWindow
instance Prelude.NFData CreateMaintenanceWindow
instance Core.ToHeaders CreateMaintenanceWindow where
toHeaders :: CreateMaintenanceWindow -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateMaintenanceWindow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonSSM.CreateMaintenanceWindow" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateMaintenanceWindow where
toJSON :: CreateMaintenanceWindow -> Value
toJSON CreateMaintenanceWindow' {Bool
Natural
Maybe Natural
Maybe [Tag]
Maybe Text
Maybe (Sensitive Text)
Text
allowUnassociatedTargets :: Bool
cutoff :: Natural
duration :: Natural
schedule :: Text
name :: Text
tags :: Maybe [Tag]
description :: Maybe (Sensitive Text)
startDate :: Maybe Text
scheduleTimezone :: Maybe Text
endDate :: Maybe Text
scheduleOffset :: Maybe Natural
clientToken :: Maybe Text
$sel:allowUnassociatedTargets:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Bool
$sel:cutoff:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Natural
$sel:duration:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Natural
$sel:schedule:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Text
$sel:name:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Text
$sel:tags:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe [Tag]
$sel:description:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe (Sensitive Text)
$sel:startDate:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
$sel:scheduleTimezone:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
$sel:endDate:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
$sel:scheduleOffset:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Natural
$sel:clientToken:CreateMaintenanceWindow' :: CreateMaintenanceWindow -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
(Text
"ScheduleOffset" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
scheduleOffset,
(Text
"EndDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
endDate,
(Text
"ScheduleTimezone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
scheduleTimezone,
(Text
"StartDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
startDate,
(Text
"Description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
(Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Schedule" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
schedule),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Duration" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
duration),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Cutoff" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
cutoff),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"AllowUnassociatedTargets"
Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
allowUnassociatedTargets
)
]
)
instance Core.ToPath CreateMaintenanceWindow where
toPath :: CreateMaintenanceWindow -> ByteString
toPath = ByteString -> CreateMaintenanceWindow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateMaintenanceWindow where
toQuery :: CreateMaintenanceWindow -> QueryString
toQuery = QueryString -> CreateMaintenanceWindow -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateMaintenanceWindowResponse = CreateMaintenanceWindowResponse'
{
CreateMaintenanceWindowResponse -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text,
CreateMaintenanceWindowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateMaintenanceWindowResponse
-> CreateMaintenanceWindowResponse -> Bool
(CreateMaintenanceWindowResponse
-> CreateMaintenanceWindowResponse -> Bool)
-> (CreateMaintenanceWindowResponse
-> CreateMaintenanceWindowResponse -> Bool)
-> Eq CreateMaintenanceWindowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMaintenanceWindowResponse
-> CreateMaintenanceWindowResponse -> Bool
$c/= :: CreateMaintenanceWindowResponse
-> CreateMaintenanceWindowResponse -> Bool
== :: CreateMaintenanceWindowResponse
-> CreateMaintenanceWindowResponse -> Bool
$c== :: CreateMaintenanceWindowResponse
-> CreateMaintenanceWindowResponse -> Bool
Prelude.Eq, ReadPrec [CreateMaintenanceWindowResponse]
ReadPrec CreateMaintenanceWindowResponse
Int -> ReadS CreateMaintenanceWindowResponse
ReadS [CreateMaintenanceWindowResponse]
(Int -> ReadS CreateMaintenanceWindowResponse)
-> ReadS [CreateMaintenanceWindowResponse]
-> ReadPrec CreateMaintenanceWindowResponse
-> ReadPrec [CreateMaintenanceWindowResponse]
-> Read CreateMaintenanceWindowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMaintenanceWindowResponse]
$creadListPrec :: ReadPrec [CreateMaintenanceWindowResponse]
readPrec :: ReadPrec CreateMaintenanceWindowResponse
$creadPrec :: ReadPrec CreateMaintenanceWindowResponse
readList :: ReadS [CreateMaintenanceWindowResponse]
$creadList :: ReadS [CreateMaintenanceWindowResponse]
readsPrec :: Int -> ReadS CreateMaintenanceWindowResponse
$creadsPrec :: Int -> ReadS CreateMaintenanceWindowResponse
Prelude.Read, Int -> CreateMaintenanceWindowResponse -> ShowS
[CreateMaintenanceWindowResponse] -> ShowS
CreateMaintenanceWindowResponse -> String
(Int -> CreateMaintenanceWindowResponse -> ShowS)
-> (CreateMaintenanceWindowResponse -> String)
-> ([CreateMaintenanceWindowResponse] -> ShowS)
-> Show CreateMaintenanceWindowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMaintenanceWindowResponse] -> ShowS
$cshowList :: [CreateMaintenanceWindowResponse] -> ShowS
show :: CreateMaintenanceWindowResponse -> String
$cshow :: CreateMaintenanceWindowResponse -> String
showsPrec :: Int -> CreateMaintenanceWindowResponse -> ShowS
$cshowsPrec :: Int -> CreateMaintenanceWindowResponse -> ShowS
Prelude.Show, (forall x.
CreateMaintenanceWindowResponse
-> Rep CreateMaintenanceWindowResponse x)
-> (forall x.
Rep CreateMaintenanceWindowResponse x
-> CreateMaintenanceWindowResponse)
-> Generic CreateMaintenanceWindowResponse
forall x.
Rep CreateMaintenanceWindowResponse x
-> CreateMaintenanceWindowResponse
forall x.
CreateMaintenanceWindowResponse
-> Rep CreateMaintenanceWindowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMaintenanceWindowResponse x
-> CreateMaintenanceWindowResponse
$cfrom :: forall x.
CreateMaintenanceWindowResponse
-> Rep CreateMaintenanceWindowResponse x
Prelude.Generic)
newCreateMaintenanceWindowResponse ::
Prelude.Int ->
CreateMaintenanceWindowResponse
newCreateMaintenanceWindowResponse :: Int -> CreateMaintenanceWindowResponse
newCreateMaintenanceWindowResponse Int
pHttpStatus_ =
CreateMaintenanceWindowResponse' :: Maybe Text -> Int -> CreateMaintenanceWindowResponse
CreateMaintenanceWindowResponse'
{ $sel:windowId:CreateMaintenanceWindowResponse' :: Maybe Text
windowId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateMaintenanceWindowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createMaintenanceWindowResponse_windowId :: Lens.Lens' CreateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
createMaintenanceWindowResponse_windowId :: (Maybe Text -> f (Maybe Text))
-> CreateMaintenanceWindowResponse
-> f CreateMaintenanceWindowResponse
createMaintenanceWindowResponse_windowId = (CreateMaintenanceWindowResponse -> Maybe Text)
-> (CreateMaintenanceWindowResponse
-> Maybe Text -> CreateMaintenanceWindowResponse)
-> Lens
CreateMaintenanceWindowResponse
CreateMaintenanceWindowResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindowResponse' {Maybe Text
windowId :: Maybe Text
$sel:windowId:CreateMaintenanceWindowResponse' :: CreateMaintenanceWindowResponse -> Maybe Text
windowId} -> Maybe Text
windowId) (\s :: CreateMaintenanceWindowResponse
s@CreateMaintenanceWindowResponse' {} Maybe Text
a -> CreateMaintenanceWindowResponse
s {$sel:windowId:CreateMaintenanceWindowResponse' :: Maybe Text
windowId = Maybe Text
a} :: CreateMaintenanceWindowResponse)
createMaintenanceWindowResponse_httpStatus :: Lens.Lens' CreateMaintenanceWindowResponse Prelude.Int
createMaintenanceWindowResponse_httpStatus :: (Int -> f Int)
-> CreateMaintenanceWindowResponse
-> f CreateMaintenanceWindowResponse
createMaintenanceWindowResponse_httpStatus = (CreateMaintenanceWindowResponse -> Int)
-> (CreateMaintenanceWindowResponse
-> Int -> CreateMaintenanceWindowResponse)
-> Lens
CreateMaintenanceWindowResponse
CreateMaintenanceWindowResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMaintenanceWindowResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMaintenanceWindowResponse' :: CreateMaintenanceWindowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMaintenanceWindowResponse
s@CreateMaintenanceWindowResponse' {} Int
a -> CreateMaintenanceWindowResponse
s {$sel:httpStatus:CreateMaintenanceWindowResponse' :: Int
httpStatus = Int
a} :: CreateMaintenanceWindowResponse)
instance
Prelude.NFData
CreateMaintenanceWindowResponse