{-# 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.Schemas.SearchSchemas
-- 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)
--
-- Search the schemas
--
-- This operation returns paginated results.
module Amazonka.Schemas.SearchSchemas
  ( -- * Creating a Request
    SearchSchemas (..),
    newSearchSchemas,

    -- * Request Lenses
    searchSchemas_nextToken,
    searchSchemas_limit,
    searchSchemas_registryName,
    searchSchemas_keywords,

    -- * Destructuring the Response
    SearchSchemasResponse (..),
    newSearchSchemasResponse,

    -- * Response Lenses
    searchSchemasResponse_schemas,
    searchSchemasResponse_nextToken,
    searchSchemasResponse_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.Schemas.Types

-- | /See:/ 'newSearchSchemas' smart constructor.
data SearchSchemas = SearchSchemas'
  { -- | The token that specifies the next page of results to return. To request
    -- the first page, leave NextToken empty. The token will expire in 24
    -- hours, and cannot be shared with other accounts.
    SearchSchemas -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    SearchSchemas -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The name of the registry.
    SearchSchemas -> Text
registryName :: Prelude.Text,
    -- | Specifying this limits the results to only schemas that include the
    -- provided keywords.
    SearchSchemas -> Text
keywords :: Prelude.Text
  }
  deriving (SearchSchemas -> SearchSchemas -> Bool
(SearchSchemas -> SearchSchemas -> Bool)
-> (SearchSchemas -> SearchSchemas -> Bool) -> Eq SearchSchemas
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchSchemas -> SearchSchemas -> Bool
$c/= :: SearchSchemas -> SearchSchemas -> Bool
== :: SearchSchemas -> SearchSchemas -> Bool
$c== :: SearchSchemas -> SearchSchemas -> Bool
Prelude.Eq, ReadPrec [SearchSchemas]
ReadPrec SearchSchemas
Int -> ReadS SearchSchemas
ReadS [SearchSchemas]
(Int -> ReadS SearchSchemas)
-> ReadS [SearchSchemas]
-> ReadPrec SearchSchemas
-> ReadPrec [SearchSchemas]
-> Read SearchSchemas
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchSchemas]
$creadListPrec :: ReadPrec [SearchSchemas]
readPrec :: ReadPrec SearchSchemas
$creadPrec :: ReadPrec SearchSchemas
readList :: ReadS [SearchSchemas]
$creadList :: ReadS [SearchSchemas]
readsPrec :: Int -> ReadS SearchSchemas
$creadsPrec :: Int -> ReadS SearchSchemas
Prelude.Read, Int -> SearchSchemas -> ShowS
[SearchSchemas] -> ShowS
SearchSchemas -> String
(Int -> SearchSchemas -> ShowS)
-> (SearchSchemas -> String)
-> ([SearchSchemas] -> ShowS)
-> Show SearchSchemas
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchSchemas] -> ShowS
$cshowList :: [SearchSchemas] -> ShowS
show :: SearchSchemas -> String
$cshow :: SearchSchemas -> String
showsPrec :: Int -> SearchSchemas -> ShowS
$cshowsPrec :: Int -> SearchSchemas -> ShowS
Prelude.Show, (forall x. SearchSchemas -> Rep SearchSchemas x)
-> (forall x. Rep SearchSchemas x -> SearchSchemas)
-> Generic SearchSchemas
forall x. Rep SearchSchemas x -> SearchSchemas
forall x. SearchSchemas -> Rep SearchSchemas x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchSchemas x -> SearchSchemas
$cfrom :: forall x. SearchSchemas -> Rep SearchSchemas x
Prelude.Generic)

-- |
-- Create a value of 'SearchSchemas' 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', 'searchSchemas_nextToken' - The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
--
-- 'limit', 'searchSchemas_limit' - Undocumented member.
--
-- 'registryName', 'searchSchemas_registryName' - The name of the registry.
--
-- 'keywords', 'searchSchemas_keywords' - Specifying this limits the results to only schemas that include the
-- provided keywords.
newSearchSchemas ::
  -- | 'registryName'
  Prelude.Text ->
  -- | 'keywords'
  Prelude.Text ->
  SearchSchemas
newSearchSchemas :: Text -> Text -> SearchSchemas
newSearchSchemas Text
pRegistryName_ Text
pKeywords_ =
  SearchSchemas' :: Maybe Text -> Maybe Int -> Text -> Text -> SearchSchemas
SearchSchemas'
    { $sel:nextToken:SearchSchemas' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:SearchSchemas' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:registryName:SearchSchemas' :: Text
registryName = Text
pRegistryName_,
      $sel:keywords:SearchSchemas' :: Text
keywords = Text
pKeywords_
    }

-- | The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
searchSchemas_nextToken :: Lens.Lens' SearchSchemas (Prelude.Maybe Prelude.Text)
searchSchemas_nextToken :: (Maybe Text -> f (Maybe Text)) -> SearchSchemas -> f SearchSchemas
searchSchemas_nextToken = (SearchSchemas -> Maybe Text)
-> (SearchSchemas -> Maybe Text -> SearchSchemas)
-> Lens SearchSchemas SearchSchemas (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSchemas' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchSchemas' :: SearchSchemas -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchSchemas
s@SearchSchemas' {} Maybe Text
a -> SearchSchemas
s {$sel:nextToken:SearchSchemas' :: Maybe Text
nextToken = Maybe Text
a} :: SearchSchemas)

-- | Undocumented member.
searchSchemas_limit :: Lens.Lens' SearchSchemas (Prelude.Maybe Prelude.Int)
searchSchemas_limit :: (Maybe Int -> f (Maybe Int)) -> SearchSchemas -> f SearchSchemas
searchSchemas_limit = (SearchSchemas -> Maybe Int)
-> (SearchSchemas -> Maybe Int -> SearchSchemas)
-> Lens SearchSchemas SearchSchemas (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSchemas' {Maybe Int
limit :: Maybe Int
$sel:limit:SearchSchemas' :: SearchSchemas -> Maybe Int
limit} -> Maybe Int
limit) (\s :: SearchSchemas
s@SearchSchemas' {} Maybe Int
a -> SearchSchemas
s {$sel:limit:SearchSchemas' :: Maybe Int
limit = Maybe Int
a} :: SearchSchemas)

-- | The name of the registry.
searchSchemas_registryName :: Lens.Lens' SearchSchemas Prelude.Text
searchSchemas_registryName :: (Text -> f Text) -> SearchSchemas -> f SearchSchemas
searchSchemas_registryName = (SearchSchemas -> Text)
-> (SearchSchemas -> Text -> SearchSchemas)
-> Lens SearchSchemas SearchSchemas Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSchemas' {Text
registryName :: Text
$sel:registryName:SearchSchemas' :: SearchSchemas -> Text
registryName} -> Text
registryName) (\s :: SearchSchemas
s@SearchSchemas' {} Text
a -> SearchSchemas
s {$sel:registryName:SearchSchemas' :: Text
registryName = Text
a} :: SearchSchemas)

-- | Specifying this limits the results to only schemas that include the
-- provided keywords.
searchSchemas_keywords :: Lens.Lens' SearchSchemas Prelude.Text
searchSchemas_keywords :: (Text -> f Text) -> SearchSchemas -> f SearchSchemas
searchSchemas_keywords = (SearchSchemas -> Text)
-> (SearchSchemas -> Text -> SearchSchemas)
-> Lens SearchSchemas SearchSchemas Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSchemas' {Text
keywords :: Text
$sel:keywords:SearchSchemas' :: SearchSchemas -> Text
keywords} -> Text
keywords) (\s :: SearchSchemas
s@SearchSchemas' {} Text
a -> SearchSchemas
s {$sel:keywords:SearchSchemas' :: Text
keywords = Text
a} :: SearchSchemas)

instance Core.AWSPager SearchSchemas where
  page :: SearchSchemas -> AWSResponse SearchSchemas -> Maybe SearchSchemas
page SearchSchemas
rq AWSResponse SearchSchemas
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse SearchSchemas
SearchSchemasResponse
rs
            SearchSchemasResponse
-> Getting (First Text) SearchSchemasResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchSchemasResponse
-> Const (First Text) SearchSchemasResponse
Lens' SearchSchemasResponse (Maybe Text)
searchSchemasResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> SearchSchemasResponse
 -> Const (First Text) SearchSchemasResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchSchemasResponse 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 SearchSchemas
forall a. Maybe a
Prelude.Nothing
    | Maybe [SearchSchemaSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse SearchSchemas
SearchSchemasResponse
rs
            SearchSchemasResponse
-> Getting
     (First [SearchSchemaSummary])
     SearchSchemasResponse
     [SearchSchemaSummary]
-> Maybe [SearchSchemaSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [SearchSchemaSummary]
 -> Const
      (First [SearchSchemaSummary]) (Maybe [SearchSchemaSummary]))
-> SearchSchemasResponse
-> Const (First [SearchSchemaSummary]) SearchSchemasResponse
Lens' SearchSchemasResponse (Maybe [SearchSchemaSummary])
searchSchemasResponse_schemas ((Maybe [SearchSchemaSummary]
  -> Const
       (First [SearchSchemaSummary]) (Maybe [SearchSchemaSummary]))
 -> SearchSchemasResponse
 -> Const (First [SearchSchemaSummary]) SearchSchemasResponse)
-> (([SearchSchemaSummary]
     -> Const (First [SearchSchemaSummary]) [SearchSchemaSummary])
    -> Maybe [SearchSchemaSummary]
    -> Const
         (First [SearchSchemaSummary]) (Maybe [SearchSchemaSummary]))
-> Getting
     (First [SearchSchemaSummary])
     SearchSchemasResponse
     [SearchSchemaSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SearchSchemaSummary]
 -> Const (First [SearchSchemaSummary]) [SearchSchemaSummary])
-> Maybe [SearchSchemaSummary]
-> Const
     (First [SearchSchemaSummary]) (Maybe [SearchSchemaSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe SearchSchemas
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      SearchSchemas -> Maybe SearchSchemas
forall a. a -> Maybe a
Prelude.Just (SearchSchemas -> Maybe SearchSchemas)
-> SearchSchemas -> Maybe SearchSchemas
forall a b. (a -> b) -> a -> b
Prelude.$
        SearchSchemas
rq
          SearchSchemas -> (SearchSchemas -> SearchSchemas) -> SearchSchemas
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> SearchSchemas -> Identity SearchSchemas
Lens SearchSchemas SearchSchemas (Maybe Text) (Maybe Text)
searchSchemas_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> SearchSchemas -> Identity SearchSchemas)
-> Maybe Text -> SearchSchemas -> SearchSchemas
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse SearchSchemas
SearchSchemasResponse
rs
          SearchSchemasResponse
-> Getting (First Text) SearchSchemasResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchSchemasResponse
-> Const (First Text) SearchSchemasResponse
Lens' SearchSchemasResponse (Maybe Text)
searchSchemasResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> SearchSchemasResponse
 -> Const (First Text) SearchSchemasResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchSchemasResponse 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 SearchSchemas where
  type
    AWSResponse SearchSchemas =
      SearchSchemasResponse
  request :: SearchSchemas -> Request SearchSchemas
request = Service -> SearchSchemas -> Request SearchSchemas
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy SearchSchemas
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchSchemas)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SearchSchemas))
-> Logger
-> Service
-> Proxy SearchSchemas
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchSchemas)))
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 [SearchSchemaSummary]
-> Maybe Text -> Int -> SearchSchemasResponse
SearchSchemasResponse'
            (Maybe [SearchSchemaSummary]
 -> Maybe Text -> Int -> SearchSchemasResponse)
-> Either String (Maybe [SearchSchemaSummary])
-> Either String (Maybe Text -> Int -> SearchSchemasResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [SearchSchemaSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Schemas" Either String (Maybe (Maybe [SearchSchemaSummary]))
-> Maybe [SearchSchemaSummary]
-> Either String (Maybe [SearchSchemaSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SearchSchemaSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> SearchSchemasResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SearchSchemasResponse)
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 -> SearchSchemasResponse)
-> Either String Int -> Either String SearchSchemasResponse
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 SearchSchemas

instance Prelude.NFData SearchSchemas

instance Core.ToHeaders SearchSchemas where
  toHeaders :: SearchSchemas -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchSchemas -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 SearchSchemas where
  toPath :: SearchSchemas -> ByteString
toPath SearchSchemas' {Maybe Int
Maybe Text
Text
keywords :: Text
registryName :: Text
limit :: Maybe Int
nextToken :: Maybe Text
$sel:keywords:SearchSchemas' :: SearchSchemas -> Text
$sel:registryName:SearchSchemas' :: SearchSchemas -> Text
$sel:limit:SearchSchemas' :: SearchSchemas -> Maybe Int
$sel:nextToken:SearchSchemas' :: SearchSchemas -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/registries/name/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
registryName,
        ByteString
"/schemas/search"
      ]

instance Core.ToQuery SearchSchemas where
  toQuery :: SearchSchemas -> QueryString
toQuery SearchSchemas' {Maybe Int
Maybe Text
Text
keywords :: Text
registryName :: Text
limit :: Maybe Int
nextToken :: Maybe Text
$sel:keywords:SearchSchemas' :: SearchSchemas -> Text
$sel:registryName:SearchSchemas' :: SearchSchemas -> Text
$sel:limit:SearchSchemas' :: SearchSchemas -> Maybe Int
$sel:nextToken:SearchSchemas' :: SearchSchemas -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"limit" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
limit,
        ByteString
"keywords" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
keywords
      ]

-- | /See:/ 'newSearchSchemasResponse' smart constructor.
data SearchSchemasResponse = SearchSchemasResponse'
  { -- | An array of SearchSchemaSummary information.
    SearchSchemasResponse -> Maybe [SearchSchemaSummary]
schemas :: Prelude.Maybe [SearchSchemaSummary],
    -- | The token that specifies the next page of results to return. To request
    -- the first page, leave NextToken empty. The token will expire in 24
    -- hours, and cannot be shared with other accounts.
    SearchSchemasResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    SearchSchemasResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchSchemasResponse -> SearchSchemasResponse -> Bool
(SearchSchemasResponse -> SearchSchemasResponse -> Bool)
-> (SearchSchemasResponse -> SearchSchemasResponse -> Bool)
-> Eq SearchSchemasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchSchemasResponse -> SearchSchemasResponse -> Bool
$c/= :: SearchSchemasResponse -> SearchSchemasResponse -> Bool
== :: SearchSchemasResponse -> SearchSchemasResponse -> Bool
$c== :: SearchSchemasResponse -> SearchSchemasResponse -> Bool
Prelude.Eq, ReadPrec [SearchSchemasResponse]
ReadPrec SearchSchemasResponse
Int -> ReadS SearchSchemasResponse
ReadS [SearchSchemasResponse]
(Int -> ReadS SearchSchemasResponse)
-> ReadS [SearchSchemasResponse]
-> ReadPrec SearchSchemasResponse
-> ReadPrec [SearchSchemasResponse]
-> Read SearchSchemasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchSchemasResponse]
$creadListPrec :: ReadPrec [SearchSchemasResponse]
readPrec :: ReadPrec SearchSchemasResponse
$creadPrec :: ReadPrec SearchSchemasResponse
readList :: ReadS [SearchSchemasResponse]
$creadList :: ReadS [SearchSchemasResponse]
readsPrec :: Int -> ReadS SearchSchemasResponse
$creadsPrec :: Int -> ReadS SearchSchemasResponse
Prelude.Read, Int -> SearchSchemasResponse -> ShowS
[SearchSchemasResponse] -> ShowS
SearchSchemasResponse -> String
(Int -> SearchSchemasResponse -> ShowS)
-> (SearchSchemasResponse -> String)
-> ([SearchSchemasResponse] -> ShowS)
-> Show SearchSchemasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchSchemasResponse] -> ShowS
$cshowList :: [SearchSchemasResponse] -> ShowS
show :: SearchSchemasResponse -> String
$cshow :: SearchSchemasResponse -> String
showsPrec :: Int -> SearchSchemasResponse -> ShowS
$cshowsPrec :: Int -> SearchSchemasResponse -> ShowS
Prelude.Show, (forall x. SearchSchemasResponse -> Rep SearchSchemasResponse x)
-> (forall x. Rep SearchSchemasResponse x -> SearchSchemasResponse)
-> Generic SearchSchemasResponse
forall x. Rep SearchSchemasResponse x -> SearchSchemasResponse
forall x. SearchSchemasResponse -> Rep SearchSchemasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchSchemasResponse x -> SearchSchemasResponse
$cfrom :: forall x. SearchSchemasResponse -> Rep SearchSchemasResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchSchemasResponse' 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:
--
-- 'schemas', 'searchSchemasResponse_schemas' - An array of SearchSchemaSummary information.
--
-- 'nextToken', 'searchSchemasResponse_nextToken' - The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
--
-- 'httpStatus', 'searchSchemasResponse_httpStatus' - The response's http status code.
newSearchSchemasResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchSchemasResponse
newSearchSchemasResponse :: Int -> SearchSchemasResponse
newSearchSchemasResponse Int
pHttpStatus_ =
  SearchSchemasResponse' :: Maybe [SearchSchemaSummary]
-> Maybe Text -> Int -> SearchSchemasResponse
SearchSchemasResponse'
    { $sel:schemas:SearchSchemasResponse' :: Maybe [SearchSchemaSummary]
schemas = Maybe [SearchSchemaSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchSchemasResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchSchemasResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of SearchSchemaSummary information.
searchSchemasResponse_schemas :: Lens.Lens' SearchSchemasResponse (Prelude.Maybe [SearchSchemaSummary])
searchSchemasResponse_schemas :: (Maybe [SearchSchemaSummary] -> f (Maybe [SearchSchemaSummary]))
-> SearchSchemasResponse -> f SearchSchemasResponse
searchSchemasResponse_schemas = (SearchSchemasResponse -> Maybe [SearchSchemaSummary])
-> (SearchSchemasResponse
    -> Maybe [SearchSchemaSummary] -> SearchSchemasResponse)
-> Lens' SearchSchemasResponse (Maybe [SearchSchemaSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSchemasResponse' {Maybe [SearchSchemaSummary]
schemas :: Maybe [SearchSchemaSummary]
$sel:schemas:SearchSchemasResponse' :: SearchSchemasResponse -> Maybe [SearchSchemaSummary]
schemas} -> Maybe [SearchSchemaSummary]
schemas) (\s :: SearchSchemasResponse
s@SearchSchemasResponse' {} Maybe [SearchSchemaSummary]
a -> SearchSchemasResponse
s {$sel:schemas:SearchSchemasResponse' :: Maybe [SearchSchemaSummary]
schemas = Maybe [SearchSchemaSummary]
a} :: SearchSchemasResponse) ((Maybe [SearchSchemaSummary] -> f (Maybe [SearchSchemaSummary]))
 -> SearchSchemasResponse -> f SearchSchemasResponse)
-> ((Maybe [SearchSchemaSummary]
     -> f (Maybe [SearchSchemaSummary]))
    -> Maybe [SearchSchemaSummary] -> f (Maybe [SearchSchemaSummary]))
-> (Maybe [SearchSchemaSummary] -> f (Maybe [SearchSchemaSummary]))
-> SearchSchemasResponse
-> f SearchSchemasResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SearchSchemaSummary]
  [SearchSchemaSummary]
  [SearchSchemaSummary]
  [SearchSchemaSummary]
-> Iso
     (Maybe [SearchSchemaSummary])
     (Maybe [SearchSchemaSummary])
     (Maybe [SearchSchemaSummary])
     (Maybe [SearchSchemaSummary])
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
  [SearchSchemaSummary]
  [SearchSchemaSummary]
  [SearchSchemaSummary]
  [SearchSchemaSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token that specifies the next page of results to return. To request
-- the first page, leave NextToken empty. The token will expire in 24
-- hours, and cannot be shared with other accounts.
searchSchemasResponse_nextToken :: Lens.Lens' SearchSchemasResponse (Prelude.Maybe Prelude.Text)
searchSchemasResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchSchemasResponse -> f SearchSchemasResponse
searchSchemasResponse_nextToken = (SearchSchemasResponse -> Maybe Text)
-> (SearchSchemasResponse -> Maybe Text -> SearchSchemasResponse)
-> Lens' SearchSchemasResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSchemasResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchSchemasResponse' :: SearchSchemasResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchSchemasResponse
s@SearchSchemasResponse' {} Maybe Text
a -> SearchSchemasResponse
s {$sel:nextToken:SearchSchemasResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchSchemasResponse)

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

instance Prelude.NFData SearchSchemasResponse