{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:bucketName:UpdateBucketBundle' :: Text
bucketName = Text
pBucketName_,
$sel:bundleId:UpdateBucketBundle' :: Text
bundleId = Text
pBundleId_
}
updateBucketBundle_bucketName :: Lens.Lens' UpdateBucketBundle Prelude.Text
updateBucketBundle_bucketName :: Lens' UpdateBucketBundle Text
updateBucketBundle_bucketName = 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 :: Lens' UpdateBucketBundle Text
updateBucketBundle_bundleId = 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 :: (Service -> Service)
-> UpdateBucketBundle -> Request UpdateBucketBundle
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 UpdateBucketBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateBucketBundle)))
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 [Operation] -> Int -> UpdateBucketBundleResponse
UpdateBucketBundleResponse'
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
"operations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 UpdateBucketBundle where
hashWithSalt :: Int -> UpdateBucketBundle -> Int
hashWithSalt Int
_salt UpdateBucketBundle' {Text
bundleId :: Text
bucketName :: Text
$sel:bundleId:UpdateBucketBundle' :: UpdateBucketBundle -> Text
$sel:bucketName:UpdateBucketBundle' :: UpdateBucketBundle -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bucketName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bundleId
instance Prelude.NFData UpdateBucketBundle where
rnf :: UpdateBucketBundle -> ()
rnf UpdateBucketBundle' {Text
bundleId :: Text
bucketName :: Text
$sel:bundleId:UpdateBucketBundle' :: UpdateBucketBundle -> Text
$sel:bucketName:UpdateBucketBundle' :: UpdateBucketBundle -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
bucketName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
bundleId
instance Data.ToHeaders UpdateBucketBundle where
toHeaders :: UpdateBucketBundle -> 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
"Lightsail_20161128.UpdateBucketBundle" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"bucketName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
bucketName),
forall a. a -> Maybe a
Prelude.Just (Key
"bundleId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
bundleId)
]
)
instance Data.ToPath UpdateBucketBundle where
toPath :: UpdateBucketBundle -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateBucketBundle where
toQuery :: UpdateBucketBundle -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:operations:UpdateBucketBundleResponse' :: Maybe [Operation]
operations =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateBucketBundleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateBucketBundleResponse_operations :: Lens.Lens' UpdateBucketBundleResponse (Prelude.Maybe [Operation])
updateBucketBundleResponse_operations :: Lens' UpdateBucketBundleResponse (Maybe [Operation])
updateBucketBundleResponse_operations = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' UpdateBucketBundleResponse Int
updateBucketBundleResponse_httpStatus = 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 where
rnf :: UpdateBucketBundleResponse -> ()
rnf UpdateBucketBundleResponse' {Int
Maybe [Operation]
httpStatus :: Int
operations :: Maybe [Operation]
$sel:httpStatus:UpdateBucketBundleResponse' :: UpdateBucketBundleResponse -> Int
$sel:operations:UpdateBucketBundleResponse' :: UpdateBucketBundleResponse -> Maybe [Operation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Operation]
operations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus