{-# 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.QuickSight.UpdateFolder
(
UpdateFolder (..),
newUpdateFolder,
updateFolder_awsAccountId,
updateFolder_folderId,
updateFolder_name,
UpdateFolderResponse (..),
newUpdateFolderResponse,
updateFolderResponse_requestId,
updateFolderResponse_arn,
updateFolderResponse_folderId,
updateFolderResponse_status,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateFolder = UpdateFolder'
{
UpdateFolder -> Text
awsAccountId :: Prelude.Text,
UpdateFolder -> Text
folderId :: Prelude.Text,
UpdateFolder -> Text
name :: Prelude.Text
}
deriving (UpdateFolder -> UpdateFolder -> Bool
(UpdateFolder -> UpdateFolder -> Bool)
-> (UpdateFolder -> UpdateFolder -> Bool) -> Eq UpdateFolder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFolder -> UpdateFolder -> Bool
$c/= :: UpdateFolder -> UpdateFolder -> Bool
== :: UpdateFolder -> UpdateFolder -> Bool
$c== :: UpdateFolder -> UpdateFolder -> Bool
Prelude.Eq, ReadPrec [UpdateFolder]
ReadPrec UpdateFolder
Int -> ReadS UpdateFolder
ReadS [UpdateFolder]
(Int -> ReadS UpdateFolder)
-> ReadS [UpdateFolder]
-> ReadPrec UpdateFolder
-> ReadPrec [UpdateFolder]
-> Read UpdateFolder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFolder]
$creadListPrec :: ReadPrec [UpdateFolder]
readPrec :: ReadPrec UpdateFolder
$creadPrec :: ReadPrec UpdateFolder
readList :: ReadS [UpdateFolder]
$creadList :: ReadS [UpdateFolder]
readsPrec :: Int -> ReadS UpdateFolder
$creadsPrec :: Int -> ReadS UpdateFolder
Prelude.Read, Int -> UpdateFolder -> ShowS
[UpdateFolder] -> ShowS
UpdateFolder -> String
(Int -> UpdateFolder -> ShowS)
-> (UpdateFolder -> String)
-> ([UpdateFolder] -> ShowS)
-> Show UpdateFolder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFolder] -> ShowS
$cshowList :: [UpdateFolder] -> ShowS
show :: UpdateFolder -> String
$cshow :: UpdateFolder -> String
showsPrec :: Int -> UpdateFolder -> ShowS
$cshowsPrec :: Int -> UpdateFolder -> ShowS
Prelude.Show, (forall x. UpdateFolder -> Rep UpdateFolder x)
-> (forall x. Rep UpdateFolder x -> UpdateFolder)
-> Generic UpdateFolder
forall x. Rep UpdateFolder x -> UpdateFolder
forall x. UpdateFolder -> Rep UpdateFolder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFolder x -> UpdateFolder
$cfrom :: forall x. UpdateFolder -> Rep UpdateFolder x
Prelude.Generic)
newUpdateFolder ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UpdateFolder
newUpdateFolder :: Text -> Text -> Text -> UpdateFolder
newUpdateFolder Text
pAwsAccountId_ Text
pFolderId_ Text
pName_ =
UpdateFolder' :: Text -> Text -> Text -> UpdateFolder
UpdateFolder'
{ $sel:awsAccountId:UpdateFolder' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:folderId:UpdateFolder' :: Text
folderId = Text
pFolderId_,
$sel:name:UpdateFolder' :: Text
name = Text
pName_
}
updateFolder_awsAccountId :: Lens.Lens' UpdateFolder Prelude.Text
updateFolder_awsAccountId :: (Text -> f Text) -> UpdateFolder -> f UpdateFolder
updateFolder_awsAccountId = (UpdateFolder -> Text)
-> (UpdateFolder -> Text -> UpdateFolder)
-> Lens UpdateFolder UpdateFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFolder' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateFolder' :: UpdateFolder -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateFolder
s@UpdateFolder' {} Text
a -> UpdateFolder
s {$sel:awsAccountId:UpdateFolder' :: Text
awsAccountId = Text
a} :: UpdateFolder)
updateFolder_folderId :: Lens.Lens' UpdateFolder Prelude.Text
updateFolder_folderId :: (Text -> f Text) -> UpdateFolder -> f UpdateFolder
updateFolder_folderId = (UpdateFolder -> Text)
-> (UpdateFolder -> Text -> UpdateFolder)
-> Lens UpdateFolder UpdateFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFolder' {Text
folderId :: Text
$sel:folderId:UpdateFolder' :: UpdateFolder -> Text
folderId} -> Text
folderId) (\s :: UpdateFolder
s@UpdateFolder' {} Text
a -> UpdateFolder
s {$sel:folderId:UpdateFolder' :: Text
folderId = Text
a} :: UpdateFolder)
updateFolder_name :: Lens.Lens' UpdateFolder Prelude.Text
updateFolder_name :: (Text -> f Text) -> UpdateFolder -> f UpdateFolder
updateFolder_name = (UpdateFolder -> Text)
-> (UpdateFolder -> Text -> UpdateFolder)
-> Lens UpdateFolder UpdateFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFolder' {Text
name :: Text
$sel:name:UpdateFolder' :: UpdateFolder -> Text
name} -> Text
name) (\s :: UpdateFolder
s@UpdateFolder' {} Text
a -> UpdateFolder
s {$sel:name:UpdateFolder' :: Text
name = Text
a} :: UpdateFolder)
instance Core.AWSRequest UpdateFolder where
type AWSResponse UpdateFolder = UpdateFolderResponse
request :: UpdateFolder -> Request UpdateFolder
request = Service -> UpdateFolder -> Request UpdateFolder
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateFolder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateFolder)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateFolder))
-> Logger
-> Service
-> Proxy UpdateFolder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateFolder)))
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 Text
-> Maybe Text -> Maybe Text -> Int -> UpdateFolderResponse
UpdateFolderResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> UpdateFolderResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> UpdateFolderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
Either
String (Maybe Text -> Maybe Text -> Int -> UpdateFolderResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> UpdateFolderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
Either String (Maybe Text -> Int -> UpdateFolderResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateFolderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FolderId")
Either String (Int -> UpdateFolderResponse)
-> Either String Int -> Either String UpdateFolderResponse
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 UpdateFolder
instance Prelude.NFData UpdateFolder
instance Core.ToHeaders UpdateFolder where
toHeaders :: UpdateFolder -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateFolder -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateFolder where
toJSON :: UpdateFolder -> Value
toJSON UpdateFolder' {Text
name :: Text
folderId :: Text
awsAccountId :: Text
$sel:name:UpdateFolder' :: UpdateFolder -> Text
$sel:folderId:UpdateFolder' :: UpdateFolder -> Text
$sel:awsAccountId:UpdateFolder' :: UpdateFolder -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath UpdateFolder where
toPath :: UpdateFolder -> ByteString
toPath UpdateFolder' {Text
name :: Text
folderId :: Text
awsAccountId :: Text
$sel:name:UpdateFolder' :: UpdateFolder -> Text
$sel:folderId:UpdateFolder' :: UpdateFolder -> Text
$sel:awsAccountId:UpdateFolder' :: UpdateFolder -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
ByteString
"/folders/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
folderId
]
instance Core.ToQuery UpdateFolder where
toQuery :: UpdateFolder -> QueryString
toQuery = QueryString -> UpdateFolder -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateFolderResponse = UpdateFolderResponse'
{
UpdateFolderResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
UpdateFolderResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
UpdateFolderResponse -> Maybe Text
folderId :: Prelude.Maybe Prelude.Text,
UpdateFolderResponse -> Int
status :: Prelude.Int
}
deriving (UpdateFolderResponse -> UpdateFolderResponse -> Bool
(UpdateFolderResponse -> UpdateFolderResponse -> Bool)
-> (UpdateFolderResponse -> UpdateFolderResponse -> Bool)
-> Eq UpdateFolderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFolderResponse -> UpdateFolderResponse -> Bool
$c/= :: UpdateFolderResponse -> UpdateFolderResponse -> Bool
== :: UpdateFolderResponse -> UpdateFolderResponse -> Bool
$c== :: UpdateFolderResponse -> UpdateFolderResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFolderResponse]
ReadPrec UpdateFolderResponse
Int -> ReadS UpdateFolderResponse
ReadS [UpdateFolderResponse]
(Int -> ReadS UpdateFolderResponse)
-> ReadS [UpdateFolderResponse]
-> ReadPrec UpdateFolderResponse
-> ReadPrec [UpdateFolderResponse]
-> Read UpdateFolderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFolderResponse]
$creadListPrec :: ReadPrec [UpdateFolderResponse]
readPrec :: ReadPrec UpdateFolderResponse
$creadPrec :: ReadPrec UpdateFolderResponse
readList :: ReadS [UpdateFolderResponse]
$creadList :: ReadS [UpdateFolderResponse]
readsPrec :: Int -> ReadS UpdateFolderResponse
$creadsPrec :: Int -> ReadS UpdateFolderResponse
Prelude.Read, Int -> UpdateFolderResponse -> ShowS
[UpdateFolderResponse] -> ShowS
UpdateFolderResponse -> String
(Int -> UpdateFolderResponse -> ShowS)
-> (UpdateFolderResponse -> String)
-> ([UpdateFolderResponse] -> ShowS)
-> Show UpdateFolderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFolderResponse] -> ShowS
$cshowList :: [UpdateFolderResponse] -> ShowS
show :: UpdateFolderResponse -> String
$cshow :: UpdateFolderResponse -> String
showsPrec :: Int -> UpdateFolderResponse -> ShowS
$cshowsPrec :: Int -> UpdateFolderResponse -> ShowS
Prelude.Show, (forall x. UpdateFolderResponse -> Rep UpdateFolderResponse x)
-> (forall x. Rep UpdateFolderResponse x -> UpdateFolderResponse)
-> Generic UpdateFolderResponse
forall x. Rep UpdateFolderResponse x -> UpdateFolderResponse
forall x. UpdateFolderResponse -> Rep UpdateFolderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFolderResponse x -> UpdateFolderResponse
$cfrom :: forall x. UpdateFolderResponse -> Rep UpdateFolderResponse x
Prelude.Generic)
newUpdateFolderResponse ::
Prelude.Int ->
UpdateFolderResponse
newUpdateFolderResponse :: Int -> UpdateFolderResponse
newUpdateFolderResponse Int
pStatus_ =
UpdateFolderResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> UpdateFolderResponse
UpdateFolderResponse'
{ $sel:requestId:UpdateFolderResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:UpdateFolderResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:folderId:UpdateFolderResponse' :: Maybe Text
folderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:UpdateFolderResponse' :: Int
status = Int
pStatus_
}
updateFolderResponse_requestId :: Lens.Lens' UpdateFolderResponse (Prelude.Maybe Prelude.Text)
updateFolderResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> UpdateFolderResponse -> f UpdateFolderResponse
updateFolderResponse_requestId = (UpdateFolderResponse -> Maybe Text)
-> (UpdateFolderResponse -> Maybe Text -> UpdateFolderResponse)
-> Lens
UpdateFolderResponse UpdateFolderResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFolderResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdateFolderResponse' :: UpdateFolderResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdateFolderResponse
s@UpdateFolderResponse' {} Maybe Text
a -> UpdateFolderResponse
s {$sel:requestId:UpdateFolderResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdateFolderResponse)
updateFolderResponse_arn :: Lens.Lens' UpdateFolderResponse (Prelude.Maybe Prelude.Text)
updateFolderResponse_arn :: (Maybe Text -> f (Maybe Text))
-> UpdateFolderResponse -> f UpdateFolderResponse
updateFolderResponse_arn = (UpdateFolderResponse -> Maybe Text)
-> (UpdateFolderResponse -> Maybe Text -> UpdateFolderResponse)
-> Lens
UpdateFolderResponse UpdateFolderResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFolderResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateFolderResponse' :: UpdateFolderResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateFolderResponse
s@UpdateFolderResponse' {} Maybe Text
a -> UpdateFolderResponse
s {$sel:arn:UpdateFolderResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateFolderResponse)
updateFolderResponse_folderId :: Lens.Lens' UpdateFolderResponse (Prelude.Maybe Prelude.Text)
updateFolderResponse_folderId :: (Maybe Text -> f (Maybe Text))
-> UpdateFolderResponse -> f UpdateFolderResponse
updateFolderResponse_folderId = (UpdateFolderResponse -> Maybe Text)
-> (UpdateFolderResponse -> Maybe Text -> UpdateFolderResponse)
-> Lens
UpdateFolderResponse UpdateFolderResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFolderResponse' {Maybe Text
folderId :: Maybe Text
$sel:folderId:UpdateFolderResponse' :: UpdateFolderResponse -> Maybe Text
folderId} -> Maybe Text
folderId) (\s :: UpdateFolderResponse
s@UpdateFolderResponse' {} Maybe Text
a -> UpdateFolderResponse
s {$sel:folderId:UpdateFolderResponse' :: Maybe Text
folderId = Maybe Text
a} :: UpdateFolderResponse)
updateFolderResponse_status :: Lens.Lens' UpdateFolderResponse Prelude.Int
updateFolderResponse_status :: (Int -> f Int) -> UpdateFolderResponse -> f UpdateFolderResponse
updateFolderResponse_status = (UpdateFolderResponse -> Int)
-> (UpdateFolderResponse -> Int -> UpdateFolderResponse)
-> Lens UpdateFolderResponse UpdateFolderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFolderResponse' {Int
status :: Int
$sel:status:UpdateFolderResponse' :: UpdateFolderResponse -> Int
status} -> Int
status) (\s :: UpdateFolderResponse
s@UpdateFolderResponse' {} Int
a -> UpdateFolderResponse
s {$sel:status:UpdateFolderResponse' :: Int
status = Int
a} :: UpdateFolderResponse)
instance Prelude.NFData UpdateFolderResponse