{-# 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.UpdateBucketBundle
(
UpdateBucketBundle (..),
newUpdateBucketBundle,
updateBucketBundle_bucketName,
updateBucketBundle_bundleId,
UpdateBucketBundleResponse (..),
newUpdateBucketBundleResponse,
updateBucketBundleResponse_operations,
updateBucketBundleResponse_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 UpdateBucketBundle = UpdateBucketBundle'
{
UpdateBucketBundle -> Text
bucketName :: Prelude.Text,
UpdateBucketBundle -> Text
bundleId :: Prelude.Text
}
deriving (UpdateBucketBundle -> UpdateBucketBundle -> Bool
(UpdateBucketBundle -> UpdateBucketBundle -> Bool)
-> (UpdateBucketBundle -> UpdateBucketBundle -> Bool)
-> Eq UpdateBucketBundle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBucketBundle -> UpdateBucketBundle -> Bool
$c/= :: UpdateBucketBundle -> UpdateBucketBundle -> Bool
== :: UpdateBucketBundle -> UpdateBucketBundle -> Bool
$c== :: UpdateBucketBundle -> UpdateBucketBundle -> Bool
Prelude.Eq, ReadPrec [UpdateBucketBundle]
ReadPrec UpdateBucketBundle
Int -> ReadS UpdateBucketBundle
ReadS [UpdateBucketBundle]
(Int -> ReadS UpdateBucketBundle)
-> ReadS [UpdateBucketBundle]
-> ReadPrec UpdateBucketBundle
-> ReadPrec [UpdateBucketBundle]
-> Read UpdateBucketBundle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBucketBundle]
$creadListPrec :: ReadPrec [UpdateBucketBundle]
readPrec :: ReadPrec UpdateBucketBundle
$creadPrec :: ReadPrec UpdateBucketBundle
readList :: ReadS [UpdateBucketBundle]
$creadList :: ReadS [UpdateBucketBundle]
readsPrec :: Int -> ReadS UpdateBucketBundle
$creadsPrec :: Int -> ReadS UpdateBucketBundle
Prelude.Read, Int -> UpdateBucketBundle -> ShowS
[UpdateBucketBundle] -> ShowS
UpdateBucketBundle -> String
(Int -> UpdateBucketBundle -> ShowS)
-> (UpdateBucketBundle -> String)
-> ([UpdateBucketBundle] -> ShowS)
-> Show UpdateBucketBundle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBucketBundle] -> ShowS
$cshowList :: [UpdateBucketBundle] -> ShowS
show :: UpdateBucketBundle -> String
$cshow :: UpdateBucketBundle -> String
showsPrec :: Int -> UpdateBucketBundle -> ShowS
$cshowsPrec :: Int -> UpdateBucketBundle -> ShowS
Prelude.Show, (forall x. UpdateBucketBundle -> Rep UpdateBucketBundle x)
-> (forall x. Rep UpdateBucketBundle x -> UpdateBucketBundle)
-> Generic UpdateBucketBundle
forall x. Rep UpdateBucketBundle x -> UpdateBucketBundle
forall x. UpdateBucketBundle -> Rep UpdateBucketBundle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBucketBundle x -> UpdateBucketBundle
$cfrom :: forall x. UpdateBucketBundle -> Rep UpdateBucketBundle x
Prelude.Generic)
newUpdateBucketBundle ::
Prelude.Text ->
Prelude.Text ->
UpdateBucketBundle
newUpdateBucketBundle :: Text -> Text -> UpdateBucketBundle
newUpdateBucketBundle Text
pBucketName_ Text
pBundleId_ =
UpdateBucketBundle' :: Text -> Text -> UpdateBucketBundle
UpdateBucketBundle'
{ $sel:bucketName:UpdateBucketBundle' :: Text
bucketName = Text
pBucketName_,
$sel:bundleId:UpdateBucketBundle' :: Text
bundleId = Text
pBundleId_
}
updateBucketBundle_bucketName :: Lens.Lens' UpdateBucketBundle Prelude.Text
updateBucketBundle_bucketName :: (Text -> f Text) -> UpdateBucketBundle -> f UpdateBucketBundle
updateBucketBundle_bucketName = (UpdateBucketBundle -> Text)
-> (UpdateBucketBundle -> Text -> UpdateBucketBundle)
-> Lens UpdateBucketBundle UpdateBucketBundle Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucketBundle' {Text
bucketName :: Text
$sel:bucketName:UpdateBucketBundle' :: UpdateBucketBundle -> Text
bucketName} -> Text
bucketName) (\s :: UpdateBucketBundle
s@UpdateBucketBundle' {} Text
a -> UpdateBucketBundle
s {$sel:bucketName:UpdateBucketBundle' :: Text
bucketName = Text
a} :: UpdateBucketBundle)
updateBucketBundle_bundleId :: Lens.Lens' UpdateBucketBundle Prelude.Text
updateBucketBundle_bundleId :: (Text -> f Text) -> UpdateBucketBundle -> f UpdateBucketBundle
updateBucketBundle_bundleId = (UpdateBucketBundle -> Text)
-> (UpdateBucketBundle -> Text -> UpdateBucketBundle)
-> Lens UpdateBucketBundle UpdateBucketBundle Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucketBundle' {Text
bundleId :: Text
$sel:bundleId:UpdateBucketBundle' :: UpdateBucketBundle -> Text
bundleId} -> Text
bundleId) (\s :: UpdateBucketBundle
s@UpdateBucketBundle' {} Text
a -> UpdateBucketBundle
s {$sel:bundleId:UpdateBucketBundle' :: Text
bundleId = Text
a} :: UpdateBucketBundle)
instance Core.AWSRequest UpdateBucketBundle where
type
AWSResponse UpdateBucketBundle =
UpdateBucketBundleResponse
request :: UpdateBucketBundle -> Request UpdateBucketBundle
request = Service -> UpdateBucketBundle -> Request UpdateBucketBundle
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateBucketBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateBucketBundle)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateBucketBundle))
-> Logger
-> Service
-> Proxy UpdateBucketBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateBucketBundle)))
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 -> UpdateBucketBundleResponse
UpdateBucketBundleResponse'
(Maybe [Operation] -> Int -> UpdateBucketBundleResponse)
-> Either String (Maybe [Operation])
-> Either String (Int -> UpdateBucketBundleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Operation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operations" Either String (Maybe (Maybe [Operation]))
-> Maybe [Operation] -> Either String (Maybe [Operation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Operation]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> UpdateBucketBundleResponse)
-> Either String Int -> Either String UpdateBucketBundleResponse
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 UpdateBucketBundle
instance Prelude.NFData UpdateBucketBundle
instance Core.ToHeaders UpdateBucketBundle where
toHeaders :: UpdateBucketBundle -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateBucketBundle -> 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.UpdateBucketBundle" ::
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 UpdateBucketBundle where
toJSON :: UpdateBucketBundle -> Value
toJSON UpdateBucketBundle' {Text
bundleId :: Text
bucketName :: Text
$sel:bundleId:UpdateBucketBundle' :: UpdateBucketBundle -> Text
$sel:bucketName:UpdateBucketBundle' :: UpdateBucketBundle -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"bucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucketName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"bundleId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bundleId)
]
)
instance Core.ToPath UpdateBucketBundle where
toPath :: UpdateBucketBundle -> ByteString
toPath = ByteString -> UpdateBucketBundle -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateBucketBundle where
toQuery :: UpdateBucketBundle -> QueryString
toQuery = QueryString -> UpdateBucketBundle -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateBucketBundleResponse = UpdateBucketBundleResponse'
{
UpdateBucketBundleResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
UpdateBucketBundleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateBucketBundleResponse -> UpdateBucketBundleResponse -> Bool
(UpdateBucketBundleResponse -> UpdateBucketBundleResponse -> Bool)
-> (UpdateBucketBundleResponse
-> UpdateBucketBundleResponse -> Bool)
-> Eq UpdateBucketBundleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBucketBundleResponse -> UpdateBucketBundleResponse -> Bool
$c/= :: UpdateBucketBundleResponse -> UpdateBucketBundleResponse -> Bool
== :: UpdateBucketBundleResponse -> UpdateBucketBundleResponse -> Bool
$c== :: UpdateBucketBundleResponse -> UpdateBucketBundleResponse -> Bool
Prelude.Eq, ReadPrec [UpdateBucketBundleResponse]
ReadPrec UpdateBucketBundleResponse
Int -> ReadS UpdateBucketBundleResponse
ReadS [UpdateBucketBundleResponse]
(Int -> ReadS UpdateBucketBundleResponse)
-> ReadS [UpdateBucketBundleResponse]
-> ReadPrec UpdateBucketBundleResponse
-> ReadPrec [UpdateBucketBundleResponse]
-> Read UpdateBucketBundleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBucketBundleResponse]
$creadListPrec :: ReadPrec [UpdateBucketBundleResponse]
readPrec :: ReadPrec UpdateBucketBundleResponse
$creadPrec :: ReadPrec UpdateBucketBundleResponse
readList :: ReadS [UpdateBucketBundleResponse]
$creadList :: ReadS [UpdateBucketBundleResponse]
readsPrec :: Int -> ReadS UpdateBucketBundleResponse
$creadsPrec :: Int -> ReadS UpdateBucketBundleResponse
Prelude.Read, Int -> UpdateBucketBundleResponse -> ShowS
[UpdateBucketBundleResponse] -> ShowS
UpdateBucketBundleResponse -> String
(Int -> UpdateBucketBundleResponse -> ShowS)
-> (UpdateBucketBundleResponse -> String)
-> ([UpdateBucketBundleResponse] -> ShowS)
-> Show UpdateBucketBundleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBucketBundleResponse] -> ShowS
$cshowList :: [UpdateBucketBundleResponse] -> ShowS
show :: UpdateBucketBundleResponse -> String
$cshow :: UpdateBucketBundleResponse -> String
showsPrec :: Int -> UpdateBucketBundleResponse -> ShowS
$cshowsPrec :: Int -> UpdateBucketBundleResponse -> ShowS
Prelude.Show, (forall x.
UpdateBucketBundleResponse -> Rep UpdateBucketBundleResponse x)
-> (forall x.
Rep UpdateBucketBundleResponse x -> UpdateBucketBundleResponse)
-> Generic UpdateBucketBundleResponse
forall x.
Rep UpdateBucketBundleResponse x -> UpdateBucketBundleResponse
forall x.
UpdateBucketBundleResponse -> Rep UpdateBucketBundleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateBucketBundleResponse x -> UpdateBucketBundleResponse
$cfrom :: forall x.
UpdateBucketBundleResponse -> Rep UpdateBucketBundleResponse x
Prelude.Generic)
newUpdateBucketBundleResponse ::
Prelude.Int ->
UpdateBucketBundleResponse
newUpdateBucketBundleResponse :: Int -> UpdateBucketBundleResponse
newUpdateBucketBundleResponse Int
pHttpStatus_ =
UpdateBucketBundleResponse' :: Maybe [Operation] -> Int -> UpdateBucketBundleResponse
UpdateBucketBundleResponse'
{ $sel:operations:UpdateBucketBundleResponse' :: Maybe [Operation]
operations =
Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateBucketBundleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateBucketBundleResponse_operations :: Lens.Lens' UpdateBucketBundleResponse (Prelude.Maybe [Operation])
updateBucketBundleResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> UpdateBucketBundleResponse -> f UpdateBucketBundleResponse
updateBucketBundleResponse_operations = (UpdateBucketBundleResponse -> Maybe [Operation])
-> (UpdateBucketBundleResponse
-> Maybe [Operation] -> UpdateBucketBundleResponse)
-> Lens
UpdateBucketBundleResponse
UpdateBucketBundleResponse
(Maybe [Operation])
(Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucketBundleResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:UpdateBucketBundleResponse' :: UpdateBucketBundleResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: UpdateBucketBundleResponse
s@UpdateBucketBundleResponse' {} Maybe [Operation]
a -> UpdateBucketBundleResponse
s {$sel:operations:UpdateBucketBundleResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: UpdateBucketBundleResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
-> UpdateBucketBundleResponse -> f UpdateBucketBundleResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
-> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> UpdateBucketBundleResponse
-> f UpdateBucketBundleResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Operation] [Operation] [Operation] [Operation]
-> Iso
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
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 [Operation] [Operation] [Operation] [Operation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateBucketBundleResponse_httpStatus :: Lens.Lens' UpdateBucketBundleResponse Prelude.Int
updateBucketBundleResponse_httpStatus :: (Int -> f Int)
-> UpdateBucketBundleResponse -> f UpdateBucketBundleResponse
updateBucketBundleResponse_httpStatus = (UpdateBucketBundleResponse -> Int)
-> (UpdateBucketBundleResponse
-> Int -> UpdateBucketBundleResponse)
-> Lens
UpdateBucketBundleResponse UpdateBucketBundleResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucketBundleResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateBucketBundleResponse' :: UpdateBucketBundleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateBucketBundleResponse
s@UpdateBucketBundleResponse' {} Int
a -> UpdateBucketBundleResponse
s {$sel:httpStatus:UpdateBucketBundleResponse' :: Int
httpStatus = Int
a} :: UpdateBucketBundleResponse)
instance Prelude.NFData UpdateBucketBundleResponse