{-# 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.CloudDirectory.ListObjectChildren
-- 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 a paginated list of child objects that are associated with a
-- given object.
module Amazonka.CloudDirectory.ListObjectChildren
  ( -- * Creating a Request
    ListObjectChildren (..),
    newListObjectChildren,

    -- * Request Lenses
    listObjectChildren_consistencyLevel,
    listObjectChildren_nextToken,
    listObjectChildren_maxResults,
    listObjectChildren_directoryArn,
    listObjectChildren_objectReference,

    -- * Destructuring the Response
    ListObjectChildrenResponse (..),
    newListObjectChildrenResponse,

    -- * Response Lenses
    listObjectChildrenResponse_children,
    listObjectChildrenResponse_nextToken,
    listObjectChildrenResponse_httpStatus,
  )
where

import Amazonka.CloudDirectory.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:/ 'newListObjectChildren' smart constructor.
data ListObjectChildren = ListObjectChildren'
  { -- | Represents the manner and timing in which the successful write or update
    -- of an object is reflected in a subsequent read operation of that same
    -- object.
    ListObjectChildren -> Maybe ConsistencyLevel
consistencyLevel :: Prelude.Maybe ConsistencyLevel,
    -- | The pagination token.
    ListObjectChildren -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to be retrieved in a single call. This is an
    -- approximate number.
    ListObjectChildren -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) that is associated with the Directory
    -- where the object resides. For more information, see arns.
    ListObjectChildren -> Text
directoryArn :: Prelude.Text,
    -- | The reference that identifies the object for which child objects are
    -- being listed.
    ListObjectChildren -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (ListObjectChildren -> ListObjectChildren -> Bool
(ListObjectChildren -> ListObjectChildren -> Bool)
-> (ListObjectChildren -> ListObjectChildren -> Bool)
-> Eq ListObjectChildren
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListObjectChildren -> ListObjectChildren -> Bool
$c/= :: ListObjectChildren -> ListObjectChildren -> Bool
== :: ListObjectChildren -> ListObjectChildren -> Bool
$c== :: ListObjectChildren -> ListObjectChildren -> Bool
Prelude.Eq, ReadPrec [ListObjectChildren]
ReadPrec ListObjectChildren
Int -> ReadS ListObjectChildren
ReadS [ListObjectChildren]
(Int -> ReadS ListObjectChildren)
-> ReadS [ListObjectChildren]
-> ReadPrec ListObjectChildren
-> ReadPrec [ListObjectChildren]
-> Read ListObjectChildren
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListObjectChildren]
$creadListPrec :: ReadPrec [ListObjectChildren]
readPrec :: ReadPrec ListObjectChildren
$creadPrec :: ReadPrec ListObjectChildren
readList :: ReadS [ListObjectChildren]
$creadList :: ReadS [ListObjectChildren]
readsPrec :: Int -> ReadS ListObjectChildren
$creadsPrec :: Int -> ReadS ListObjectChildren
Prelude.Read, Int -> ListObjectChildren -> ShowS
[ListObjectChildren] -> ShowS
ListObjectChildren -> String
(Int -> ListObjectChildren -> ShowS)
-> (ListObjectChildren -> String)
-> ([ListObjectChildren] -> ShowS)
-> Show ListObjectChildren
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListObjectChildren] -> ShowS
$cshowList :: [ListObjectChildren] -> ShowS
show :: ListObjectChildren -> String
$cshow :: ListObjectChildren -> String
showsPrec :: Int -> ListObjectChildren -> ShowS
$cshowsPrec :: Int -> ListObjectChildren -> ShowS
Prelude.Show, (forall x. ListObjectChildren -> Rep ListObjectChildren x)
-> (forall x. Rep ListObjectChildren x -> ListObjectChildren)
-> Generic ListObjectChildren
forall x. Rep ListObjectChildren x -> ListObjectChildren
forall x. ListObjectChildren -> Rep ListObjectChildren x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListObjectChildren x -> ListObjectChildren
$cfrom :: forall x. ListObjectChildren -> Rep ListObjectChildren x
Prelude.Generic)

-- |
-- Create a value of 'ListObjectChildren' 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:
--
-- 'consistencyLevel', 'listObjectChildren_consistencyLevel' - Represents the manner and timing in which the successful write or update
-- of an object is reflected in a subsequent read operation of that same
-- object.
--
-- 'nextToken', 'listObjectChildren_nextToken' - The pagination token.
--
-- 'maxResults', 'listObjectChildren_maxResults' - The maximum number of items to be retrieved in a single call. This is an
-- approximate number.
--
-- 'directoryArn', 'listObjectChildren_directoryArn' - The Amazon Resource Name (ARN) that is associated with the Directory
-- where the object resides. For more information, see arns.
--
-- 'objectReference', 'listObjectChildren_objectReference' - The reference that identifies the object for which child objects are
-- being listed.
newListObjectChildren ::
  -- | 'directoryArn'
  Prelude.Text ->
  -- | 'objectReference'
  ObjectReference ->
  ListObjectChildren
newListObjectChildren :: Text -> ObjectReference -> ListObjectChildren
newListObjectChildren
  Text
pDirectoryArn_
  ObjectReference
pObjectReference_ =
    ListObjectChildren' :: Maybe ConsistencyLevel
-> Maybe Text
-> Maybe Natural
-> Text
-> ObjectReference
-> ListObjectChildren
ListObjectChildren'
      { $sel:consistencyLevel:ListObjectChildren' :: Maybe ConsistencyLevel
consistencyLevel =
          Maybe ConsistencyLevel
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListObjectChildren' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListObjectChildren' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:directoryArn:ListObjectChildren' :: Text
directoryArn = Text
pDirectoryArn_,
        $sel:objectReference:ListObjectChildren' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
      }

-- | Represents the manner and timing in which the successful write or update
-- of an object is reflected in a subsequent read operation of that same
-- object.
listObjectChildren_consistencyLevel :: Lens.Lens' ListObjectChildren (Prelude.Maybe ConsistencyLevel)
listObjectChildren_consistencyLevel :: (Maybe ConsistencyLevel -> f (Maybe ConsistencyLevel))
-> ListObjectChildren -> f ListObjectChildren
listObjectChildren_consistencyLevel = (ListObjectChildren -> Maybe ConsistencyLevel)
-> (ListObjectChildren
    -> Maybe ConsistencyLevel -> ListObjectChildren)
-> Lens
     ListObjectChildren
     ListObjectChildren
     (Maybe ConsistencyLevel)
     (Maybe ConsistencyLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectChildren' {Maybe ConsistencyLevel
consistencyLevel :: Maybe ConsistencyLevel
$sel:consistencyLevel:ListObjectChildren' :: ListObjectChildren -> Maybe ConsistencyLevel
consistencyLevel} -> Maybe ConsistencyLevel
consistencyLevel) (\s :: ListObjectChildren
s@ListObjectChildren' {} Maybe ConsistencyLevel
a -> ListObjectChildren
s {$sel:consistencyLevel:ListObjectChildren' :: Maybe ConsistencyLevel
consistencyLevel = Maybe ConsistencyLevel
a} :: ListObjectChildren)

-- | The pagination token.
listObjectChildren_nextToken :: Lens.Lens' ListObjectChildren (Prelude.Maybe Prelude.Text)
listObjectChildren_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListObjectChildren -> f ListObjectChildren
listObjectChildren_nextToken = (ListObjectChildren -> Maybe Text)
-> (ListObjectChildren -> Maybe Text -> ListObjectChildren)
-> Lens
     ListObjectChildren ListObjectChildren (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectChildren' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListObjectChildren' :: ListObjectChildren -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListObjectChildren
s@ListObjectChildren' {} Maybe Text
a -> ListObjectChildren
s {$sel:nextToken:ListObjectChildren' :: Maybe Text
nextToken = Maybe Text
a} :: ListObjectChildren)

-- | The maximum number of items to be retrieved in a single call. This is an
-- approximate number.
listObjectChildren_maxResults :: Lens.Lens' ListObjectChildren (Prelude.Maybe Prelude.Natural)
listObjectChildren_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListObjectChildren -> f ListObjectChildren
listObjectChildren_maxResults = (ListObjectChildren -> Maybe Natural)
-> (ListObjectChildren -> Maybe Natural -> ListObjectChildren)
-> Lens
     ListObjectChildren
     ListObjectChildren
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectChildren' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListObjectChildren' :: ListObjectChildren -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListObjectChildren
s@ListObjectChildren' {} Maybe Natural
a -> ListObjectChildren
s {$sel:maxResults:ListObjectChildren' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListObjectChildren)

-- | The Amazon Resource Name (ARN) that is associated with the Directory
-- where the object resides. For more information, see arns.
listObjectChildren_directoryArn :: Lens.Lens' ListObjectChildren Prelude.Text
listObjectChildren_directoryArn :: (Text -> f Text) -> ListObjectChildren -> f ListObjectChildren
listObjectChildren_directoryArn = (ListObjectChildren -> Text)
-> (ListObjectChildren -> Text -> ListObjectChildren)
-> Lens ListObjectChildren ListObjectChildren Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectChildren' {Text
directoryArn :: Text
$sel:directoryArn:ListObjectChildren' :: ListObjectChildren -> Text
directoryArn} -> Text
directoryArn) (\s :: ListObjectChildren
s@ListObjectChildren' {} Text
a -> ListObjectChildren
s {$sel:directoryArn:ListObjectChildren' :: Text
directoryArn = Text
a} :: ListObjectChildren)

-- | The reference that identifies the object for which child objects are
-- being listed.
listObjectChildren_objectReference :: Lens.Lens' ListObjectChildren ObjectReference
listObjectChildren_objectReference :: (ObjectReference -> f ObjectReference)
-> ListObjectChildren -> f ListObjectChildren
listObjectChildren_objectReference = (ListObjectChildren -> ObjectReference)
-> (ListObjectChildren -> ObjectReference -> ListObjectChildren)
-> Lens
     ListObjectChildren
     ListObjectChildren
     ObjectReference
     ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectChildren' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:ListObjectChildren' :: ListObjectChildren -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: ListObjectChildren
s@ListObjectChildren' {} ObjectReference
a -> ListObjectChildren
s {$sel:objectReference:ListObjectChildren' :: ObjectReference
objectReference = ObjectReference
a} :: ListObjectChildren)

instance Core.AWSRequest ListObjectChildren where
  type
    AWSResponse ListObjectChildren =
      ListObjectChildrenResponse
  request :: ListObjectChildren -> Request ListObjectChildren
request = Service -> ListObjectChildren -> Request ListObjectChildren
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListObjectChildren
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListObjectChildren)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListObjectChildren))
-> Logger
-> Service
-> Proxy ListObjectChildren
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListObjectChildren)))
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 (HashMap Text Text)
-> Maybe Text -> Int -> ListObjectChildrenResponse
ListObjectChildrenResponse'
            (Maybe (HashMap Text Text)
 -> Maybe Text -> Int -> ListObjectChildrenResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Maybe Text -> Int -> ListObjectChildrenResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Children" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListObjectChildrenResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListObjectChildrenResponse)
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
"NextToken")
            Either String (Int -> ListObjectChildrenResponse)
-> Either String Int -> Either String ListObjectChildrenResponse
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 ListObjectChildren

instance Prelude.NFData ListObjectChildren

instance Core.ToHeaders ListObjectChildren where
  toHeaders :: ListObjectChildren -> ResponseHeaders
toHeaders ListObjectChildren' {Maybe Natural
Maybe Text
Maybe ConsistencyLevel
Text
ObjectReference
objectReference :: ObjectReference
directoryArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
consistencyLevel :: Maybe ConsistencyLevel
$sel:objectReference:ListObjectChildren' :: ListObjectChildren -> ObjectReference
$sel:directoryArn:ListObjectChildren' :: ListObjectChildren -> Text
$sel:maxResults:ListObjectChildren' :: ListObjectChildren -> Maybe Natural
$sel:nextToken:ListObjectChildren' :: ListObjectChildren -> Maybe Text
$sel:consistencyLevel:ListObjectChildren' :: ListObjectChildren -> Maybe ConsistencyLevel
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-consistency-level" HeaderName -> Maybe ConsistencyLevel -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ConsistencyLevel
consistencyLevel,
        HeaderName
"x-amz-data-partition" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
directoryArn
      ]

instance Core.ToJSON ListObjectChildren where
  toJSON :: ListObjectChildren -> Value
toJSON ListObjectChildren' {Maybe Natural
Maybe Text
Maybe ConsistencyLevel
Text
ObjectReference
objectReference :: ObjectReference
directoryArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
consistencyLevel :: Maybe ConsistencyLevel
$sel:objectReference:ListObjectChildren' :: ListObjectChildren -> ObjectReference
$sel:directoryArn:ListObjectChildren' :: ListObjectChildren -> Text
$sel:maxResults:ListObjectChildren' :: ListObjectChildren -> Maybe Natural
$sel:nextToken:ListObjectChildren' :: ListObjectChildren -> Maybe Text
$sel:consistencyLevel:ListObjectChildren' :: ListObjectChildren -> Maybe ConsistencyLevel
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ObjectReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
objectReference)
          ]
      )

instance Core.ToPath ListObjectChildren where
  toPath :: ListObjectChildren -> ByteString
toPath =
    ByteString -> ListObjectChildren -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/amazonclouddirectory/2017-01-11/object/children"

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

-- | /See:/ 'newListObjectChildrenResponse' smart constructor.
data ListObjectChildrenResponse = ListObjectChildrenResponse'
  { -- | Children structure, which is a map with key as the @LinkName@ and
    -- @ObjectIdentifier@ as the value.
    ListObjectChildrenResponse -> Maybe (HashMap Text Text)
children :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The pagination token.
    ListObjectChildrenResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListObjectChildrenResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListObjectChildrenResponse -> ListObjectChildrenResponse -> Bool
(ListObjectChildrenResponse -> ListObjectChildrenResponse -> Bool)
-> (ListObjectChildrenResponse
    -> ListObjectChildrenResponse -> Bool)
-> Eq ListObjectChildrenResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListObjectChildrenResponse -> ListObjectChildrenResponse -> Bool
$c/= :: ListObjectChildrenResponse -> ListObjectChildrenResponse -> Bool
== :: ListObjectChildrenResponse -> ListObjectChildrenResponse -> Bool
$c== :: ListObjectChildrenResponse -> ListObjectChildrenResponse -> Bool
Prelude.Eq, ReadPrec [ListObjectChildrenResponse]
ReadPrec ListObjectChildrenResponse
Int -> ReadS ListObjectChildrenResponse
ReadS [ListObjectChildrenResponse]
(Int -> ReadS ListObjectChildrenResponse)
-> ReadS [ListObjectChildrenResponse]
-> ReadPrec ListObjectChildrenResponse
-> ReadPrec [ListObjectChildrenResponse]
-> Read ListObjectChildrenResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListObjectChildrenResponse]
$creadListPrec :: ReadPrec [ListObjectChildrenResponse]
readPrec :: ReadPrec ListObjectChildrenResponse
$creadPrec :: ReadPrec ListObjectChildrenResponse
readList :: ReadS [ListObjectChildrenResponse]
$creadList :: ReadS [ListObjectChildrenResponse]
readsPrec :: Int -> ReadS ListObjectChildrenResponse
$creadsPrec :: Int -> ReadS ListObjectChildrenResponse
Prelude.Read, Int -> ListObjectChildrenResponse -> ShowS
[ListObjectChildrenResponse] -> ShowS
ListObjectChildrenResponse -> String
(Int -> ListObjectChildrenResponse -> ShowS)
-> (ListObjectChildrenResponse -> String)
-> ([ListObjectChildrenResponse] -> ShowS)
-> Show ListObjectChildrenResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListObjectChildrenResponse] -> ShowS
$cshowList :: [ListObjectChildrenResponse] -> ShowS
show :: ListObjectChildrenResponse -> String
$cshow :: ListObjectChildrenResponse -> String
showsPrec :: Int -> ListObjectChildrenResponse -> ShowS
$cshowsPrec :: Int -> ListObjectChildrenResponse -> ShowS
Prelude.Show, (forall x.
 ListObjectChildrenResponse -> Rep ListObjectChildrenResponse x)
-> (forall x.
    Rep ListObjectChildrenResponse x -> ListObjectChildrenResponse)
-> Generic ListObjectChildrenResponse
forall x.
Rep ListObjectChildrenResponse x -> ListObjectChildrenResponse
forall x.
ListObjectChildrenResponse -> Rep ListObjectChildrenResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListObjectChildrenResponse x -> ListObjectChildrenResponse
$cfrom :: forall x.
ListObjectChildrenResponse -> Rep ListObjectChildrenResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListObjectChildrenResponse' 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:
--
-- 'children', 'listObjectChildrenResponse_children' - Children structure, which is a map with key as the @LinkName@ and
-- @ObjectIdentifier@ as the value.
--
-- 'nextToken', 'listObjectChildrenResponse_nextToken' - The pagination token.
--
-- 'httpStatus', 'listObjectChildrenResponse_httpStatus' - The response's http status code.
newListObjectChildrenResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListObjectChildrenResponse
newListObjectChildrenResponse :: Int -> ListObjectChildrenResponse
newListObjectChildrenResponse Int
pHttpStatus_ =
  ListObjectChildrenResponse' :: Maybe (HashMap Text Text)
-> Maybe Text -> Int -> ListObjectChildrenResponse
ListObjectChildrenResponse'
    { $sel:children:ListObjectChildrenResponse' :: Maybe (HashMap Text Text)
children =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListObjectChildrenResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListObjectChildrenResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Children structure, which is a map with key as the @LinkName@ and
-- @ObjectIdentifier@ as the value.
listObjectChildrenResponse_children :: Lens.Lens' ListObjectChildrenResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
listObjectChildrenResponse_children :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListObjectChildrenResponse -> f ListObjectChildrenResponse
listObjectChildrenResponse_children = (ListObjectChildrenResponse -> Maybe (HashMap Text Text))
-> (ListObjectChildrenResponse
    -> Maybe (HashMap Text Text) -> ListObjectChildrenResponse)
-> Lens
     ListObjectChildrenResponse
     ListObjectChildrenResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectChildrenResponse' {Maybe (HashMap Text Text)
children :: Maybe (HashMap Text Text)
$sel:children:ListObjectChildrenResponse' :: ListObjectChildrenResponse -> Maybe (HashMap Text Text)
children} -> Maybe (HashMap Text Text)
children) (\s :: ListObjectChildrenResponse
s@ListObjectChildrenResponse' {} Maybe (HashMap Text Text)
a -> ListObjectChildrenResponse
s {$sel:children:ListObjectChildrenResponse' :: Maybe (HashMap Text Text)
children = Maybe (HashMap Text Text)
a} :: ListObjectChildrenResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ListObjectChildrenResponse -> f ListObjectChildrenResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListObjectChildrenResponse
-> f ListObjectChildrenResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token.
listObjectChildrenResponse_nextToken :: Lens.Lens' ListObjectChildrenResponse (Prelude.Maybe Prelude.Text)
listObjectChildrenResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListObjectChildrenResponse -> f ListObjectChildrenResponse
listObjectChildrenResponse_nextToken = (ListObjectChildrenResponse -> Maybe Text)
-> (ListObjectChildrenResponse
    -> Maybe Text -> ListObjectChildrenResponse)
-> Lens
     ListObjectChildrenResponse
     ListObjectChildrenResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListObjectChildrenResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListObjectChildrenResponse' :: ListObjectChildrenResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListObjectChildrenResponse
s@ListObjectChildrenResponse' {} Maybe Text
a -> ListObjectChildrenResponse
s {$sel:nextToken:ListObjectChildrenResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListObjectChildrenResponse)

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

instance Prelude.NFData ListObjectChildrenResponse