{-# 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.Lightsail.UpdateDistributionBundle
(
UpdateDistributionBundle (..),
newUpdateDistributionBundle,
updateDistributionBundle_bundleId,
updateDistributionBundle_distributionName,
UpdateDistributionBundleResponse (..),
newUpdateDistributionBundleResponse,
updateDistributionBundleResponse_operation,
updateDistributionBundleResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateDistributionBundle = UpdateDistributionBundle'
{
UpdateDistributionBundle -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
UpdateDistributionBundle -> Maybe Text
distributionName :: Prelude.Maybe Prelude.Text
}
deriving (UpdateDistributionBundle -> UpdateDistributionBundle -> Bool
(UpdateDistributionBundle -> UpdateDistributionBundle -> Bool)
-> (UpdateDistributionBundle -> UpdateDistributionBundle -> Bool)
-> Eq UpdateDistributionBundle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDistributionBundle -> UpdateDistributionBundle -> Bool
$c/= :: UpdateDistributionBundle -> UpdateDistributionBundle -> Bool
== :: UpdateDistributionBundle -> UpdateDistributionBundle -> Bool
$c== :: UpdateDistributionBundle -> UpdateDistributionBundle -> Bool
Prelude.Eq, ReadPrec [UpdateDistributionBundle]
ReadPrec UpdateDistributionBundle
Int -> ReadS UpdateDistributionBundle
ReadS [UpdateDistributionBundle]
(Int -> ReadS UpdateDistributionBundle)
-> ReadS [UpdateDistributionBundle]
-> ReadPrec UpdateDistributionBundle
-> ReadPrec [UpdateDistributionBundle]
-> Read UpdateDistributionBundle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDistributionBundle]
$creadListPrec :: ReadPrec [UpdateDistributionBundle]
readPrec :: ReadPrec UpdateDistributionBundle
$creadPrec :: ReadPrec UpdateDistributionBundle
readList :: ReadS [UpdateDistributionBundle]
$creadList :: ReadS [UpdateDistributionBundle]
readsPrec :: Int -> ReadS UpdateDistributionBundle
$creadsPrec :: Int -> ReadS UpdateDistributionBundle
Prelude.Read, Int -> UpdateDistributionBundle -> ShowS
[UpdateDistributionBundle] -> ShowS
UpdateDistributionBundle -> String
(Int -> UpdateDistributionBundle -> ShowS)
-> (UpdateDistributionBundle -> String)
-> ([UpdateDistributionBundle] -> ShowS)
-> Show UpdateDistributionBundle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDistributionBundle] -> ShowS
$cshowList :: [UpdateDistributionBundle] -> ShowS
show :: UpdateDistributionBundle -> String
$cshow :: UpdateDistributionBundle -> String
showsPrec :: Int -> UpdateDistributionBundle -> ShowS
$cshowsPrec :: Int -> UpdateDistributionBundle -> ShowS
Prelude.Show, (forall x.
UpdateDistributionBundle -> Rep UpdateDistributionBundle x)
-> (forall x.
Rep UpdateDistributionBundle x -> UpdateDistributionBundle)
-> Generic UpdateDistributionBundle
forall x.
Rep UpdateDistributionBundle x -> UpdateDistributionBundle
forall x.
UpdateDistributionBundle -> Rep UpdateDistributionBundle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDistributionBundle x -> UpdateDistributionBundle
$cfrom :: forall x.
UpdateDistributionBundle -> Rep UpdateDistributionBundle x
Prelude.Generic)
newUpdateDistributionBundle ::
UpdateDistributionBundle
newUpdateDistributionBundle :: UpdateDistributionBundle
newUpdateDistributionBundle =
UpdateDistributionBundle' :: Maybe Text -> Maybe Text -> UpdateDistributionBundle
UpdateDistributionBundle'
{ $sel:bundleId:UpdateDistributionBundle' :: Maybe Text
bundleId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:distributionName:UpdateDistributionBundle' :: Maybe Text
distributionName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
updateDistributionBundle_bundleId :: Lens.Lens' UpdateDistributionBundle (Prelude.Maybe Prelude.Text)
updateDistributionBundle_bundleId :: (Maybe Text -> f (Maybe Text))
-> UpdateDistributionBundle -> f UpdateDistributionBundle
updateDistributionBundle_bundleId = (UpdateDistributionBundle -> Maybe Text)
-> (UpdateDistributionBundle
-> Maybe Text -> UpdateDistributionBundle)
-> Lens
UpdateDistributionBundle
UpdateDistributionBundle
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDistributionBundle' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:UpdateDistributionBundle' :: UpdateDistributionBundle -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: UpdateDistributionBundle
s@UpdateDistributionBundle' {} Maybe Text
a -> UpdateDistributionBundle
s {$sel:bundleId:UpdateDistributionBundle' :: Maybe Text
bundleId = Maybe Text
a} :: UpdateDistributionBundle)
updateDistributionBundle_distributionName :: Lens.Lens' UpdateDistributionBundle (Prelude.Maybe Prelude.Text)
updateDistributionBundle_distributionName :: (Maybe Text -> f (Maybe Text))
-> UpdateDistributionBundle -> f UpdateDistributionBundle
updateDistributionBundle_distributionName = (UpdateDistributionBundle -> Maybe Text)
-> (UpdateDistributionBundle
-> Maybe Text -> UpdateDistributionBundle)
-> Lens
UpdateDistributionBundle
UpdateDistributionBundle
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDistributionBundle' {Maybe Text
distributionName :: Maybe Text
$sel:distributionName:UpdateDistributionBundle' :: UpdateDistributionBundle -> Maybe Text
distributionName} -> Maybe Text
distributionName) (\s :: UpdateDistributionBundle
s@UpdateDistributionBundle' {} Maybe Text
a -> UpdateDistributionBundle
s {$sel:distributionName:UpdateDistributionBundle' :: Maybe Text
distributionName = Maybe Text
a} :: UpdateDistributionBundle)
instance Core.AWSRequest UpdateDistributionBundle where
type
AWSResponse UpdateDistributionBundle =
UpdateDistributionBundleResponse
request :: UpdateDistributionBundle -> Request UpdateDistributionBundle
request = Service
-> UpdateDistributionBundle -> Request UpdateDistributionBundle
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDistributionBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDistributionBundle)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateDistributionBundle))
-> Logger
-> Service
-> Proxy UpdateDistributionBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDistributionBundle)))
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 Operation -> Int -> UpdateDistributionBundleResponse
UpdateDistributionBundleResponse'
(Maybe Operation -> Int -> UpdateDistributionBundleResponse)
-> Either String (Maybe Operation)
-> Either String (Int -> UpdateDistributionBundleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Operation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operation")
Either String (Int -> UpdateDistributionBundleResponse)
-> Either String Int
-> Either String UpdateDistributionBundleResponse
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 UpdateDistributionBundle
instance Prelude.NFData UpdateDistributionBundle
instance Core.ToHeaders UpdateDistributionBundle where
toHeaders :: UpdateDistributionBundle -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDistributionBundle -> 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
"Lightsail_20161128.UpdateDistributionBundle" ::
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 UpdateDistributionBundle where
toJSON :: UpdateDistributionBundle -> Value
toJSON UpdateDistributionBundle' {Maybe Text
distributionName :: Maybe Text
bundleId :: Maybe Text
$sel:distributionName:UpdateDistributionBundle' :: UpdateDistributionBundle -> Maybe Text
$sel:bundleId:UpdateDistributionBundle' :: UpdateDistributionBundle -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"bundleId" 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
bundleId,
(Text
"distributionName" 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
distributionName
]
)
instance Core.ToPath UpdateDistributionBundle where
toPath :: UpdateDistributionBundle -> ByteString
toPath = ByteString -> UpdateDistributionBundle -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateDistributionBundle where
toQuery :: UpdateDistributionBundle -> QueryString
toQuery = QueryString -> UpdateDistributionBundle -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDistributionBundleResponse = UpdateDistributionBundleResponse'
{ UpdateDistributionBundleResponse -> Maybe Operation
operation :: Prelude.Maybe Operation,
UpdateDistributionBundleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDistributionBundleResponse
-> UpdateDistributionBundleResponse -> Bool
(UpdateDistributionBundleResponse
-> UpdateDistributionBundleResponse -> Bool)
-> (UpdateDistributionBundleResponse
-> UpdateDistributionBundleResponse -> Bool)
-> Eq UpdateDistributionBundleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDistributionBundleResponse
-> UpdateDistributionBundleResponse -> Bool
$c/= :: UpdateDistributionBundleResponse
-> UpdateDistributionBundleResponse -> Bool
== :: UpdateDistributionBundleResponse
-> UpdateDistributionBundleResponse -> Bool
$c== :: UpdateDistributionBundleResponse
-> UpdateDistributionBundleResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDistributionBundleResponse]
ReadPrec UpdateDistributionBundleResponse
Int -> ReadS UpdateDistributionBundleResponse
ReadS [UpdateDistributionBundleResponse]
(Int -> ReadS UpdateDistributionBundleResponse)
-> ReadS [UpdateDistributionBundleResponse]
-> ReadPrec UpdateDistributionBundleResponse
-> ReadPrec [UpdateDistributionBundleResponse]
-> Read UpdateDistributionBundleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDistributionBundleResponse]
$creadListPrec :: ReadPrec [UpdateDistributionBundleResponse]
readPrec :: ReadPrec UpdateDistributionBundleResponse
$creadPrec :: ReadPrec UpdateDistributionBundleResponse
readList :: ReadS [UpdateDistributionBundleResponse]
$creadList :: ReadS [UpdateDistributionBundleResponse]
readsPrec :: Int -> ReadS UpdateDistributionBundleResponse
$creadsPrec :: Int -> ReadS UpdateDistributionBundleResponse
Prelude.Read, Int -> UpdateDistributionBundleResponse -> ShowS
[UpdateDistributionBundleResponse] -> ShowS
UpdateDistributionBundleResponse -> String
(Int -> UpdateDistributionBundleResponse -> ShowS)
-> (UpdateDistributionBundleResponse -> String)
-> ([UpdateDistributionBundleResponse] -> ShowS)
-> Show UpdateDistributionBundleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDistributionBundleResponse] -> ShowS
$cshowList :: [UpdateDistributionBundleResponse] -> ShowS
show :: UpdateDistributionBundleResponse -> String
$cshow :: UpdateDistributionBundleResponse -> String
showsPrec :: Int -> UpdateDistributionBundleResponse -> ShowS
$cshowsPrec :: Int -> UpdateDistributionBundleResponse -> ShowS
Prelude.Show, (forall x.
UpdateDistributionBundleResponse
-> Rep UpdateDistributionBundleResponse x)
-> (forall x.
Rep UpdateDistributionBundleResponse x
-> UpdateDistributionBundleResponse)
-> Generic UpdateDistributionBundleResponse
forall x.
Rep UpdateDistributionBundleResponse x
-> UpdateDistributionBundleResponse
forall x.
UpdateDistributionBundleResponse
-> Rep UpdateDistributionBundleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDistributionBundleResponse x
-> UpdateDistributionBundleResponse
$cfrom :: forall x.
UpdateDistributionBundleResponse
-> Rep UpdateDistributionBundleResponse x
Prelude.Generic)
newUpdateDistributionBundleResponse ::
Prelude.Int ->
UpdateDistributionBundleResponse
newUpdateDistributionBundleResponse :: Int -> UpdateDistributionBundleResponse
newUpdateDistributionBundleResponse Int
pHttpStatus_ =
UpdateDistributionBundleResponse' :: Maybe Operation -> Int -> UpdateDistributionBundleResponse
UpdateDistributionBundleResponse'
{ $sel:operation:UpdateDistributionBundleResponse' :: Maybe Operation
operation =
Maybe Operation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateDistributionBundleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateDistributionBundleResponse_operation :: Lens.Lens' UpdateDistributionBundleResponse (Prelude.Maybe Operation)
updateDistributionBundleResponse_operation :: (Maybe Operation -> f (Maybe Operation))
-> UpdateDistributionBundleResponse
-> f UpdateDistributionBundleResponse
updateDistributionBundleResponse_operation = (UpdateDistributionBundleResponse -> Maybe Operation)
-> (UpdateDistributionBundleResponse
-> Maybe Operation -> UpdateDistributionBundleResponse)
-> Lens
UpdateDistributionBundleResponse
UpdateDistributionBundleResponse
(Maybe Operation)
(Maybe Operation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDistributionBundleResponse' {Maybe Operation
operation :: Maybe Operation
$sel:operation:UpdateDistributionBundleResponse' :: UpdateDistributionBundleResponse -> Maybe Operation
operation} -> Maybe Operation
operation) (\s :: UpdateDistributionBundleResponse
s@UpdateDistributionBundleResponse' {} Maybe Operation
a -> UpdateDistributionBundleResponse
s {$sel:operation:UpdateDistributionBundleResponse' :: Maybe Operation
operation = Maybe Operation
a} :: UpdateDistributionBundleResponse)
updateDistributionBundleResponse_httpStatus :: Lens.Lens' UpdateDistributionBundleResponse Prelude.Int
updateDistributionBundleResponse_httpStatus :: (Int -> f Int)
-> UpdateDistributionBundleResponse
-> f UpdateDistributionBundleResponse
updateDistributionBundleResponse_httpStatus = (UpdateDistributionBundleResponse -> Int)
-> (UpdateDistributionBundleResponse
-> Int -> UpdateDistributionBundleResponse)
-> Lens
UpdateDistributionBundleResponse
UpdateDistributionBundleResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDistributionBundleResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDistributionBundleResponse' :: UpdateDistributionBundleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDistributionBundleResponse
s@UpdateDistributionBundleResponse' {} Int
a -> UpdateDistributionBundleResponse
s {$sel:httpStatus:UpdateDistributionBundleResponse' :: Int
httpStatus = Int
a} :: UpdateDistributionBundleResponse)
instance
Prelude.NFData
UpdateDistributionBundleResponse