{-# 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.ArcZonalShift.UpdateZonalShift
(
UpdateZonalShift (..),
newUpdateZonalShift,
updateZonalShift_comment,
updateZonalShift_expiresIn,
updateZonalShift_zonalShiftId,
ZonalShift (..),
newZonalShift,
zonalShift_awayFrom,
zonalShift_comment,
zonalShift_expiryTime,
zonalShift_resourceIdentifier,
zonalShift_startTime,
zonalShift_status,
zonalShift_zonalShiftId,
)
where
import Amazonka.ArcZonalShift.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateZonalShift = UpdateZonalShift'
{
:: Prelude.Maybe Prelude.Text,
UpdateZonalShift -> Maybe Text
expiresIn :: Prelude.Maybe Prelude.Text,
UpdateZonalShift -> Text
zonalShiftId :: Prelude.Text
}
deriving (UpdateZonalShift -> UpdateZonalShift -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateZonalShift -> UpdateZonalShift -> Bool
$c/= :: UpdateZonalShift -> UpdateZonalShift -> Bool
== :: UpdateZonalShift -> UpdateZonalShift -> Bool
$c== :: UpdateZonalShift -> UpdateZonalShift -> Bool
Prelude.Eq, ReadPrec [UpdateZonalShift]
ReadPrec UpdateZonalShift
Int -> ReadS UpdateZonalShift
ReadS [UpdateZonalShift]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateZonalShift]
$creadListPrec :: ReadPrec [UpdateZonalShift]
readPrec :: ReadPrec UpdateZonalShift
$creadPrec :: ReadPrec UpdateZonalShift
readList :: ReadS [UpdateZonalShift]
$creadList :: ReadS [UpdateZonalShift]
readsPrec :: Int -> ReadS UpdateZonalShift
$creadsPrec :: Int -> ReadS UpdateZonalShift
Prelude.Read, Int -> UpdateZonalShift -> ShowS
[UpdateZonalShift] -> ShowS
UpdateZonalShift -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateZonalShift] -> ShowS
$cshowList :: [UpdateZonalShift] -> ShowS
show :: UpdateZonalShift -> String
$cshow :: UpdateZonalShift -> String
showsPrec :: Int -> UpdateZonalShift -> ShowS
$cshowsPrec :: Int -> UpdateZonalShift -> ShowS
Prelude.Show, forall x. Rep UpdateZonalShift x -> UpdateZonalShift
forall x. UpdateZonalShift -> Rep UpdateZonalShift x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateZonalShift x -> UpdateZonalShift
$cfrom :: forall x. UpdateZonalShift -> Rep UpdateZonalShift x
Prelude.Generic)
newUpdateZonalShift ::
Prelude.Text ->
UpdateZonalShift
newUpdateZonalShift :: Text -> UpdateZonalShift
newUpdateZonalShift Text
pZonalShiftId_ =
UpdateZonalShift'
{ $sel:comment:UpdateZonalShift' :: Maybe Text
comment = forall a. Maybe a
Prelude.Nothing,
$sel:expiresIn:UpdateZonalShift' :: Maybe Text
expiresIn = forall a. Maybe a
Prelude.Nothing,
$sel:zonalShiftId:UpdateZonalShift' :: Text
zonalShiftId = Text
pZonalShiftId_
}
updateZonalShift_comment :: Lens.Lens' UpdateZonalShift (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateZonalShift' {Maybe Text
comment :: Maybe Text
$sel:comment:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
comment} -> Maybe Text
comment) (\s :: UpdateZonalShift
s@UpdateZonalShift' {} Maybe Text
a -> UpdateZonalShift
s {$sel:comment:UpdateZonalShift' :: Maybe Text
comment = Maybe Text
a} :: UpdateZonalShift)
updateZonalShift_expiresIn :: Lens.Lens' UpdateZonalShift (Prelude.Maybe Prelude.Text)
updateZonalShift_expiresIn :: Lens' UpdateZonalShift (Maybe Text)
updateZonalShift_expiresIn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateZonalShift' {Maybe Text
expiresIn :: Maybe Text
$sel:expiresIn:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
expiresIn} -> Maybe Text
expiresIn) (\s :: UpdateZonalShift
s@UpdateZonalShift' {} Maybe Text
a -> UpdateZonalShift
s {$sel:expiresIn:UpdateZonalShift' :: Maybe Text
expiresIn = Maybe Text
a} :: UpdateZonalShift)
updateZonalShift_zonalShiftId :: Lens.Lens' UpdateZonalShift Prelude.Text
updateZonalShift_zonalShiftId :: Lens' UpdateZonalShift Text
updateZonalShift_zonalShiftId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateZonalShift' {Text
zonalShiftId :: Text
$sel:zonalShiftId:UpdateZonalShift' :: UpdateZonalShift -> Text
zonalShiftId} -> Text
zonalShiftId) (\s :: UpdateZonalShift
s@UpdateZonalShift' {} Text
a -> UpdateZonalShift
s {$sel:zonalShiftId:UpdateZonalShift' :: Text
zonalShiftId = Text
a} :: UpdateZonalShift)
instance Core.AWSRequest UpdateZonalShift where
type AWSResponse UpdateZonalShift = ZonalShift
request :: (Service -> Service)
-> UpdateZonalShift -> Request UpdateZonalShift
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateZonalShift
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateZonalShift)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance Prelude.Hashable UpdateZonalShift where
hashWithSalt :: Int -> UpdateZonalShift -> Int
hashWithSalt Int
_salt UpdateZonalShift' {Maybe Text
Text
zonalShiftId :: Text
expiresIn :: Maybe Text
comment :: Maybe Text
$sel:zonalShiftId:UpdateZonalShift' :: UpdateZonalShift -> Text
$sel:expiresIn:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
$sel:comment:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expiresIn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
zonalShiftId
instance Prelude.NFData UpdateZonalShift where
rnf :: UpdateZonalShift -> ()
rnf UpdateZonalShift' {Maybe Text
Text
zonalShiftId :: Text
expiresIn :: Maybe Text
comment :: Maybe Text
$sel:zonalShiftId:UpdateZonalShift' :: UpdateZonalShift -> Text
$sel:expiresIn:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
$sel:comment:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expiresIn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
zonalShiftId
instance Data.ToHeaders UpdateZonalShift where
toHeaders :: UpdateZonalShift -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateZonalShift where
toJSON :: UpdateZonalShift -> Value
toJSON UpdateZonalShift' {Maybe Text
Text
zonalShiftId :: Text
expiresIn :: Maybe Text
comment :: Maybe Text
$sel:zonalShiftId:UpdateZonalShift' :: UpdateZonalShift -> Text
$sel:expiresIn:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
$sel:comment:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"comment" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
comment,
(Key
"expiresIn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
expiresIn
]
)
instance Data.ToPath UpdateZonalShift where
toPath :: UpdateZonalShift -> ByteString
toPath UpdateZonalShift' {Maybe Text
Text
zonalShiftId :: Text
expiresIn :: Maybe Text
comment :: Maybe Text
$sel:zonalShiftId:UpdateZonalShift' :: UpdateZonalShift -> Text
$sel:expiresIn:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
$sel:comment:UpdateZonalShift' :: UpdateZonalShift -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/zonalshifts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
zonalShiftId]
instance Data.ToQuery UpdateZonalShift where
toQuery :: UpdateZonalShift -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty