{-# 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.BackupGateway.PutBandwidthRateLimitSchedule
(
PutBandwidthRateLimitSchedule (..),
newPutBandwidthRateLimitSchedule,
putBandwidthRateLimitSchedule_bandwidthRateLimitIntervals,
putBandwidthRateLimitSchedule_gatewayArn,
PutBandwidthRateLimitScheduleResponse (..),
newPutBandwidthRateLimitScheduleResponse,
putBandwidthRateLimitScheduleResponse_gatewayArn,
putBandwidthRateLimitScheduleResponse_httpStatus,
)
where
import Amazonka.BackupGateway.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 PutBandwidthRateLimitSchedule = PutBandwidthRateLimitSchedule'
{
PutBandwidthRateLimitSchedule -> [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals :: [BandwidthRateLimitInterval],
PutBandwidthRateLimitSchedule -> Text
gatewayArn :: Prelude.Text
}
deriving (PutBandwidthRateLimitSchedule
-> PutBandwidthRateLimitSchedule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBandwidthRateLimitSchedule
-> PutBandwidthRateLimitSchedule -> Bool
$c/= :: PutBandwidthRateLimitSchedule
-> PutBandwidthRateLimitSchedule -> Bool
== :: PutBandwidthRateLimitSchedule
-> PutBandwidthRateLimitSchedule -> Bool
$c== :: PutBandwidthRateLimitSchedule
-> PutBandwidthRateLimitSchedule -> Bool
Prelude.Eq, ReadPrec [PutBandwidthRateLimitSchedule]
ReadPrec PutBandwidthRateLimitSchedule
Int -> ReadS PutBandwidthRateLimitSchedule
ReadS [PutBandwidthRateLimitSchedule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBandwidthRateLimitSchedule]
$creadListPrec :: ReadPrec [PutBandwidthRateLimitSchedule]
readPrec :: ReadPrec PutBandwidthRateLimitSchedule
$creadPrec :: ReadPrec PutBandwidthRateLimitSchedule
readList :: ReadS [PutBandwidthRateLimitSchedule]
$creadList :: ReadS [PutBandwidthRateLimitSchedule]
readsPrec :: Int -> ReadS PutBandwidthRateLimitSchedule
$creadsPrec :: Int -> ReadS PutBandwidthRateLimitSchedule
Prelude.Read, Int -> PutBandwidthRateLimitSchedule -> ShowS
[PutBandwidthRateLimitSchedule] -> ShowS
PutBandwidthRateLimitSchedule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBandwidthRateLimitSchedule] -> ShowS
$cshowList :: [PutBandwidthRateLimitSchedule] -> ShowS
show :: PutBandwidthRateLimitSchedule -> String
$cshow :: PutBandwidthRateLimitSchedule -> String
showsPrec :: Int -> PutBandwidthRateLimitSchedule -> ShowS
$cshowsPrec :: Int -> PutBandwidthRateLimitSchedule -> ShowS
Prelude.Show, forall x.
Rep PutBandwidthRateLimitSchedule x
-> PutBandwidthRateLimitSchedule
forall x.
PutBandwidthRateLimitSchedule
-> Rep PutBandwidthRateLimitSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBandwidthRateLimitSchedule x
-> PutBandwidthRateLimitSchedule
$cfrom :: forall x.
PutBandwidthRateLimitSchedule
-> Rep PutBandwidthRateLimitSchedule x
Prelude.Generic)
newPutBandwidthRateLimitSchedule ::
Prelude.Text ->
PutBandwidthRateLimitSchedule
newPutBandwidthRateLimitSchedule :: Text -> PutBandwidthRateLimitSchedule
newPutBandwidthRateLimitSchedule Text
pGatewayArn_ =
PutBandwidthRateLimitSchedule'
{ $sel:bandwidthRateLimitIntervals:PutBandwidthRateLimitSchedule' :: [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals =
forall a. Monoid a => a
Prelude.mempty,
$sel:gatewayArn:PutBandwidthRateLimitSchedule' :: Text
gatewayArn = Text
pGatewayArn_
}
putBandwidthRateLimitSchedule_bandwidthRateLimitIntervals :: Lens.Lens' PutBandwidthRateLimitSchedule [BandwidthRateLimitInterval]
putBandwidthRateLimitSchedule_bandwidthRateLimitIntervals :: Lens' PutBandwidthRateLimitSchedule [BandwidthRateLimitInterval]
putBandwidthRateLimitSchedule_bandwidthRateLimitIntervals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBandwidthRateLimitSchedule' {[BandwidthRateLimitInterval]
bandwidthRateLimitIntervals :: [BandwidthRateLimitInterval]
$sel:bandwidthRateLimitIntervals:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals} -> [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals) (\s :: PutBandwidthRateLimitSchedule
s@PutBandwidthRateLimitSchedule' {} [BandwidthRateLimitInterval]
a -> PutBandwidthRateLimitSchedule
s {$sel:bandwidthRateLimitIntervals:PutBandwidthRateLimitSchedule' :: [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals = [BandwidthRateLimitInterval]
a} :: PutBandwidthRateLimitSchedule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putBandwidthRateLimitSchedule_gatewayArn :: Lens.Lens' PutBandwidthRateLimitSchedule Prelude.Text
putBandwidthRateLimitSchedule_gatewayArn :: Lens' PutBandwidthRateLimitSchedule Text
putBandwidthRateLimitSchedule_gatewayArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBandwidthRateLimitSchedule' {Text
gatewayArn :: Text
$sel:gatewayArn:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> Text
gatewayArn} -> Text
gatewayArn) (\s :: PutBandwidthRateLimitSchedule
s@PutBandwidthRateLimitSchedule' {} Text
a -> PutBandwidthRateLimitSchedule
s {$sel:gatewayArn:PutBandwidthRateLimitSchedule' :: Text
gatewayArn = Text
a} :: PutBandwidthRateLimitSchedule)
instance
Core.AWSRequest
PutBandwidthRateLimitSchedule
where
type
AWSResponse PutBandwidthRateLimitSchedule =
PutBandwidthRateLimitScheduleResponse
request :: (Service -> Service)
-> PutBandwidthRateLimitSchedule
-> Request PutBandwidthRateLimitSchedule
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutBandwidthRateLimitSchedule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBandwidthRateLimitSchedule)))
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 ->
Maybe Text -> Int -> PutBandwidthRateLimitScheduleResponse
PutBandwidthRateLimitScheduleResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GatewayArn")
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
PutBandwidthRateLimitSchedule
where
hashWithSalt :: Int -> PutBandwidthRateLimitSchedule -> Int
hashWithSalt Int
_salt PutBandwidthRateLimitSchedule' {[BandwidthRateLimitInterval]
Text
gatewayArn :: Text
bandwidthRateLimitIntervals :: [BandwidthRateLimitInterval]
$sel:gatewayArn:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> Text
$sel:bandwidthRateLimitIntervals:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> [BandwidthRateLimitInterval]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayArn
instance Prelude.NFData PutBandwidthRateLimitSchedule where
rnf :: PutBandwidthRateLimitSchedule -> ()
rnf PutBandwidthRateLimitSchedule' {[BandwidthRateLimitInterval]
Text
gatewayArn :: Text
bandwidthRateLimitIntervals :: [BandwidthRateLimitInterval]
$sel:gatewayArn:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> Text
$sel:bandwidthRateLimitIntervals:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> [BandwidthRateLimitInterval]
..} =
forall a. NFData a => a -> ()
Prelude.rnf [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayArn
instance Data.ToHeaders PutBandwidthRateLimitSchedule where
toHeaders :: PutBandwidthRateLimitSchedule -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"BackupOnPremises_v20210101.PutBandwidthRateLimitSchedule" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutBandwidthRateLimitSchedule where
toJSON :: PutBandwidthRateLimitSchedule -> Value
toJSON PutBandwidthRateLimitSchedule' {[BandwidthRateLimitInterval]
Text
gatewayArn :: Text
bandwidthRateLimitIntervals :: [BandwidthRateLimitInterval]
$sel:gatewayArn:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> Text
$sel:bandwidthRateLimitIntervals:PutBandwidthRateLimitSchedule' :: PutBandwidthRateLimitSchedule -> [BandwidthRateLimitInterval]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"BandwidthRateLimitIntervals"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [BandwidthRateLimitInterval]
bandwidthRateLimitIntervals
),
forall a. a -> Maybe a
Prelude.Just (Key
"GatewayArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayArn)
]
)
instance Data.ToPath PutBandwidthRateLimitSchedule where
toPath :: PutBandwidthRateLimitSchedule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutBandwidthRateLimitSchedule where
toQuery :: PutBandwidthRateLimitSchedule -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutBandwidthRateLimitScheduleResponse = PutBandwidthRateLimitScheduleResponse'
{
PutBandwidthRateLimitScheduleResponse -> Maybe Text
gatewayArn :: Prelude.Maybe Prelude.Text,
PutBandwidthRateLimitScheduleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutBandwidthRateLimitScheduleResponse
-> PutBandwidthRateLimitScheduleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBandwidthRateLimitScheduleResponse
-> PutBandwidthRateLimitScheduleResponse -> Bool
$c/= :: PutBandwidthRateLimitScheduleResponse
-> PutBandwidthRateLimitScheduleResponse -> Bool
== :: PutBandwidthRateLimitScheduleResponse
-> PutBandwidthRateLimitScheduleResponse -> Bool
$c== :: PutBandwidthRateLimitScheduleResponse
-> PutBandwidthRateLimitScheduleResponse -> Bool
Prelude.Eq, ReadPrec [PutBandwidthRateLimitScheduleResponse]
ReadPrec PutBandwidthRateLimitScheduleResponse
Int -> ReadS PutBandwidthRateLimitScheduleResponse
ReadS [PutBandwidthRateLimitScheduleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBandwidthRateLimitScheduleResponse]
$creadListPrec :: ReadPrec [PutBandwidthRateLimitScheduleResponse]
readPrec :: ReadPrec PutBandwidthRateLimitScheduleResponse
$creadPrec :: ReadPrec PutBandwidthRateLimitScheduleResponse
readList :: ReadS [PutBandwidthRateLimitScheduleResponse]
$creadList :: ReadS [PutBandwidthRateLimitScheduleResponse]
readsPrec :: Int -> ReadS PutBandwidthRateLimitScheduleResponse
$creadsPrec :: Int -> ReadS PutBandwidthRateLimitScheduleResponse
Prelude.Read, Int -> PutBandwidthRateLimitScheduleResponse -> ShowS
[PutBandwidthRateLimitScheduleResponse] -> ShowS
PutBandwidthRateLimitScheduleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBandwidthRateLimitScheduleResponse] -> ShowS
$cshowList :: [PutBandwidthRateLimitScheduleResponse] -> ShowS
show :: PutBandwidthRateLimitScheduleResponse -> String
$cshow :: PutBandwidthRateLimitScheduleResponse -> String
showsPrec :: Int -> PutBandwidthRateLimitScheduleResponse -> ShowS
$cshowsPrec :: Int -> PutBandwidthRateLimitScheduleResponse -> ShowS
Prelude.Show, forall x.
Rep PutBandwidthRateLimitScheduleResponse x
-> PutBandwidthRateLimitScheduleResponse
forall x.
PutBandwidthRateLimitScheduleResponse
-> Rep PutBandwidthRateLimitScheduleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBandwidthRateLimitScheduleResponse x
-> PutBandwidthRateLimitScheduleResponse
$cfrom :: forall x.
PutBandwidthRateLimitScheduleResponse
-> Rep PutBandwidthRateLimitScheduleResponse x
Prelude.Generic)
newPutBandwidthRateLimitScheduleResponse ::
Prelude.Int ->
PutBandwidthRateLimitScheduleResponse
newPutBandwidthRateLimitScheduleResponse :: Int -> PutBandwidthRateLimitScheduleResponse
newPutBandwidthRateLimitScheduleResponse Int
pHttpStatus_ =
PutBandwidthRateLimitScheduleResponse'
{ $sel:gatewayArn:PutBandwidthRateLimitScheduleResponse' :: Maybe Text
gatewayArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutBandwidthRateLimitScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putBandwidthRateLimitScheduleResponse_gatewayArn :: Lens.Lens' PutBandwidthRateLimitScheduleResponse (Prelude.Maybe Prelude.Text)
putBandwidthRateLimitScheduleResponse_gatewayArn :: Lens' PutBandwidthRateLimitScheduleResponse (Maybe Text)
putBandwidthRateLimitScheduleResponse_gatewayArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBandwidthRateLimitScheduleResponse' {Maybe Text
gatewayArn :: Maybe Text
$sel:gatewayArn:PutBandwidthRateLimitScheduleResponse' :: PutBandwidthRateLimitScheduleResponse -> Maybe Text
gatewayArn} -> Maybe Text
gatewayArn) (\s :: PutBandwidthRateLimitScheduleResponse
s@PutBandwidthRateLimitScheduleResponse' {} Maybe Text
a -> PutBandwidthRateLimitScheduleResponse
s {$sel:gatewayArn:PutBandwidthRateLimitScheduleResponse' :: Maybe Text
gatewayArn = Maybe Text
a} :: PutBandwidthRateLimitScheduleResponse)
putBandwidthRateLimitScheduleResponse_httpStatus :: Lens.Lens' PutBandwidthRateLimitScheduleResponse Prelude.Int
putBandwidthRateLimitScheduleResponse_httpStatus :: Lens' PutBandwidthRateLimitScheduleResponse Int
putBandwidthRateLimitScheduleResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBandwidthRateLimitScheduleResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutBandwidthRateLimitScheduleResponse' :: PutBandwidthRateLimitScheduleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutBandwidthRateLimitScheduleResponse
s@PutBandwidthRateLimitScheduleResponse' {} Int
a -> PutBandwidthRateLimitScheduleResponse
s {$sel:httpStatus:PutBandwidthRateLimitScheduleResponse' :: Int
httpStatus = Int
a} :: PutBandwidthRateLimitScheduleResponse)
instance
Prelude.NFData
PutBandwidthRateLimitScheduleResponse
where
rnf :: PutBandwidthRateLimitScheduleResponse -> ()
rnf PutBandwidthRateLimitScheduleResponse' {Int
Maybe Text
httpStatus :: Int
gatewayArn :: Maybe Text
$sel:httpStatus:PutBandwidthRateLimitScheduleResponse' :: PutBandwidthRateLimitScheduleResponse -> Int
$sel:gatewayArn:PutBandwidthRateLimitScheduleResponse' :: PutBandwidthRateLimitScheduleResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus