{-# 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.WorkDocs.GetFolderPath
(
GetFolderPath (..),
newGetFolderPath,
getFolderPath_authenticationToken,
getFolderPath_marker,
getFolderPath_limit,
getFolderPath_fields,
getFolderPath_folderId,
GetFolderPathResponse (..),
newGetFolderPathResponse,
getFolderPathResponse_path,
getFolderPathResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkDocs.Types
data GetFolderPath = GetFolderPath'
{
GetFolderPath -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
GetFolderPath -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
GetFolderPath -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
GetFolderPath -> Maybe Text
fields :: Prelude.Maybe Prelude.Text,
GetFolderPath -> Text
folderId :: Prelude.Text
}
deriving (GetFolderPath -> GetFolderPath -> Bool
(GetFolderPath -> GetFolderPath -> Bool)
-> (GetFolderPath -> GetFolderPath -> Bool) -> Eq GetFolderPath
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFolderPath -> GetFolderPath -> Bool
$c/= :: GetFolderPath -> GetFolderPath -> Bool
== :: GetFolderPath -> GetFolderPath -> Bool
$c== :: GetFolderPath -> GetFolderPath -> Bool
Prelude.Eq, Int -> GetFolderPath -> ShowS
[GetFolderPath] -> ShowS
GetFolderPath -> String
(Int -> GetFolderPath -> ShowS)
-> (GetFolderPath -> String)
-> ([GetFolderPath] -> ShowS)
-> Show GetFolderPath
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFolderPath] -> ShowS
$cshowList :: [GetFolderPath] -> ShowS
show :: GetFolderPath -> String
$cshow :: GetFolderPath -> String
showsPrec :: Int -> GetFolderPath -> ShowS
$cshowsPrec :: Int -> GetFolderPath -> ShowS
Prelude.Show, (forall x. GetFolderPath -> Rep GetFolderPath x)
-> (forall x. Rep GetFolderPath x -> GetFolderPath)
-> Generic GetFolderPath
forall x. Rep GetFolderPath x -> GetFolderPath
forall x. GetFolderPath -> Rep GetFolderPath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetFolderPath x -> GetFolderPath
$cfrom :: forall x. GetFolderPath -> Rep GetFolderPath x
Prelude.Generic)
newGetFolderPath ::
Prelude.Text ->
GetFolderPath
newGetFolderPath :: Text -> GetFolderPath
newGetFolderPath Text
pFolderId_ =
GetFolderPath' :: Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Text
-> GetFolderPath
GetFolderPath'
{ $sel:authenticationToken:GetFolderPath' :: Maybe (Sensitive Text)
authenticationToken =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:marker:GetFolderPath' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:GetFolderPath' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:fields:GetFolderPath' :: Maybe Text
fields = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:folderId:GetFolderPath' :: Text
folderId = Text
pFolderId_
}
getFolderPath_authenticationToken :: Lens.Lens' GetFolderPath (Prelude.Maybe Prelude.Text)
getFolderPath_authenticationToken :: (Maybe Text -> f (Maybe Text)) -> GetFolderPath -> f GetFolderPath
getFolderPath_authenticationToken = (GetFolderPath -> Maybe (Sensitive Text))
-> (GetFolderPath -> Maybe (Sensitive Text) -> GetFolderPath)
-> Lens
GetFolderPath
GetFolderPath
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderPath' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:GetFolderPath' :: GetFolderPath -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: GetFolderPath
s@GetFolderPath' {} Maybe (Sensitive Text)
a -> GetFolderPath
s {$sel:authenticationToken:GetFolderPath' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: GetFolderPath) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> GetFolderPath -> f GetFolderPath)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetFolderPath
-> f GetFolderPath
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
getFolderPath_marker :: Lens.Lens' GetFolderPath (Prelude.Maybe Prelude.Text)
getFolderPath_marker :: (Maybe Text -> f (Maybe Text)) -> GetFolderPath -> f GetFolderPath
getFolderPath_marker = (GetFolderPath -> Maybe Text)
-> (GetFolderPath -> Maybe Text -> GetFolderPath)
-> Lens GetFolderPath GetFolderPath (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderPath' {Maybe Text
marker :: Maybe Text
$sel:marker:GetFolderPath' :: GetFolderPath -> Maybe Text
marker} -> Maybe Text
marker) (\s :: GetFolderPath
s@GetFolderPath' {} Maybe Text
a -> GetFolderPath
s {$sel:marker:GetFolderPath' :: Maybe Text
marker = Maybe Text
a} :: GetFolderPath)
getFolderPath_limit :: Lens.Lens' GetFolderPath (Prelude.Maybe Prelude.Natural)
getFolderPath_limit :: (Maybe Natural -> f (Maybe Natural))
-> GetFolderPath -> f GetFolderPath
getFolderPath_limit = (GetFolderPath -> Maybe Natural)
-> (GetFolderPath -> Maybe Natural -> GetFolderPath)
-> Lens GetFolderPath GetFolderPath (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderPath' {Maybe Natural
limit :: Maybe Natural
$sel:limit:GetFolderPath' :: GetFolderPath -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: GetFolderPath
s@GetFolderPath' {} Maybe Natural
a -> GetFolderPath
s {$sel:limit:GetFolderPath' :: Maybe Natural
limit = Maybe Natural
a} :: GetFolderPath)
getFolderPath_fields :: Lens.Lens' GetFolderPath (Prelude.Maybe Prelude.Text)
getFolderPath_fields :: (Maybe Text -> f (Maybe Text)) -> GetFolderPath -> f GetFolderPath
getFolderPath_fields = (GetFolderPath -> Maybe Text)
-> (GetFolderPath -> Maybe Text -> GetFolderPath)
-> Lens GetFolderPath GetFolderPath (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderPath' {Maybe Text
fields :: Maybe Text
$sel:fields:GetFolderPath' :: GetFolderPath -> Maybe Text
fields} -> Maybe Text
fields) (\s :: GetFolderPath
s@GetFolderPath' {} Maybe Text
a -> GetFolderPath
s {$sel:fields:GetFolderPath' :: Maybe Text
fields = Maybe Text
a} :: GetFolderPath)
getFolderPath_folderId :: Lens.Lens' GetFolderPath Prelude.Text
getFolderPath_folderId :: (Text -> f Text) -> GetFolderPath -> f GetFolderPath
getFolderPath_folderId = (GetFolderPath -> Text)
-> (GetFolderPath -> Text -> GetFolderPath)
-> Lens GetFolderPath GetFolderPath Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderPath' {Text
folderId :: Text
$sel:folderId:GetFolderPath' :: GetFolderPath -> Text
folderId} -> Text
folderId) (\s :: GetFolderPath
s@GetFolderPath' {} Text
a -> GetFolderPath
s {$sel:folderId:GetFolderPath' :: Text
folderId = Text
a} :: GetFolderPath)
instance Core.AWSRequest GetFolderPath where
type
AWSResponse GetFolderPath =
GetFolderPathResponse
request :: GetFolderPath -> Request GetFolderPath
request = Service -> GetFolderPath -> Request GetFolderPath
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetFolderPath
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetFolderPath)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetFolderPath))
-> Logger
-> Service
-> Proxy GetFolderPath
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetFolderPath)))
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 ResourcePath -> Int -> GetFolderPathResponse
GetFolderPathResponse'
(Maybe ResourcePath -> Int -> GetFolderPathResponse)
-> Either String (Maybe ResourcePath)
-> Either String (Int -> GetFolderPathResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ResourcePath)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Path")
Either String (Int -> GetFolderPathResponse)
-> Either String Int -> Either String GetFolderPathResponse
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 GetFolderPath
instance Prelude.NFData GetFolderPath
instance Core.ToHeaders GetFolderPath where
toHeaders :: GetFolderPath -> ResponseHeaders
toHeaders GetFolderPath' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
folderId :: Text
fields :: Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:folderId:GetFolderPath' :: GetFolderPath -> Text
$sel:fields:GetFolderPath' :: GetFolderPath -> Maybe Text
$sel:limit:GetFolderPath' :: GetFolderPath -> Maybe Natural
$sel:marker:GetFolderPath' :: GetFolderPath -> Maybe Text
$sel:authenticationToken:GetFolderPath' :: GetFolderPath -> Maybe (Sensitive Text)
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Authentication" HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
authenticationToken,
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.ToPath GetFolderPath where
toPath :: GetFolderPath -> ByteString
toPath GetFolderPath' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
folderId :: Text
fields :: Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:folderId:GetFolderPath' :: GetFolderPath -> Text
$sel:fields:GetFolderPath' :: GetFolderPath -> Maybe Text
$sel:limit:GetFolderPath' :: GetFolderPath -> Maybe Natural
$sel:marker:GetFolderPath' :: GetFolderPath -> Maybe Text
$sel:authenticationToken:GetFolderPath' :: GetFolderPath -> Maybe (Sensitive Text)
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/api/v1/folders/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
folderId, ByteString
"/path"]
instance Core.ToQuery GetFolderPath where
toQuery :: GetFolderPath -> QueryString
toQuery GetFolderPath' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
folderId :: Text
fields :: Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:folderId:GetFolderPath' :: GetFolderPath -> Text
$sel:fields:GetFolderPath' :: GetFolderPath -> Maybe Text
$sel:limit:GetFolderPath' :: GetFolderPath -> Maybe Natural
$sel:marker:GetFolderPath' :: GetFolderPath -> Maybe Text
$sel:authenticationToken:GetFolderPath' :: GetFolderPath -> Maybe (Sensitive Text)
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
ByteString
"limit" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
limit,
ByteString
"fields" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
fields
]
data GetFolderPathResponse = GetFolderPathResponse'
{
GetFolderPathResponse -> Maybe ResourcePath
path :: Prelude.Maybe ResourcePath,
GetFolderPathResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetFolderPathResponse -> GetFolderPathResponse -> Bool
(GetFolderPathResponse -> GetFolderPathResponse -> Bool)
-> (GetFolderPathResponse -> GetFolderPathResponse -> Bool)
-> Eq GetFolderPathResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFolderPathResponse -> GetFolderPathResponse -> Bool
$c/= :: GetFolderPathResponse -> GetFolderPathResponse -> Bool
== :: GetFolderPathResponse -> GetFolderPathResponse -> Bool
$c== :: GetFolderPathResponse -> GetFolderPathResponse -> Bool
Prelude.Eq, ReadPrec [GetFolderPathResponse]
ReadPrec GetFolderPathResponse
Int -> ReadS GetFolderPathResponse
ReadS [GetFolderPathResponse]
(Int -> ReadS GetFolderPathResponse)
-> ReadS [GetFolderPathResponse]
-> ReadPrec GetFolderPathResponse
-> ReadPrec [GetFolderPathResponse]
-> Read GetFolderPathResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFolderPathResponse]
$creadListPrec :: ReadPrec [GetFolderPathResponse]
readPrec :: ReadPrec GetFolderPathResponse
$creadPrec :: ReadPrec GetFolderPathResponse
readList :: ReadS [GetFolderPathResponse]
$creadList :: ReadS [GetFolderPathResponse]
readsPrec :: Int -> ReadS GetFolderPathResponse
$creadsPrec :: Int -> ReadS GetFolderPathResponse
Prelude.Read, Int -> GetFolderPathResponse -> ShowS
[GetFolderPathResponse] -> ShowS
GetFolderPathResponse -> String
(Int -> GetFolderPathResponse -> ShowS)
-> (GetFolderPathResponse -> String)
-> ([GetFolderPathResponse] -> ShowS)
-> Show GetFolderPathResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFolderPathResponse] -> ShowS
$cshowList :: [GetFolderPathResponse] -> ShowS
show :: GetFolderPathResponse -> String
$cshow :: GetFolderPathResponse -> String
showsPrec :: Int -> GetFolderPathResponse -> ShowS
$cshowsPrec :: Int -> GetFolderPathResponse -> ShowS
Prelude.Show, (forall x. GetFolderPathResponse -> Rep GetFolderPathResponse x)
-> (forall x. Rep GetFolderPathResponse x -> GetFolderPathResponse)
-> Generic GetFolderPathResponse
forall x. Rep GetFolderPathResponse x -> GetFolderPathResponse
forall x. GetFolderPathResponse -> Rep GetFolderPathResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetFolderPathResponse x -> GetFolderPathResponse
$cfrom :: forall x. GetFolderPathResponse -> Rep GetFolderPathResponse x
Prelude.Generic)
newGetFolderPathResponse ::
Prelude.Int ->
GetFolderPathResponse
newGetFolderPathResponse :: Int -> GetFolderPathResponse
newGetFolderPathResponse Int
pHttpStatus_ =
GetFolderPathResponse' :: Maybe ResourcePath -> Int -> GetFolderPathResponse
GetFolderPathResponse'
{ $sel:path:GetFolderPathResponse' :: Maybe ResourcePath
path = Maybe ResourcePath
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetFolderPathResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getFolderPathResponse_path :: Lens.Lens' GetFolderPathResponse (Prelude.Maybe ResourcePath)
getFolderPathResponse_path :: (Maybe ResourcePath -> f (Maybe ResourcePath))
-> GetFolderPathResponse -> f GetFolderPathResponse
getFolderPathResponse_path = (GetFolderPathResponse -> Maybe ResourcePath)
-> (GetFolderPathResponse
-> Maybe ResourcePath -> GetFolderPathResponse)
-> Lens
GetFolderPathResponse
GetFolderPathResponse
(Maybe ResourcePath)
(Maybe ResourcePath)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderPathResponse' {Maybe ResourcePath
path :: Maybe ResourcePath
$sel:path:GetFolderPathResponse' :: GetFolderPathResponse -> Maybe ResourcePath
path} -> Maybe ResourcePath
path) (\s :: GetFolderPathResponse
s@GetFolderPathResponse' {} Maybe ResourcePath
a -> GetFolderPathResponse
s {$sel:path:GetFolderPathResponse' :: Maybe ResourcePath
path = Maybe ResourcePath
a} :: GetFolderPathResponse)
getFolderPathResponse_httpStatus :: Lens.Lens' GetFolderPathResponse Prelude.Int
getFolderPathResponse_httpStatus :: (Int -> f Int) -> GetFolderPathResponse -> f GetFolderPathResponse
getFolderPathResponse_httpStatus = (GetFolderPathResponse -> Int)
-> (GetFolderPathResponse -> Int -> GetFolderPathResponse)
-> Lens GetFolderPathResponse GetFolderPathResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderPathResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetFolderPathResponse' :: GetFolderPathResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetFolderPathResponse
s@GetFolderPathResponse' {} Int
a -> GetFolderPathResponse
s {$sel:httpStatus:GetFolderPathResponse' :: Int
httpStatus = Int
a} :: GetFolderPathResponse)
instance Prelude.NFData GetFolderPathResponse