{-# 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.CodeCommit.GetFolder
-- 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)
--
-- Returns the contents of a specified folder in a repository.
module Amazonka.CodeCommit.GetFolder
  ( -- * Creating a Request
    GetFolder (..),
    newGetFolder,

    -- * Request Lenses
    getFolder_commitSpecifier,
    getFolder_repositoryName,
    getFolder_folderPath,

    -- * Destructuring the Response
    GetFolderResponse (..),
    newGetFolderResponse,

    -- * Response Lenses
    getFolderResponse_subModules,
    getFolderResponse_treeId,
    getFolderResponse_subFolders,
    getFolderResponse_symbolicLinks,
    getFolderResponse_files,
    getFolderResponse_httpStatus,
    getFolderResponse_commitId,
    getFolderResponse_folderPath,
  )
where

import Amazonka.CodeCommit.Types
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

-- | /See:/ 'newGetFolder' smart constructor.
data GetFolder = GetFolder'
  { -- | A fully qualified reference used to identify a commit that contains the
    -- version of the folder\'s content to return. A fully qualified reference
    -- can be a commit ID, branch name, tag, or reference such as HEAD. If no
    -- specifier is provided, the folder content is returned as it exists in
    -- the HEAD commit.
    GetFolder -> Maybe Text
commitSpecifier :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository.
    GetFolder -> Text
repositoryName :: Prelude.Text,
    -- | The fully qualified path to the folder whose contents are returned,
    -- including the folder name. For example, \/examples is a fully-qualified
    -- path to a folder named examples that was created off of the root
    -- directory (\/) of a repository.
    GetFolder -> Text
folderPath :: Prelude.Text
  }
  deriving (GetFolder -> GetFolder -> Bool
(GetFolder -> GetFolder -> Bool)
-> (GetFolder -> GetFolder -> Bool) -> Eq GetFolder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFolder -> GetFolder -> Bool
$c/= :: GetFolder -> GetFolder -> Bool
== :: GetFolder -> GetFolder -> Bool
$c== :: GetFolder -> GetFolder -> Bool
Prelude.Eq, ReadPrec [GetFolder]
ReadPrec GetFolder
Int -> ReadS GetFolder
ReadS [GetFolder]
(Int -> ReadS GetFolder)
-> ReadS [GetFolder]
-> ReadPrec GetFolder
-> ReadPrec [GetFolder]
-> Read GetFolder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFolder]
$creadListPrec :: ReadPrec [GetFolder]
readPrec :: ReadPrec GetFolder
$creadPrec :: ReadPrec GetFolder
readList :: ReadS [GetFolder]
$creadList :: ReadS [GetFolder]
readsPrec :: Int -> ReadS GetFolder
$creadsPrec :: Int -> ReadS GetFolder
Prelude.Read, Int -> GetFolder -> ShowS
[GetFolder] -> ShowS
GetFolder -> String
(Int -> GetFolder -> ShowS)
-> (GetFolder -> String)
-> ([GetFolder] -> ShowS)
-> Show GetFolder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFolder] -> ShowS
$cshowList :: [GetFolder] -> ShowS
show :: GetFolder -> String
$cshow :: GetFolder -> String
showsPrec :: Int -> GetFolder -> ShowS
$cshowsPrec :: Int -> GetFolder -> ShowS
Prelude.Show, (forall x. GetFolder -> Rep GetFolder x)
-> (forall x. Rep GetFolder x -> GetFolder) -> Generic GetFolder
forall x. Rep GetFolder x -> GetFolder
forall x. GetFolder -> Rep GetFolder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetFolder x -> GetFolder
$cfrom :: forall x. GetFolder -> Rep GetFolder x
Prelude.Generic)

-- |
-- Create a value of 'GetFolder' 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:
--
-- 'commitSpecifier', 'getFolder_commitSpecifier' - A fully qualified reference used to identify a commit that contains the
-- version of the folder\'s content to return. A fully qualified reference
-- can be a commit ID, branch name, tag, or reference such as HEAD. If no
-- specifier is provided, the folder content is returned as it exists in
-- the HEAD commit.
--
-- 'repositoryName', 'getFolder_repositoryName' - The name of the repository.
--
-- 'folderPath', 'getFolder_folderPath' - The fully qualified path to the folder whose contents are returned,
-- including the folder name. For example, \/examples is a fully-qualified
-- path to a folder named examples that was created off of the root
-- directory (\/) of a repository.
newGetFolder ::
  -- | 'repositoryName'
  Prelude.Text ->
  -- | 'folderPath'
  Prelude.Text ->
  GetFolder
newGetFolder :: Text -> Text -> GetFolder
newGetFolder Text
pRepositoryName_ Text
pFolderPath_ =
  GetFolder' :: Maybe Text -> Text -> Text -> GetFolder
GetFolder'
    { $sel:commitSpecifier:GetFolder' :: Maybe Text
commitSpecifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:GetFolder' :: Text
repositoryName = Text
pRepositoryName_,
      $sel:folderPath:GetFolder' :: Text
folderPath = Text
pFolderPath_
    }

-- | A fully qualified reference used to identify a commit that contains the
-- version of the folder\'s content to return. A fully qualified reference
-- can be a commit ID, branch name, tag, or reference such as HEAD. If no
-- specifier is provided, the folder content is returned as it exists in
-- the HEAD commit.
getFolder_commitSpecifier :: Lens.Lens' GetFolder (Prelude.Maybe Prelude.Text)
getFolder_commitSpecifier :: (Maybe Text -> f (Maybe Text)) -> GetFolder -> f GetFolder
getFolder_commitSpecifier = (GetFolder -> Maybe Text)
-> (GetFolder -> Maybe Text -> GetFolder)
-> Lens GetFolder GetFolder (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolder' {Maybe Text
commitSpecifier :: Maybe Text
$sel:commitSpecifier:GetFolder' :: GetFolder -> Maybe Text
commitSpecifier} -> Maybe Text
commitSpecifier) (\s :: GetFolder
s@GetFolder' {} Maybe Text
a -> GetFolder
s {$sel:commitSpecifier:GetFolder' :: Maybe Text
commitSpecifier = Maybe Text
a} :: GetFolder)

-- | The name of the repository.
getFolder_repositoryName :: Lens.Lens' GetFolder Prelude.Text
getFolder_repositoryName :: (Text -> f Text) -> GetFolder -> f GetFolder
getFolder_repositoryName = (GetFolder -> Text)
-> (GetFolder -> Text -> GetFolder)
-> Lens GetFolder GetFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolder' {Text
repositoryName :: Text
$sel:repositoryName:GetFolder' :: GetFolder -> Text
repositoryName} -> Text
repositoryName) (\s :: GetFolder
s@GetFolder' {} Text
a -> GetFolder
s {$sel:repositoryName:GetFolder' :: Text
repositoryName = Text
a} :: GetFolder)

-- | The fully qualified path to the folder whose contents are returned,
-- including the folder name. For example, \/examples is a fully-qualified
-- path to a folder named examples that was created off of the root
-- directory (\/) of a repository.
getFolder_folderPath :: Lens.Lens' GetFolder Prelude.Text
getFolder_folderPath :: (Text -> f Text) -> GetFolder -> f GetFolder
getFolder_folderPath = (GetFolder -> Text)
-> (GetFolder -> Text -> GetFolder)
-> Lens GetFolder GetFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolder' {Text
folderPath :: Text
$sel:folderPath:GetFolder' :: GetFolder -> Text
folderPath} -> Text
folderPath) (\s :: GetFolder
s@GetFolder' {} Text
a -> GetFolder
s {$sel:folderPath:GetFolder' :: Text
folderPath = Text
a} :: GetFolder)

instance Core.AWSRequest GetFolder where
  type AWSResponse GetFolder = GetFolderResponse
  request :: GetFolder -> Request GetFolder
request = Service -> GetFolder -> Request GetFolder
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetFolder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetFolder)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetFolder))
-> Logger
-> Service
-> Proxy GetFolder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetFolder)))
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 [SubModule]
-> Maybe Text
-> Maybe [Folder]
-> Maybe [SymbolicLink]
-> Maybe [File]
-> Int
-> Text
-> Text
-> GetFolderResponse
GetFolderResponse'
            (Maybe [SubModule]
 -> Maybe Text
 -> Maybe [Folder]
 -> Maybe [SymbolicLink]
 -> Maybe [File]
 -> Int
 -> Text
 -> Text
 -> GetFolderResponse)
-> Either String (Maybe [SubModule])
-> Either
     String
     (Maybe Text
      -> Maybe [Folder]
      -> Maybe [SymbolicLink]
      -> Maybe [File]
      -> Int
      -> Text
      -> Text
      -> GetFolderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [SubModule]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"subModules" Either String (Maybe (Maybe [SubModule]))
-> Maybe [SubModule] -> Either String (Maybe [SubModule])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SubModule]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe [Folder]
   -> Maybe [SymbolicLink]
   -> Maybe [File]
   -> Int
   -> Text
   -> Text
   -> GetFolderResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Folder]
      -> Maybe [SymbolicLink]
      -> Maybe [File]
      -> Int
      -> Text
      -> Text
      -> GetFolderResponse)
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
"treeId")
            Either
  String
  (Maybe [Folder]
   -> Maybe [SymbolicLink]
   -> Maybe [File]
   -> Int
   -> Text
   -> Text
   -> GetFolderResponse)
-> Either String (Maybe [Folder])
-> Either
     String
     (Maybe [SymbolicLink]
      -> Maybe [File] -> Int -> Text -> Text -> GetFolderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Folder]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"subFolders" Either String (Maybe (Maybe [Folder]))
-> Maybe [Folder] -> Either String (Maybe [Folder])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Folder]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [SymbolicLink]
   -> Maybe [File] -> Int -> Text -> Text -> GetFolderResponse)
-> Either String (Maybe [SymbolicLink])
-> Either
     String (Maybe [File] -> Int -> Text -> Text -> GetFolderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [SymbolicLink]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"symbolicLinks" Either String (Maybe (Maybe [SymbolicLink]))
-> Maybe [SymbolicLink] -> Either String (Maybe [SymbolicLink])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SymbolicLink]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe [File] -> Int -> Text -> Text -> GetFolderResponse)
-> Either String (Maybe [File])
-> Either String (Int -> Text -> Text -> GetFolderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [File]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"files" Either String (Maybe (Maybe [File]))
-> Maybe [File] -> Either String (Maybe [File])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [File]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> Text -> Text -> GetFolderResponse)
-> Either String Int
-> Either String (Text -> Text -> GetFolderResponse)
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))
            Either String (Text -> Text -> GetFolderResponse)
-> Either String Text -> Either String (Text -> GetFolderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"commitId")
            Either String (Text -> GetFolderResponse)
-> Either String Text -> Either String GetFolderResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"folderPath")
      )

instance Prelude.Hashable GetFolder

instance Prelude.NFData GetFolder

instance Core.ToHeaders GetFolder where
  toHeaders :: GetFolder -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetFolder -> 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
"CodeCommit_20150413.GetFolder" ::
                          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 GetFolder where
  toJSON :: GetFolder -> Value
toJSON GetFolder' {Maybe Text
Text
folderPath :: Text
repositoryName :: Text
commitSpecifier :: Maybe Text
$sel:folderPath:GetFolder' :: GetFolder -> Text
$sel:repositoryName:GetFolder' :: GetFolder -> Text
$sel:commitSpecifier:GetFolder' :: GetFolder -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"commitSpecifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
commitSpecifier,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"folderPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
folderPath)
          ]
      )

instance Core.ToPath GetFolder where
  toPath :: GetFolder -> ByteString
toPath = ByteString -> GetFolder -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery GetFolder where
  toQuery :: GetFolder -> QueryString
toQuery = QueryString -> GetFolder -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetFolderResponse' smart constructor.
data GetFolderResponse = GetFolderResponse'
  { -- | The list of submodules in the specified folder, if any.
    GetFolderResponse -> Maybe [SubModule]
subModules :: Prelude.Maybe [SubModule],
    -- | The full SHA-1 pointer of the tree information for the commit that
    -- contains the folder.
    GetFolderResponse -> Maybe Text
treeId :: Prelude.Maybe Prelude.Text,
    -- | The list of folders that exist under the specified folder, if any.
    GetFolderResponse -> Maybe [Folder]
subFolders :: Prelude.Maybe [Folder],
    -- | The list of symbolic links to other files and folders in the specified
    -- folder, if any.
    GetFolderResponse -> Maybe [SymbolicLink]
symbolicLinks :: Prelude.Maybe [SymbolicLink],
    -- | The list of files in the specified folder, if any.
    GetFolderResponse -> Maybe [File]
files :: Prelude.Maybe [File],
    -- | The response's http status code.
    GetFolderResponse -> Int
httpStatus :: Prelude.Int,
    -- | The full commit ID used as a reference for the returned version of the
    -- folder content.
    GetFolderResponse -> Text
commitId :: Prelude.Text,
    -- | The fully qualified path of the folder whose contents are returned.
    GetFolderResponse -> Text
folderPath :: Prelude.Text
  }
  deriving (GetFolderResponse -> GetFolderResponse -> Bool
(GetFolderResponse -> GetFolderResponse -> Bool)
-> (GetFolderResponse -> GetFolderResponse -> Bool)
-> Eq GetFolderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetFolderResponse -> GetFolderResponse -> Bool
$c/= :: GetFolderResponse -> GetFolderResponse -> Bool
== :: GetFolderResponse -> GetFolderResponse -> Bool
$c== :: GetFolderResponse -> GetFolderResponse -> Bool
Prelude.Eq, ReadPrec [GetFolderResponse]
ReadPrec GetFolderResponse
Int -> ReadS GetFolderResponse
ReadS [GetFolderResponse]
(Int -> ReadS GetFolderResponse)
-> ReadS [GetFolderResponse]
-> ReadPrec GetFolderResponse
-> ReadPrec [GetFolderResponse]
-> Read GetFolderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetFolderResponse]
$creadListPrec :: ReadPrec [GetFolderResponse]
readPrec :: ReadPrec GetFolderResponse
$creadPrec :: ReadPrec GetFolderResponse
readList :: ReadS [GetFolderResponse]
$creadList :: ReadS [GetFolderResponse]
readsPrec :: Int -> ReadS GetFolderResponse
$creadsPrec :: Int -> ReadS GetFolderResponse
Prelude.Read, Int -> GetFolderResponse -> ShowS
[GetFolderResponse] -> ShowS
GetFolderResponse -> String
(Int -> GetFolderResponse -> ShowS)
-> (GetFolderResponse -> String)
-> ([GetFolderResponse] -> ShowS)
-> Show GetFolderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetFolderResponse] -> ShowS
$cshowList :: [GetFolderResponse] -> ShowS
show :: GetFolderResponse -> String
$cshow :: GetFolderResponse -> String
showsPrec :: Int -> GetFolderResponse -> ShowS
$cshowsPrec :: Int -> GetFolderResponse -> ShowS
Prelude.Show, (forall x. GetFolderResponse -> Rep GetFolderResponse x)
-> (forall x. Rep GetFolderResponse x -> GetFolderResponse)
-> Generic GetFolderResponse
forall x. Rep GetFolderResponse x -> GetFolderResponse
forall x. GetFolderResponse -> Rep GetFolderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetFolderResponse x -> GetFolderResponse
$cfrom :: forall x. GetFolderResponse -> Rep GetFolderResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetFolderResponse' 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:
--
-- 'subModules', 'getFolderResponse_subModules' - The list of submodules in the specified folder, if any.
--
-- 'treeId', 'getFolderResponse_treeId' - The full SHA-1 pointer of the tree information for the commit that
-- contains the folder.
--
-- 'subFolders', 'getFolderResponse_subFolders' - The list of folders that exist under the specified folder, if any.
--
-- 'symbolicLinks', 'getFolderResponse_symbolicLinks' - The list of symbolic links to other files and folders in the specified
-- folder, if any.
--
-- 'files', 'getFolderResponse_files' - The list of files in the specified folder, if any.
--
-- 'httpStatus', 'getFolderResponse_httpStatus' - The response's http status code.
--
-- 'commitId', 'getFolderResponse_commitId' - The full commit ID used as a reference for the returned version of the
-- folder content.
--
-- 'folderPath', 'getFolderResponse_folderPath' - The fully qualified path of the folder whose contents are returned.
newGetFolderResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'commitId'
  Prelude.Text ->
  -- | 'folderPath'
  Prelude.Text ->
  GetFolderResponse
newGetFolderResponse :: Int -> Text -> Text -> GetFolderResponse
newGetFolderResponse
  Int
pHttpStatus_
  Text
pCommitId_
  Text
pFolderPath_ =
    GetFolderResponse' :: Maybe [SubModule]
-> Maybe Text
-> Maybe [Folder]
-> Maybe [SymbolicLink]
-> Maybe [File]
-> Int
-> Text
-> Text
-> GetFolderResponse
GetFolderResponse'
      { $sel:subModules:GetFolderResponse' :: Maybe [SubModule]
subModules = Maybe [SubModule]
forall a. Maybe a
Prelude.Nothing,
        $sel:treeId:GetFolderResponse' :: Maybe Text
treeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:subFolders:GetFolderResponse' :: Maybe [Folder]
subFolders = Maybe [Folder]
forall a. Maybe a
Prelude.Nothing,
        $sel:symbolicLinks:GetFolderResponse' :: Maybe [SymbolicLink]
symbolicLinks = Maybe [SymbolicLink]
forall a. Maybe a
Prelude.Nothing,
        $sel:files:GetFolderResponse' :: Maybe [File]
files = Maybe [File]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetFolderResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:commitId:GetFolderResponse' :: Text
commitId = Text
pCommitId_,
        $sel:folderPath:GetFolderResponse' :: Text
folderPath = Text
pFolderPath_
      }

-- | The list of submodules in the specified folder, if any.
getFolderResponse_subModules :: Lens.Lens' GetFolderResponse (Prelude.Maybe [SubModule])
getFolderResponse_subModules :: (Maybe [SubModule] -> f (Maybe [SubModule]))
-> GetFolderResponse -> f GetFolderResponse
getFolderResponse_subModules = (GetFolderResponse -> Maybe [SubModule])
-> (GetFolderResponse -> Maybe [SubModule] -> GetFolderResponse)
-> Lens
     GetFolderResponse
     GetFolderResponse
     (Maybe [SubModule])
     (Maybe [SubModule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderResponse' {Maybe [SubModule]
subModules :: Maybe [SubModule]
$sel:subModules:GetFolderResponse' :: GetFolderResponse -> Maybe [SubModule]
subModules} -> Maybe [SubModule]
subModules) (\s :: GetFolderResponse
s@GetFolderResponse' {} Maybe [SubModule]
a -> GetFolderResponse
s {$sel:subModules:GetFolderResponse' :: Maybe [SubModule]
subModules = Maybe [SubModule]
a} :: GetFolderResponse) ((Maybe [SubModule] -> f (Maybe [SubModule]))
 -> GetFolderResponse -> f GetFolderResponse)
-> ((Maybe [SubModule] -> f (Maybe [SubModule]))
    -> Maybe [SubModule] -> f (Maybe [SubModule]))
-> (Maybe [SubModule] -> f (Maybe [SubModule]))
-> GetFolderResponse
-> f GetFolderResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SubModule] [SubModule] [SubModule] [SubModule]
-> Iso
     (Maybe [SubModule])
     (Maybe [SubModule])
     (Maybe [SubModule])
     (Maybe [SubModule])
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 [SubModule] [SubModule] [SubModule] [SubModule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The full SHA-1 pointer of the tree information for the commit that
-- contains the folder.
getFolderResponse_treeId :: Lens.Lens' GetFolderResponse (Prelude.Maybe Prelude.Text)
getFolderResponse_treeId :: (Maybe Text -> f (Maybe Text))
-> GetFolderResponse -> f GetFolderResponse
getFolderResponse_treeId = (GetFolderResponse -> Maybe Text)
-> (GetFolderResponse -> Maybe Text -> GetFolderResponse)
-> Lens
     GetFolderResponse GetFolderResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderResponse' {Maybe Text
treeId :: Maybe Text
$sel:treeId:GetFolderResponse' :: GetFolderResponse -> Maybe Text
treeId} -> Maybe Text
treeId) (\s :: GetFolderResponse
s@GetFolderResponse' {} Maybe Text
a -> GetFolderResponse
s {$sel:treeId:GetFolderResponse' :: Maybe Text
treeId = Maybe Text
a} :: GetFolderResponse)

-- | The list of folders that exist under the specified folder, if any.
getFolderResponse_subFolders :: Lens.Lens' GetFolderResponse (Prelude.Maybe [Folder])
getFolderResponse_subFolders :: (Maybe [Folder] -> f (Maybe [Folder]))
-> GetFolderResponse -> f GetFolderResponse
getFolderResponse_subFolders = (GetFolderResponse -> Maybe [Folder])
-> (GetFolderResponse -> Maybe [Folder] -> GetFolderResponse)
-> Lens
     GetFolderResponse
     GetFolderResponse
     (Maybe [Folder])
     (Maybe [Folder])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderResponse' {Maybe [Folder]
subFolders :: Maybe [Folder]
$sel:subFolders:GetFolderResponse' :: GetFolderResponse -> Maybe [Folder]
subFolders} -> Maybe [Folder]
subFolders) (\s :: GetFolderResponse
s@GetFolderResponse' {} Maybe [Folder]
a -> GetFolderResponse
s {$sel:subFolders:GetFolderResponse' :: Maybe [Folder]
subFolders = Maybe [Folder]
a} :: GetFolderResponse) ((Maybe [Folder] -> f (Maybe [Folder]))
 -> GetFolderResponse -> f GetFolderResponse)
-> ((Maybe [Folder] -> f (Maybe [Folder]))
    -> Maybe [Folder] -> f (Maybe [Folder]))
-> (Maybe [Folder] -> f (Maybe [Folder]))
-> GetFolderResponse
-> f GetFolderResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Folder] [Folder] [Folder] [Folder]
-> Iso
     (Maybe [Folder]) (Maybe [Folder]) (Maybe [Folder]) (Maybe [Folder])
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 [Folder] [Folder] [Folder] [Folder]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of symbolic links to other files and folders in the specified
-- folder, if any.
getFolderResponse_symbolicLinks :: Lens.Lens' GetFolderResponse (Prelude.Maybe [SymbolicLink])
getFolderResponse_symbolicLinks :: (Maybe [SymbolicLink] -> f (Maybe [SymbolicLink]))
-> GetFolderResponse -> f GetFolderResponse
getFolderResponse_symbolicLinks = (GetFolderResponse -> Maybe [SymbolicLink])
-> (GetFolderResponse -> Maybe [SymbolicLink] -> GetFolderResponse)
-> Lens
     GetFolderResponse
     GetFolderResponse
     (Maybe [SymbolicLink])
     (Maybe [SymbolicLink])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderResponse' {Maybe [SymbolicLink]
symbolicLinks :: Maybe [SymbolicLink]
$sel:symbolicLinks:GetFolderResponse' :: GetFolderResponse -> Maybe [SymbolicLink]
symbolicLinks} -> Maybe [SymbolicLink]
symbolicLinks) (\s :: GetFolderResponse
s@GetFolderResponse' {} Maybe [SymbolicLink]
a -> GetFolderResponse
s {$sel:symbolicLinks:GetFolderResponse' :: Maybe [SymbolicLink]
symbolicLinks = Maybe [SymbolicLink]
a} :: GetFolderResponse) ((Maybe [SymbolicLink] -> f (Maybe [SymbolicLink]))
 -> GetFolderResponse -> f GetFolderResponse)
-> ((Maybe [SymbolicLink] -> f (Maybe [SymbolicLink]))
    -> Maybe [SymbolicLink] -> f (Maybe [SymbolicLink]))
-> (Maybe [SymbolicLink] -> f (Maybe [SymbolicLink]))
-> GetFolderResponse
-> f GetFolderResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SymbolicLink] [SymbolicLink] [SymbolicLink] [SymbolicLink]
-> Iso
     (Maybe [SymbolicLink])
     (Maybe [SymbolicLink])
     (Maybe [SymbolicLink])
     (Maybe [SymbolicLink])
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 [SymbolicLink] [SymbolicLink] [SymbolicLink] [SymbolicLink]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of files in the specified folder, if any.
getFolderResponse_files :: Lens.Lens' GetFolderResponse (Prelude.Maybe [File])
getFolderResponse_files :: (Maybe [File] -> f (Maybe [File]))
-> GetFolderResponse -> f GetFolderResponse
getFolderResponse_files = (GetFolderResponse -> Maybe [File])
-> (GetFolderResponse -> Maybe [File] -> GetFolderResponse)
-> Lens
     GetFolderResponse GetFolderResponse (Maybe [File]) (Maybe [File])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderResponse' {Maybe [File]
files :: Maybe [File]
$sel:files:GetFolderResponse' :: GetFolderResponse -> Maybe [File]
files} -> Maybe [File]
files) (\s :: GetFolderResponse
s@GetFolderResponse' {} Maybe [File]
a -> GetFolderResponse
s {$sel:files:GetFolderResponse' :: Maybe [File]
files = Maybe [File]
a} :: GetFolderResponse) ((Maybe [File] -> f (Maybe [File]))
 -> GetFolderResponse -> f GetFolderResponse)
-> ((Maybe [File] -> f (Maybe [File]))
    -> Maybe [File] -> f (Maybe [File]))
-> (Maybe [File] -> f (Maybe [File]))
-> GetFolderResponse
-> f GetFolderResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [File] [File] [File] [File]
-> Iso (Maybe [File]) (Maybe [File]) (Maybe [File]) (Maybe [File])
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 [File] [File] [File] [File]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The full commit ID used as a reference for the returned version of the
-- folder content.
getFolderResponse_commitId :: Lens.Lens' GetFolderResponse Prelude.Text
getFolderResponse_commitId :: (Text -> f Text) -> GetFolderResponse -> f GetFolderResponse
getFolderResponse_commitId = (GetFolderResponse -> Text)
-> (GetFolderResponse -> Text -> GetFolderResponse)
-> Lens GetFolderResponse GetFolderResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderResponse' {Text
commitId :: Text
$sel:commitId:GetFolderResponse' :: GetFolderResponse -> Text
commitId} -> Text
commitId) (\s :: GetFolderResponse
s@GetFolderResponse' {} Text
a -> GetFolderResponse
s {$sel:commitId:GetFolderResponse' :: Text
commitId = Text
a} :: GetFolderResponse)

-- | The fully qualified path of the folder whose contents are returned.
getFolderResponse_folderPath :: Lens.Lens' GetFolderResponse Prelude.Text
getFolderResponse_folderPath :: (Text -> f Text) -> GetFolderResponse -> f GetFolderResponse
getFolderResponse_folderPath = (GetFolderResponse -> Text)
-> (GetFolderResponse -> Text -> GetFolderResponse)
-> Lens GetFolderResponse GetFolderResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFolderResponse' {Text
folderPath :: Text
$sel:folderPath:GetFolderResponse' :: GetFolderResponse -> Text
folderPath} -> Text
folderPath) (\s :: GetFolderResponse
s@GetFolderResponse' {} Text
a -> GetFolderResponse
s {$sel:folderPath:GetFolderResponse' :: Text
folderPath = Text
a} :: GetFolderResponse)

instance Prelude.NFData GetFolderResponse