{-# 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.ListAppliedSchemaArns
-- 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)
--
-- Lists schema major versions applied to a directory. If @SchemaArn@ is
-- provided, lists the minor version.
--
-- This operation returns paginated results.
module Amazonka.CloudDirectory.ListAppliedSchemaArns
  ( -- * Creating a Request
    ListAppliedSchemaArns (..),
    newListAppliedSchemaArns,

    -- * Request Lenses
    listAppliedSchemaArns_nextToken,
    listAppliedSchemaArns_schemaArn,
    listAppliedSchemaArns_maxResults,
    listAppliedSchemaArns_directoryArn,

    -- * Destructuring the Response
    ListAppliedSchemaArnsResponse (..),
    newListAppliedSchemaArnsResponse,

    -- * Response Lenses
    listAppliedSchemaArnsResponse_schemaArns,
    listAppliedSchemaArnsResponse_nextToken,
    listAppliedSchemaArnsResponse_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:/ 'newListAppliedSchemaArns' smart constructor.
data ListAppliedSchemaArns = ListAppliedSchemaArns'
  { -- | The pagination token.
    ListAppliedSchemaArns -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response for @ListAppliedSchemaArns@ when this parameter is used
    -- will list all minor version ARNs for a major version.
    ListAppliedSchemaArns -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to retrieve.
    ListAppliedSchemaArns -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the directory you are listing.
    ListAppliedSchemaArns -> Text
directoryArn :: Prelude.Text
  }
  deriving (ListAppliedSchemaArns -> ListAppliedSchemaArns -> Bool
(ListAppliedSchemaArns -> ListAppliedSchemaArns -> Bool)
-> (ListAppliedSchemaArns -> ListAppliedSchemaArns -> Bool)
-> Eq ListAppliedSchemaArns
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppliedSchemaArns -> ListAppliedSchemaArns -> Bool
$c/= :: ListAppliedSchemaArns -> ListAppliedSchemaArns -> Bool
== :: ListAppliedSchemaArns -> ListAppliedSchemaArns -> Bool
$c== :: ListAppliedSchemaArns -> ListAppliedSchemaArns -> Bool
Prelude.Eq, ReadPrec [ListAppliedSchemaArns]
ReadPrec ListAppliedSchemaArns
Int -> ReadS ListAppliedSchemaArns
ReadS [ListAppliedSchemaArns]
(Int -> ReadS ListAppliedSchemaArns)
-> ReadS [ListAppliedSchemaArns]
-> ReadPrec ListAppliedSchemaArns
-> ReadPrec [ListAppliedSchemaArns]
-> Read ListAppliedSchemaArns
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppliedSchemaArns]
$creadListPrec :: ReadPrec [ListAppliedSchemaArns]
readPrec :: ReadPrec ListAppliedSchemaArns
$creadPrec :: ReadPrec ListAppliedSchemaArns
readList :: ReadS [ListAppliedSchemaArns]
$creadList :: ReadS [ListAppliedSchemaArns]
readsPrec :: Int -> ReadS ListAppliedSchemaArns
$creadsPrec :: Int -> ReadS ListAppliedSchemaArns
Prelude.Read, Int -> ListAppliedSchemaArns -> ShowS
[ListAppliedSchemaArns] -> ShowS
ListAppliedSchemaArns -> String
(Int -> ListAppliedSchemaArns -> ShowS)
-> (ListAppliedSchemaArns -> String)
-> ([ListAppliedSchemaArns] -> ShowS)
-> Show ListAppliedSchemaArns
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppliedSchemaArns] -> ShowS
$cshowList :: [ListAppliedSchemaArns] -> ShowS
show :: ListAppliedSchemaArns -> String
$cshow :: ListAppliedSchemaArns -> String
showsPrec :: Int -> ListAppliedSchemaArns -> ShowS
$cshowsPrec :: Int -> ListAppliedSchemaArns -> ShowS
Prelude.Show, (forall x. ListAppliedSchemaArns -> Rep ListAppliedSchemaArns x)
-> (forall x. Rep ListAppliedSchemaArns x -> ListAppliedSchemaArns)
-> Generic ListAppliedSchemaArns
forall x. Rep ListAppliedSchemaArns x -> ListAppliedSchemaArns
forall x. ListAppliedSchemaArns -> Rep ListAppliedSchemaArns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppliedSchemaArns x -> ListAppliedSchemaArns
$cfrom :: forall x. ListAppliedSchemaArns -> Rep ListAppliedSchemaArns x
Prelude.Generic)

-- |
-- Create a value of 'ListAppliedSchemaArns' 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:
--
-- 'nextToken', 'listAppliedSchemaArns_nextToken' - The pagination token.
--
-- 'schemaArn', 'listAppliedSchemaArns_schemaArn' - The response for @ListAppliedSchemaArns@ when this parameter is used
-- will list all minor version ARNs for a major version.
--
-- 'maxResults', 'listAppliedSchemaArns_maxResults' - The maximum number of results to retrieve.
--
-- 'directoryArn', 'listAppliedSchemaArns_directoryArn' - The ARN of the directory you are listing.
newListAppliedSchemaArns ::
  -- | 'directoryArn'
  Prelude.Text ->
  ListAppliedSchemaArns
newListAppliedSchemaArns :: Text -> ListAppliedSchemaArns
newListAppliedSchemaArns Text
pDirectoryArn_ =
  ListAppliedSchemaArns' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> ListAppliedSchemaArns
ListAppliedSchemaArns'
    { $sel:nextToken:ListAppliedSchemaArns' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:ListAppliedSchemaArns' :: Maybe Text
schemaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAppliedSchemaArns' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:directoryArn:ListAppliedSchemaArns' :: Text
directoryArn = Text
pDirectoryArn_
    }

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

-- | The response for @ListAppliedSchemaArns@ when this parameter is used
-- will list all minor version ARNs for a major version.
listAppliedSchemaArns_schemaArn :: Lens.Lens' ListAppliedSchemaArns (Prelude.Maybe Prelude.Text)
listAppliedSchemaArns_schemaArn :: (Maybe Text -> f (Maybe Text))
-> ListAppliedSchemaArns -> f ListAppliedSchemaArns
listAppliedSchemaArns_schemaArn = (ListAppliedSchemaArns -> Maybe Text)
-> (ListAppliedSchemaArns -> Maybe Text -> ListAppliedSchemaArns)
-> Lens
     ListAppliedSchemaArns
     ListAppliedSchemaArns
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppliedSchemaArns' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:ListAppliedSchemaArns' :: ListAppliedSchemaArns -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: ListAppliedSchemaArns
s@ListAppliedSchemaArns' {} Maybe Text
a -> ListAppliedSchemaArns
s {$sel:schemaArn:ListAppliedSchemaArns' :: Maybe Text
schemaArn = Maybe Text
a} :: ListAppliedSchemaArns)

-- | The maximum number of results to retrieve.
listAppliedSchemaArns_maxResults :: Lens.Lens' ListAppliedSchemaArns (Prelude.Maybe Prelude.Natural)
listAppliedSchemaArns_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAppliedSchemaArns -> f ListAppliedSchemaArns
listAppliedSchemaArns_maxResults = (ListAppliedSchemaArns -> Maybe Natural)
-> (ListAppliedSchemaArns
    -> Maybe Natural -> ListAppliedSchemaArns)
-> Lens
     ListAppliedSchemaArns
     ListAppliedSchemaArns
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppliedSchemaArns' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAppliedSchemaArns' :: ListAppliedSchemaArns -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAppliedSchemaArns
s@ListAppliedSchemaArns' {} Maybe Natural
a -> ListAppliedSchemaArns
s {$sel:maxResults:ListAppliedSchemaArns' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAppliedSchemaArns)

-- | The ARN of the directory you are listing.
listAppliedSchemaArns_directoryArn :: Lens.Lens' ListAppliedSchemaArns Prelude.Text
listAppliedSchemaArns_directoryArn :: (Text -> f Text)
-> ListAppliedSchemaArns -> f ListAppliedSchemaArns
listAppliedSchemaArns_directoryArn = (ListAppliedSchemaArns -> Text)
-> (ListAppliedSchemaArns -> Text -> ListAppliedSchemaArns)
-> Lens ListAppliedSchemaArns ListAppliedSchemaArns Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppliedSchemaArns' {Text
directoryArn :: Text
$sel:directoryArn:ListAppliedSchemaArns' :: ListAppliedSchemaArns -> Text
directoryArn} -> Text
directoryArn) (\s :: ListAppliedSchemaArns
s@ListAppliedSchemaArns' {} Text
a -> ListAppliedSchemaArns
s {$sel:directoryArn:ListAppliedSchemaArns' :: Text
directoryArn = Text
a} :: ListAppliedSchemaArns)

instance Core.AWSPager ListAppliedSchemaArns where
  page :: ListAppliedSchemaArns
-> AWSResponse ListAppliedSchemaArns -> Maybe ListAppliedSchemaArns
page ListAppliedSchemaArns
rq AWSResponse ListAppliedSchemaArns
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAppliedSchemaArns
ListAppliedSchemaArnsResponse
rs
            ListAppliedSchemaArnsResponse
-> Getting (First Text) ListAppliedSchemaArnsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAppliedSchemaArnsResponse
-> Const (First Text) ListAppliedSchemaArnsResponse
Lens' ListAppliedSchemaArnsResponse (Maybe Text)
listAppliedSchemaArnsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAppliedSchemaArnsResponse
 -> Const (First Text) ListAppliedSchemaArnsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAppliedSchemaArnsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAppliedSchemaArns
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAppliedSchemaArns
ListAppliedSchemaArnsResponse
rs
            ListAppliedSchemaArnsResponse
-> Getting (First [Text]) ListAppliedSchemaArnsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListAppliedSchemaArnsResponse
-> Const (First [Text]) ListAppliedSchemaArnsResponse
Lens' ListAppliedSchemaArnsResponse (Maybe [Text])
listAppliedSchemaArnsResponse_schemaArns
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListAppliedSchemaArnsResponse
 -> Const (First [Text]) ListAppliedSchemaArnsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListAppliedSchemaArnsResponse [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> Const (First [Text]) [Text])
-> Maybe [Text] -> Const (First [Text]) (Maybe [Text])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAppliedSchemaArns
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAppliedSchemaArns -> Maybe ListAppliedSchemaArns
forall a. a -> Maybe a
Prelude.Just (ListAppliedSchemaArns -> Maybe ListAppliedSchemaArns)
-> ListAppliedSchemaArns -> Maybe ListAppliedSchemaArns
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAppliedSchemaArns
rq
          ListAppliedSchemaArns
-> (ListAppliedSchemaArns -> ListAppliedSchemaArns)
-> ListAppliedSchemaArns
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAppliedSchemaArns -> Identity ListAppliedSchemaArns
Lens
  ListAppliedSchemaArns
  ListAppliedSchemaArns
  (Maybe Text)
  (Maybe Text)
listAppliedSchemaArns_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAppliedSchemaArns -> Identity ListAppliedSchemaArns)
-> Maybe Text -> ListAppliedSchemaArns -> ListAppliedSchemaArns
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAppliedSchemaArns
ListAppliedSchemaArnsResponse
rs
          ListAppliedSchemaArnsResponse
-> Getting (First Text) ListAppliedSchemaArnsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAppliedSchemaArnsResponse
-> Const (First Text) ListAppliedSchemaArnsResponse
Lens' ListAppliedSchemaArnsResponse (Maybe Text)
listAppliedSchemaArnsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAppliedSchemaArnsResponse
 -> Const (First Text) ListAppliedSchemaArnsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAppliedSchemaArnsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListAppliedSchemaArns where
  type
    AWSResponse ListAppliedSchemaArns =
      ListAppliedSchemaArnsResponse
  request :: ListAppliedSchemaArns -> Request ListAppliedSchemaArns
request = Service -> ListAppliedSchemaArns -> Request ListAppliedSchemaArns
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAppliedSchemaArns
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAppliedSchemaArns)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAppliedSchemaArns))
-> Logger
-> Service
-> Proxy ListAppliedSchemaArns
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAppliedSchemaArns)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Text] -> Maybe Text -> Int -> ListAppliedSchemaArnsResponse
ListAppliedSchemaArnsResponse'
            (Maybe [Text]
 -> Maybe Text -> Int -> ListAppliedSchemaArnsResponse)
-> Either String (Maybe [Text])
-> Either
     String (Maybe Text -> Int -> ListAppliedSchemaArnsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SchemaArns" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListAppliedSchemaArnsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListAppliedSchemaArnsResponse)
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 -> ListAppliedSchemaArnsResponse)
-> Either String Int -> Either String ListAppliedSchemaArnsResponse
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 ListAppliedSchemaArns

instance Prelude.NFData ListAppliedSchemaArns

instance Core.ToHeaders ListAppliedSchemaArns where
  toHeaders :: ListAppliedSchemaArns -> ResponseHeaders
toHeaders = ResponseHeaders -> ListAppliedSchemaArns -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON ListAppliedSchemaArns where
  toJSON :: ListAppliedSchemaArns -> Value
toJSON ListAppliedSchemaArns' {Maybe Natural
Maybe Text
Text
directoryArn :: Text
maxResults :: Maybe Natural
schemaArn :: Maybe Text
nextToken :: Maybe Text
$sel:directoryArn:ListAppliedSchemaArns' :: ListAppliedSchemaArns -> Text
$sel:maxResults:ListAppliedSchemaArns' :: ListAppliedSchemaArns -> Maybe Natural
$sel:schemaArn:ListAppliedSchemaArns' :: ListAppliedSchemaArns -> Maybe Text
$sel:nextToken:ListAppliedSchemaArns' :: ListAppliedSchemaArns -> Maybe Text
..} =
    [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
"SchemaArn" 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
schemaArn,
            (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
"DirectoryArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryArn)
          ]
      )

instance Core.ToPath ListAppliedSchemaArns where
  toPath :: ListAppliedSchemaArns -> ByteString
toPath =
    ByteString -> ListAppliedSchemaArns -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/amazonclouddirectory/2017-01-11/schema/applied"

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

-- | /See:/ 'newListAppliedSchemaArnsResponse' smart constructor.
data ListAppliedSchemaArnsResponse = ListAppliedSchemaArnsResponse'
  { -- | The ARNs of schemas that are applied to the directory.
    ListAppliedSchemaArnsResponse -> Maybe [Text]
schemaArns :: Prelude.Maybe [Prelude.Text],
    -- | The pagination token.
    ListAppliedSchemaArnsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAppliedSchemaArnsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAppliedSchemaArnsResponse
-> ListAppliedSchemaArnsResponse -> Bool
(ListAppliedSchemaArnsResponse
 -> ListAppliedSchemaArnsResponse -> Bool)
-> (ListAppliedSchemaArnsResponse
    -> ListAppliedSchemaArnsResponse -> Bool)
-> Eq ListAppliedSchemaArnsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppliedSchemaArnsResponse
-> ListAppliedSchemaArnsResponse -> Bool
$c/= :: ListAppliedSchemaArnsResponse
-> ListAppliedSchemaArnsResponse -> Bool
== :: ListAppliedSchemaArnsResponse
-> ListAppliedSchemaArnsResponse -> Bool
$c== :: ListAppliedSchemaArnsResponse
-> ListAppliedSchemaArnsResponse -> Bool
Prelude.Eq, ReadPrec [ListAppliedSchemaArnsResponse]
ReadPrec ListAppliedSchemaArnsResponse
Int -> ReadS ListAppliedSchemaArnsResponse
ReadS [ListAppliedSchemaArnsResponse]
(Int -> ReadS ListAppliedSchemaArnsResponse)
-> ReadS [ListAppliedSchemaArnsResponse]
-> ReadPrec ListAppliedSchemaArnsResponse
-> ReadPrec [ListAppliedSchemaArnsResponse]
-> Read ListAppliedSchemaArnsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppliedSchemaArnsResponse]
$creadListPrec :: ReadPrec [ListAppliedSchemaArnsResponse]
readPrec :: ReadPrec ListAppliedSchemaArnsResponse
$creadPrec :: ReadPrec ListAppliedSchemaArnsResponse
readList :: ReadS [ListAppliedSchemaArnsResponse]
$creadList :: ReadS [ListAppliedSchemaArnsResponse]
readsPrec :: Int -> ReadS ListAppliedSchemaArnsResponse
$creadsPrec :: Int -> ReadS ListAppliedSchemaArnsResponse
Prelude.Read, Int -> ListAppliedSchemaArnsResponse -> ShowS
[ListAppliedSchemaArnsResponse] -> ShowS
ListAppliedSchemaArnsResponse -> String
(Int -> ListAppliedSchemaArnsResponse -> ShowS)
-> (ListAppliedSchemaArnsResponse -> String)
-> ([ListAppliedSchemaArnsResponse] -> ShowS)
-> Show ListAppliedSchemaArnsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppliedSchemaArnsResponse] -> ShowS
$cshowList :: [ListAppliedSchemaArnsResponse] -> ShowS
show :: ListAppliedSchemaArnsResponse -> String
$cshow :: ListAppliedSchemaArnsResponse -> String
showsPrec :: Int -> ListAppliedSchemaArnsResponse -> ShowS
$cshowsPrec :: Int -> ListAppliedSchemaArnsResponse -> ShowS
Prelude.Show, (forall x.
 ListAppliedSchemaArnsResponse
 -> Rep ListAppliedSchemaArnsResponse x)
-> (forall x.
    Rep ListAppliedSchemaArnsResponse x
    -> ListAppliedSchemaArnsResponse)
-> Generic ListAppliedSchemaArnsResponse
forall x.
Rep ListAppliedSchemaArnsResponse x
-> ListAppliedSchemaArnsResponse
forall x.
ListAppliedSchemaArnsResponse
-> Rep ListAppliedSchemaArnsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAppliedSchemaArnsResponse x
-> ListAppliedSchemaArnsResponse
$cfrom :: forall x.
ListAppliedSchemaArnsResponse
-> Rep ListAppliedSchemaArnsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAppliedSchemaArnsResponse' 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:
--
-- 'schemaArns', 'listAppliedSchemaArnsResponse_schemaArns' - The ARNs of schemas that are applied to the directory.
--
-- 'nextToken', 'listAppliedSchemaArnsResponse_nextToken' - The pagination token.
--
-- 'httpStatus', 'listAppliedSchemaArnsResponse_httpStatus' - The response's http status code.
newListAppliedSchemaArnsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAppliedSchemaArnsResponse
newListAppliedSchemaArnsResponse :: Int -> ListAppliedSchemaArnsResponse
newListAppliedSchemaArnsResponse Int
pHttpStatus_ =
  ListAppliedSchemaArnsResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListAppliedSchemaArnsResponse
ListAppliedSchemaArnsResponse'
    { $sel:schemaArns:ListAppliedSchemaArnsResponse' :: Maybe [Text]
schemaArns =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAppliedSchemaArnsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAppliedSchemaArnsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARNs of schemas that are applied to the directory.
listAppliedSchemaArnsResponse_schemaArns :: Lens.Lens' ListAppliedSchemaArnsResponse (Prelude.Maybe [Prelude.Text])
listAppliedSchemaArnsResponse_schemaArns :: (Maybe [Text] -> f (Maybe [Text]))
-> ListAppliedSchemaArnsResponse -> f ListAppliedSchemaArnsResponse
listAppliedSchemaArnsResponse_schemaArns = (ListAppliedSchemaArnsResponse -> Maybe [Text])
-> (ListAppliedSchemaArnsResponse
    -> Maybe [Text] -> ListAppliedSchemaArnsResponse)
-> Lens' ListAppliedSchemaArnsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppliedSchemaArnsResponse' {Maybe [Text]
schemaArns :: Maybe [Text]
$sel:schemaArns:ListAppliedSchemaArnsResponse' :: ListAppliedSchemaArnsResponse -> Maybe [Text]
schemaArns} -> Maybe [Text]
schemaArns) (\s :: ListAppliedSchemaArnsResponse
s@ListAppliedSchemaArnsResponse' {} Maybe [Text]
a -> ListAppliedSchemaArnsResponse
s {$sel:schemaArns:ListAppliedSchemaArnsResponse' :: Maybe [Text]
schemaArns = Maybe [Text]
a} :: ListAppliedSchemaArnsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListAppliedSchemaArnsResponse
 -> f ListAppliedSchemaArnsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListAppliedSchemaArnsResponse
-> f ListAppliedSchemaArnsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData ListAppliedSchemaArnsResponse