{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WorkDocs.GetResources
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves a collection of resources, including folders and documents.
-- The only @CollectionType@ supported is @SHARED_WITH_ME@.
module Amazonka.WorkDocs.GetResources
  ( -- * Creating a Request
    GetResources (..),
    newGetResources,

    -- * Request Lenses
    getResources_authenticationToken,
    getResources_userId,
    getResources_marker,
    getResources_limit,
    getResources_collectionType,

    -- * Destructuring the Response
    GetResourcesResponse (..),
    newGetResourcesResponse,

    -- * Response Lenses
    getResourcesResponse_folders,
    getResourcesResponse_documents,
    getResourcesResponse_marker,
    getResourcesResponse_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

-- | /See:/ 'newGetResources' smart constructor.
data GetResources = GetResources'
  { -- | The Amazon WorkDocs authentication token. Not required when using AWS
    -- administrator credentials to access the API.
    GetResources -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The user ID for the resource collection. This is a required field for
    -- accessing the API operation using IAM credentials.
    GetResources -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
    -- | The marker for the next set of results. This marker was received from a
    -- previous call.
    GetResources -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of resources to return.
    GetResources -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The collection type.
    GetResources -> Maybe ResourceCollectionType
collectionType :: Prelude.Maybe ResourceCollectionType
  }
  deriving (GetResources -> GetResources -> Bool
(GetResources -> GetResources -> Bool)
-> (GetResources -> GetResources -> Bool) -> Eq GetResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResources -> GetResources -> Bool
$c/= :: GetResources -> GetResources -> Bool
== :: GetResources -> GetResources -> Bool
$c== :: GetResources -> GetResources -> Bool
Prelude.Eq, Int -> GetResources -> ShowS
[GetResources] -> ShowS
GetResources -> String
(Int -> GetResources -> ShowS)
-> (GetResources -> String)
-> ([GetResources] -> ShowS)
-> Show GetResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResources] -> ShowS
$cshowList :: [GetResources] -> ShowS
show :: GetResources -> String
$cshow :: GetResources -> String
showsPrec :: Int -> GetResources -> ShowS
$cshowsPrec :: Int -> GetResources -> ShowS
Prelude.Show, (forall x. GetResources -> Rep GetResources x)
-> (forall x. Rep GetResources x -> GetResources)
-> Generic GetResources
forall x. Rep GetResources x -> GetResources
forall x. GetResources -> Rep GetResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResources x -> GetResources
$cfrom :: forall x. GetResources -> Rep GetResources x
Prelude.Generic)

-- |
-- Create a value of 'GetResources' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authenticationToken', 'getResources_authenticationToken' - The Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
--
-- 'userId', 'getResources_userId' - The user ID for the resource collection. This is a required field for
-- accessing the API operation using IAM credentials.
--
-- 'marker', 'getResources_marker' - The marker for the next set of results. This marker was received from a
-- previous call.
--
-- 'limit', 'getResources_limit' - The maximum number of resources to return.
--
-- 'collectionType', 'getResources_collectionType' - The collection type.
newGetResources ::
  GetResources
newGetResources :: GetResources
newGetResources =
  GetResources' :: Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe ResourceCollectionType
-> GetResources
GetResources'
    { $sel:authenticationToken:GetResources' :: Maybe (Sensitive Text)
authenticationToken =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:userId:GetResources' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:GetResources' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:GetResources' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:collectionType:GetResources' :: Maybe ResourceCollectionType
collectionType = Maybe ResourceCollectionType
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
getResources_authenticationToken :: Lens.Lens' GetResources (Prelude.Maybe Prelude.Text)
getResources_authenticationToken :: (Maybe Text -> f (Maybe Text)) -> GetResources -> f GetResources
getResources_authenticationToken = (GetResources -> Maybe (Sensitive Text))
-> (GetResources -> Maybe (Sensitive Text) -> GetResources)
-> Lens
     GetResources
     GetResources
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:GetResources' :: GetResources -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: GetResources
s@GetResources' {} Maybe (Sensitive Text)
a -> GetResources
s {$sel:authenticationToken:GetResources' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: GetResources) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> GetResources -> f GetResources)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetResources
-> f GetResources
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

-- | The user ID for the resource collection. This is a required field for
-- accessing the API operation using IAM credentials.
getResources_userId :: Lens.Lens' GetResources (Prelude.Maybe Prelude.Text)
getResources_userId :: (Maybe Text -> f (Maybe Text)) -> GetResources -> f GetResources
getResources_userId = (GetResources -> Maybe Text)
-> (GetResources -> Maybe Text -> GetResources)
-> Lens GetResources GetResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe Text
userId :: Maybe Text
$sel:userId:GetResources' :: GetResources -> Maybe Text
userId} -> Maybe Text
userId) (\s :: GetResources
s@GetResources' {} Maybe Text
a -> GetResources
s {$sel:userId:GetResources' :: Maybe Text
userId = Maybe Text
a} :: GetResources)

-- | The marker for the next set of results. This marker was received from a
-- previous call.
getResources_marker :: Lens.Lens' GetResources (Prelude.Maybe Prelude.Text)
getResources_marker :: (Maybe Text -> f (Maybe Text)) -> GetResources -> f GetResources
getResources_marker = (GetResources -> Maybe Text)
-> (GetResources -> Maybe Text -> GetResources)
-> Lens GetResources GetResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe Text
marker :: Maybe Text
$sel:marker:GetResources' :: GetResources -> Maybe Text
marker} -> Maybe Text
marker) (\s :: GetResources
s@GetResources' {} Maybe Text
a -> GetResources
s {$sel:marker:GetResources' :: Maybe Text
marker = Maybe Text
a} :: GetResources)

-- | The maximum number of resources to return.
getResources_limit :: Lens.Lens' GetResources (Prelude.Maybe Prelude.Natural)
getResources_limit :: (Maybe Natural -> f (Maybe Natural))
-> GetResources -> f GetResources
getResources_limit = (GetResources -> Maybe Natural)
-> (GetResources -> Maybe Natural -> GetResources)
-> Lens GetResources GetResources (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe Natural
limit :: Maybe Natural
$sel:limit:GetResources' :: GetResources -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: GetResources
s@GetResources' {} Maybe Natural
a -> GetResources
s {$sel:limit:GetResources' :: Maybe Natural
limit = Maybe Natural
a} :: GetResources)

-- | The collection type.
getResources_collectionType :: Lens.Lens' GetResources (Prelude.Maybe ResourceCollectionType)
getResources_collectionType :: (Maybe ResourceCollectionType -> f (Maybe ResourceCollectionType))
-> GetResources -> f GetResources
getResources_collectionType = (GetResources -> Maybe ResourceCollectionType)
-> (GetResources -> Maybe ResourceCollectionType -> GetResources)
-> Lens
     GetResources
     GetResources
     (Maybe ResourceCollectionType)
     (Maybe ResourceCollectionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe ResourceCollectionType
collectionType :: Maybe ResourceCollectionType
$sel:collectionType:GetResources' :: GetResources -> Maybe ResourceCollectionType
collectionType} -> Maybe ResourceCollectionType
collectionType) (\s :: GetResources
s@GetResources' {} Maybe ResourceCollectionType
a -> GetResources
s {$sel:collectionType:GetResources' :: Maybe ResourceCollectionType
collectionType = Maybe ResourceCollectionType
a} :: GetResources)

instance Core.AWSRequest GetResources where
  type AWSResponse GetResources = GetResourcesResponse
  request :: GetResources -> Request GetResources
request = Service -> GetResources -> Request GetResources
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetResources
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetResources)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetResources))
-> Logger
-> Service
-> Proxy GetResources
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetResources)))
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 [FolderMetadata]
-> Maybe [DocumentMetadata]
-> Maybe Text
-> Int
-> GetResourcesResponse
GetResourcesResponse'
            (Maybe [FolderMetadata]
 -> Maybe [DocumentMetadata]
 -> Maybe Text
 -> Int
 -> GetResourcesResponse)
-> Either String (Maybe [FolderMetadata])
-> Either
     String
     (Maybe [DocumentMetadata]
      -> Maybe Text -> Int -> GetResourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [FolderMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Folders" Either String (Maybe (Maybe [FolderMetadata]))
-> Maybe [FolderMetadata] -> Either String (Maybe [FolderMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FolderMetadata]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [DocumentMetadata]
   -> Maybe Text -> Int -> GetResourcesResponse)
-> Either String (Maybe [DocumentMetadata])
-> Either String (Maybe Text -> Int -> GetResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [DocumentMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Documents" Either String (Maybe (Maybe [DocumentMetadata]))
-> Maybe [DocumentMetadata]
-> Either String (Maybe [DocumentMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DocumentMetadata]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetResourcesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetResourcesResponse)
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
"Marker")
            Either String (Int -> GetResourcesResponse)
-> Either String Int -> Either String GetResourcesResponse
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 GetResources

instance Prelude.NFData GetResources

instance Core.ToHeaders GetResources where
  toHeaders :: GetResources -> ResponseHeaders
toHeaders GetResources' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe ResourceCollectionType
collectionType :: Maybe ResourceCollectionType
limit :: Maybe Natural
marker :: Maybe Text
userId :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:collectionType:GetResources' :: GetResources -> Maybe ResourceCollectionType
$sel:limit:GetResources' :: GetResources -> Maybe Natural
$sel:marker:GetResources' :: GetResources -> Maybe Text
$sel:userId:GetResources' :: GetResources -> Maybe Text
$sel:authenticationToken:GetResources' :: GetResources -> 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 GetResources where
  toPath :: GetResources -> ByteString
toPath = ByteString -> GetResources -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/api/v1/resources"

instance Core.ToQuery GetResources where
  toQuery :: GetResources -> QueryString
toQuery GetResources' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe ResourceCollectionType
collectionType :: Maybe ResourceCollectionType
limit :: Maybe Natural
marker :: Maybe Text
userId :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:collectionType:GetResources' :: GetResources -> Maybe ResourceCollectionType
$sel:limit:GetResources' :: GetResources -> Maybe Natural
$sel:marker:GetResources' :: GetResources -> Maybe Text
$sel:userId:GetResources' :: GetResources -> Maybe Text
$sel:authenticationToken:GetResources' :: GetResources -> Maybe (Sensitive Text)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"userId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userId,
        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
"collectionType" ByteString -> Maybe ResourceCollectionType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ResourceCollectionType
collectionType
      ]

-- | /See:/ 'newGetResourcesResponse' smart constructor.
data GetResourcesResponse = GetResourcesResponse'
  { -- | The folders in the specified folder.
    GetResourcesResponse -> Maybe [FolderMetadata]
folders :: Prelude.Maybe [FolderMetadata],
    -- | The documents in the specified collection.
    GetResourcesResponse -> Maybe [DocumentMetadata]
documents :: Prelude.Maybe [DocumentMetadata],
    -- | The marker to use when requesting the next set of results. If there are
    -- no additional results, the string is empty.
    GetResourcesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetResourcesResponse -> GetResourcesResponse -> Bool
(GetResourcesResponse -> GetResourcesResponse -> Bool)
-> (GetResourcesResponse -> GetResourcesResponse -> Bool)
-> Eq GetResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourcesResponse -> GetResourcesResponse -> Bool
$c/= :: GetResourcesResponse -> GetResourcesResponse -> Bool
== :: GetResourcesResponse -> GetResourcesResponse -> Bool
$c== :: GetResourcesResponse -> GetResourcesResponse -> Bool
Prelude.Eq, Int -> GetResourcesResponse -> ShowS
[GetResourcesResponse] -> ShowS
GetResourcesResponse -> String
(Int -> GetResourcesResponse -> ShowS)
-> (GetResourcesResponse -> String)
-> ([GetResourcesResponse] -> ShowS)
-> Show GetResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourcesResponse] -> ShowS
$cshowList :: [GetResourcesResponse] -> ShowS
show :: GetResourcesResponse -> String
$cshow :: GetResourcesResponse -> String
showsPrec :: Int -> GetResourcesResponse -> ShowS
$cshowsPrec :: Int -> GetResourcesResponse -> ShowS
Prelude.Show, (forall x. GetResourcesResponse -> Rep GetResourcesResponse x)
-> (forall x. Rep GetResourcesResponse x -> GetResourcesResponse)
-> Generic GetResourcesResponse
forall x. Rep GetResourcesResponse x -> GetResourcesResponse
forall x. GetResourcesResponse -> Rep GetResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResourcesResponse x -> GetResourcesResponse
$cfrom :: forall x. GetResourcesResponse -> Rep GetResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetResourcesResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'folders', 'getResourcesResponse_folders' - The folders in the specified folder.
--
-- 'documents', 'getResourcesResponse_documents' - The documents in the specified collection.
--
-- 'marker', 'getResourcesResponse_marker' - The marker to use when requesting the next set of results. If there are
-- no additional results, the string is empty.
--
-- 'httpStatus', 'getResourcesResponse_httpStatus' - The response's http status code.
newGetResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetResourcesResponse
newGetResourcesResponse :: Int -> GetResourcesResponse
newGetResourcesResponse Int
pHttpStatus_ =
  GetResourcesResponse' :: Maybe [FolderMetadata]
-> Maybe [DocumentMetadata]
-> Maybe Text
-> Int
-> GetResourcesResponse
GetResourcesResponse'
    { $sel:folders:GetResourcesResponse' :: Maybe [FolderMetadata]
folders = Maybe [FolderMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:documents:GetResourcesResponse' :: Maybe [DocumentMetadata]
documents = Maybe [DocumentMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:GetResourcesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The folders in the specified folder.
getResourcesResponse_folders :: Lens.Lens' GetResourcesResponse (Prelude.Maybe [FolderMetadata])
getResourcesResponse_folders :: (Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> GetResourcesResponse -> f GetResourcesResponse
getResourcesResponse_folders = (GetResourcesResponse -> Maybe [FolderMetadata])
-> (GetResourcesResponse
    -> Maybe [FolderMetadata] -> GetResourcesResponse)
-> Lens
     GetResourcesResponse
     GetResourcesResponse
     (Maybe [FolderMetadata])
     (Maybe [FolderMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcesResponse' {Maybe [FolderMetadata]
folders :: Maybe [FolderMetadata]
$sel:folders:GetResourcesResponse' :: GetResourcesResponse -> Maybe [FolderMetadata]
folders} -> Maybe [FolderMetadata]
folders) (\s :: GetResourcesResponse
s@GetResourcesResponse' {} Maybe [FolderMetadata]
a -> GetResourcesResponse
s {$sel:folders:GetResourcesResponse' :: Maybe [FolderMetadata]
folders = Maybe [FolderMetadata]
a} :: GetResourcesResponse) ((Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
 -> GetResourcesResponse -> f GetResourcesResponse)
-> ((Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
    -> Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> (Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> GetResourcesResponse
-> f GetResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FolderMetadata] [FolderMetadata] [FolderMetadata] [FolderMetadata]
-> Iso
     (Maybe [FolderMetadata])
     (Maybe [FolderMetadata])
     (Maybe [FolderMetadata])
     (Maybe [FolderMetadata])
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
  [FolderMetadata] [FolderMetadata] [FolderMetadata] [FolderMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The documents in the specified collection.
getResourcesResponse_documents :: Lens.Lens' GetResourcesResponse (Prelude.Maybe [DocumentMetadata])
getResourcesResponse_documents :: (Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> GetResourcesResponse -> f GetResourcesResponse
getResourcesResponse_documents = (GetResourcesResponse -> Maybe [DocumentMetadata])
-> (GetResourcesResponse
    -> Maybe [DocumentMetadata] -> GetResourcesResponse)
-> Lens
     GetResourcesResponse
     GetResourcesResponse
     (Maybe [DocumentMetadata])
     (Maybe [DocumentMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcesResponse' {Maybe [DocumentMetadata]
documents :: Maybe [DocumentMetadata]
$sel:documents:GetResourcesResponse' :: GetResourcesResponse -> Maybe [DocumentMetadata]
documents} -> Maybe [DocumentMetadata]
documents) (\s :: GetResourcesResponse
s@GetResourcesResponse' {} Maybe [DocumentMetadata]
a -> GetResourcesResponse
s {$sel:documents:GetResourcesResponse' :: Maybe [DocumentMetadata]
documents = Maybe [DocumentMetadata]
a} :: GetResourcesResponse) ((Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
 -> GetResourcesResponse -> f GetResourcesResponse)
-> ((Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
    -> Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> (Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> GetResourcesResponse
-> f GetResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DocumentMetadata]
  [DocumentMetadata]
  [DocumentMetadata]
  [DocumentMetadata]
-> Iso
     (Maybe [DocumentMetadata])
     (Maybe [DocumentMetadata])
     (Maybe [DocumentMetadata])
     (Maybe [DocumentMetadata])
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
  [DocumentMetadata]
  [DocumentMetadata]
  [DocumentMetadata]
  [DocumentMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The marker to use when requesting the next set of results. If there are
-- no additional results, the string is empty.
getResourcesResponse_marker :: Lens.Lens' GetResourcesResponse (Prelude.Maybe Prelude.Text)
getResourcesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> GetResourcesResponse -> f GetResourcesResponse
getResourcesResponse_marker = (GetResourcesResponse -> Maybe Text)
-> (GetResourcesResponse -> Maybe Text -> GetResourcesResponse)
-> Lens
     GetResourcesResponse GetResourcesResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:GetResourcesResponse' :: GetResourcesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: GetResourcesResponse
s@GetResourcesResponse' {} Maybe Text
a -> GetResourcesResponse
s {$sel:marker:GetResourcesResponse' :: Maybe Text
marker = Maybe Text
a} :: GetResourcesResponse)

-- | The response's http status code.
getResourcesResponse_httpStatus :: Lens.Lens' GetResourcesResponse Prelude.Int
getResourcesResponse_httpStatus :: (Int -> f Int) -> GetResourcesResponse -> f GetResourcesResponse
getResourcesResponse_httpStatus = (GetResourcesResponse -> Int)
-> (GetResourcesResponse -> Int -> GetResourcesResponse)
-> Lens GetResourcesResponse GetResourcesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetResourcesResponse' :: GetResourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetResourcesResponse
s@GetResourcesResponse' {} Int
a -> GetResourcesResponse
s {$sel:httpStatus:GetResourcesResponse' :: Int
httpStatus = Int
a} :: GetResourcesResponse)

instance Prelude.NFData GetResourcesResponse