{-# 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.LexV2Models.ListExports
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the exports for a bot, bot locale, or custom vocabulary. Exports
-- are kept in the list for 7 days.
module Amazonka.LexV2Models.ListExports
  ( -- * Creating a Request
    ListExports (..),
    newListExports,

    -- * Request Lenses
    listExports_botId,
    listExports_botVersion,
    listExports_filters,
    listExports_localeId,
    listExports_maxResults,
    listExports_nextToken,
    listExports_sortBy,

    -- * Destructuring the Response
    ListExportsResponse (..),
    newListExportsResponse,

    -- * Response Lenses
    listExportsResponse_botId,
    listExportsResponse_botVersion,
    listExportsResponse_exportSummaries,
    listExportsResponse_localeId,
    listExportsResponse_nextToken,
    listExportsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListExports' smart constructor.
data ListExports = ListExports'
  { -- | The unique identifier that Amazon Lex assigned to the bot.
    ListExports -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
    -- | The version of the bot to list exports for.
    ListExports -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | Provides the specification of a filter used to limit the exports in the
    -- response to only those that match the filter specification. You can only
    -- specify one filter and one string to filter on.
    ListExports -> Maybe (NonEmpty ExportFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty ExportFilter),
    -- | Specifies the resources that should be exported. If you don\'t specify a
    -- resource type in the @filters@ parameter, both bot locales and custom
    -- vocabularies are exported.
    ListExports -> Maybe Text
localeId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of exports to return in each page of results. If
    -- there are fewer results than the max page size, only the actual number
    -- of results are returned.
    ListExports -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the response from the @ListExports@ operation contains more results
    -- that specified in the @maxResults@ parameter, a token is returned in the
    -- response.
    --
    -- Use the returned token in the @nextToken@ parameter of a @ListExports@
    -- request to return the next page of results. For a complete set of
    -- results, call the @ListExports@ operation until the @nextToken@ returned
    -- in the response is null.
    ListExports -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Determines the field that the list of exports is sorted by. You can sort
    -- by the @LastUpdatedDateTime@ field in ascending or descending order.
    ListExports -> Maybe ExportSortBy
sortBy :: Prelude.Maybe ExportSortBy
  }
  deriving (ListExports -> ListExports -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListExports -> ListExports -> Bool
$c/= :: ListExports -> ListExports -> Bool
== :: ListExports -> ListExports -> Bool
$c== :: ListExports -> ListExports -> Bool
Prelude.Eq, ReadPrec [ListExports]
ReadPrec ListExports
Int -> ReadS ListExports
ReadS [ListExports]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListExports]
$creadListPrec :: ReadPrec [ListExports]
readPrec :: ReadPrec ListExports
$creadPrec :: ReadPrec ListExports
readList :: ReadS [ListExports]
$creadList :: ReadS [ListExports]
readsPrec :: Int -> ReadS ListExports
$creadsPrec :: Int -> ReadS ListExports
Prelude.Read, Int -> ListExports -> ShowS
[ListExports] -> ShowS
ListExports -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListExports] -> ShowS
$cshowList :: [ListExports] -> ShowS
show :: ListExports -> String
$cshow :: ListExports -> String
showsPrec :: Int -> ListExports -> ShowS
$cshowsPrec :: Int -> ListExports -> ShowS
Prelude.Show, forall x. Rep ListExports x -> ListExports
forall x. ListExports -> Rep ListExports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListExports x -> ListExports
$cfrom :: forall x. ListExports -> Rep ListExports x
Prelude.Generic)

-- |
-- Create a value of 'ListExports' 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:
--
-- 'botId', 'listExports_botId' - The unique identifier that Amazon Lex assigned to the bot.
--
-- 'botVersion', 'listExports_botVersion' - The version of the bot to list exports for.
--
-- 'filters', 'listExports_filters' - Provides the specification of a filter used to limit the exports in the
-- response to only those that match the filter specification. You can only
-- specify one filter and one string to filter on.
--
-- 'localeId', 'listExports_localeId' - Specifies the resources that should be exported. If you don\'t specify a
-- resource type in the @filters@ parameter, both bot locales and custom
-- vocabularies are exported.
--
-- 'maxResults', 'listExports_maxResults' - The maximum number of exports to return in each page of results. If
-- there are fewer results than the max page size, only the actual number
-- of results are returned.
--
-- 'nextToken', 'listExports_nextToken' - If the response from the @ListExports@ operation contains more results
-- that specified in the @maxResults@ parameter, a token is returned in the
-- response.
--
-- Use the returned token in the @nextToken@ parameter of a @ListExports@
-- request to return the next page of results. For a complete set of
-- results, call the @ListExports@ operation until the @nextToken@ returned
-- in the response is null.
--
-- 'sortBy', 'listExports_sortBy' - Determines the field that the list of exports is sorted by. You can sort
-- by the @LastUpdatedDateTime@ field in ascending or descending order.
newListExports ::
  ListExports
newListExports :: ListExports
newListExports =
  ListExports'
    { $sel:botId:ListExports' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:ListExports' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:ListExports' :: Maybe (NonEmpty ExportFilter)
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:localeId:ListExports' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListExports' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListExports' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListExports' :: Maybe ExportSortBy
sortBy = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier that Amazon Lex assigned to the bot.
listExports_botId :: Lens.Lens' ListExports (Prelude.Maybe Prelude.Text)
listExports_botId :: Lens' ListExports (Maybe Text)
listExports_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExports' {Maybe Text
botId :: Maybe Text
$sel:botId:ListExports' :: ListExports -> Maybe Text
botId} -> Maybe Text
botId) (\s :: ListExports
s@ListExports' {} Maybe Text
a -> ListExports
s {$sel:botId:ListExports' :: Maybe Text
botId = Maybe Text
a} :: ListExports)

-- | The version of the bot to list exports for.
listExports_botVersion :: Lens.Lens' ListExports (Prelude.Maybe Prelude.Text)
listExports_botVersion :: Lens' ListExports (Maybe Text)
listExports_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExports' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:ListExports' :: ListExports -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: ListExports
s@ListExports' {} Maybe Text
a -> ListExports
s {$sel:botVersion:ListExports' :: Maybe Text
botVersion = Maybe Text
a} :: ListExports)

-- | Provides the specification of a filter used to limit the exports in the
-- response to only those that match the filter specification. You can only
-- specify one filter and one string to filter on.
listExports_filters :: Lens.Lens' ListExports (Prelude.Maybe (Prelude.NonEmpty ExportFilter))
listExports_filters :: Lens' ListExports (Maybe (NonEmpty ExportFilter))
listExports_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExports' {Maybe (NonEmpty ExportFilter)
filters :: Maybe (NonEmpty ExportFilter)
$sel:filters:ListExports' :: ListExports -> Maybe (NonEmpty ExportFilter)
filters} -> Maybe (NonEmpty ExportFilter)
filters) (\s :: ListExports
s@ListExports' {} Maybe (NonEmpty ExportFilter)
a -> ListExports
s {$sel:filters:ListExports' :: Maybe (NonEmpty ExportFilter)
filters = Maybe (NonEmpty ExportFilter)
a} :: ListExports) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the resources that should be exported. If you don\'t specify a
-- resource type in the @filters@ parameter, both bot locales and custom
-- vocabularies are exported.
listExports_localeId :: Lens.Lens' ListExports (Prelude.Maybe Prelude.Text)
listExports_localeId :: Lens' ListExports (Maybe Text)
listExports_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExports' {Maybe Text
localeId :: Maybe Text
$sel:localeId:ListExports' :: ListExports -> Maybe Text
localeId} -> Maybe Text
localeId) (\s :: ListExports
s@ListExports' {} Maybe Text
a -> ListExports
s {$sel:localeId:ListExports' :: Maybe Text
localeId = Maybe Text
a} :: ListExports)

-- | The maximum number of exports to return in each page of results. If
-- there are fewer results than the max page size, only the actual number
-- of results are returned.
listExports_maxResults :: Lens.Lens' ListExports (Prelude.Maybe Prelude.Natural)
listExports_maxResults :: Lens' ListExports (Maybe Natural)
listExports_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExports' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListExports' :: ListExports -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListExports
s@ListExports' {} Maybe Natural
a -> ListExports
s {$sel:maxResults:ListExports' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListExports)

-- | If the response from the @ListExports@ operation contains more results
-- that specified in the @maxResults@ parameter, a token is returned in the
-- response.
--
-- Use the returned token in the @nextToken@ parameter of a @ListExports@
-- request to return the next page of results. For a complete set of
-- results, call the @ListExports@ operation until the @nextToken@ returned
-- in the response is null.
listExports_nextToken :: Lens.Lens' ListExports (Prelude.Maybe Prelude.Text)
listExports_nextToken :: Lens' ListExports (Maybe Text)
listExports_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExports' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListExports' :: ListExports -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListExports
s@ListExports' {} Maybe Text
a -> ListExports
s {$sel:nextToken:ListExports' :: Maybe Text
nextToken = Maybe Text
a} :: ListExports)

-- | Determines the field that the list of exports is sorted by. You can sort
-- by the @LastUpdatedDateTime@ field in ascending or descending order.
listExports_sortBy :: Lens.Lens' ListExports (Prelude.Maybe ExportSortBy)
listExports_sortBy :: Lens' ListExports (Maybe ExportSortBy)
listExports_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExports' {Maybe ExportSortBy
sortBy :: Maybe ExportSortBy
$sel:sortBy:ListExports' :: ListExports -> Maybe ExportSortBy
sortBy} -> Maybe ExportSortBy
sortBy) (\s :: ListExports
s@ListExports' {} Maybe ExportSortBy
a -> ListExports
s {$sel:sortBy:ListExports' :: Maybe ExportSortBy
sortBy = Maybe ExportSortBy
a} :: ListExports)

instance Core.AWSRequest ListExports where
  type AWSResponse ListExports = ListExportsResponse
  request :: (Service -> Service) -> ListExports -> Request ListExports
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListExports
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListExports)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [ExportSummary]
-> Maybe Text
-> Maybe Text
-> Int
-> ListExportsResponse
ListExportsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"exportSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"localeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListExports where
  hashWithSalt :: Int -> ListExports -> Int
hashWithSalt Int
_salt ListExports' {Maybe Natural
Maybe (NonEmpty ExportFilter)
Maybe Text
Maybe ExportSortBy
sortBy :: Maybe ExportSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
localeId :: Maybe Text
filters :: Maybe (NonEmpty ExportFilter)
botVersion :: Maybe Text
botId :: Maybe Text
$sel:sortBy:ListExports' :: ListExports -> Maybe ExportSortBy
$sel:nextToken:ListExports' :: ListExports -> Maybe Text
$sel:maxResults:ListExports' :: ListExports -> Maybe Natural
$sel:localeId:ListExports' :: ListExports -> Maybe Text
$sel:filters:ListExports' :: ListExports -> Maybe (NonEmpty ExportFilter)
$sel:botVersion:ListExports' :: ListExports -> Maybe Text
$sel:botId:ListExports' :: ListExports -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ExportFilter)
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
localeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExportSortBy
sortBy

instance Prelude.NFData ListExports where
  rnf :: ListExports -> ()
rnf ListExports' {Maybe Natural
Maybe (NonEmpty ExportFilter)
Maybe Text
Maybe ExportSortBy
sortBy :: Maybe ExportSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
localeId :: Maybe Text
filters :: Maybe (NonEmpty ExportFilter)
botVersion :: Maybe Text
botId :: Maybe Text
$sel:sortBy:ListExports' :: ListExports -> Maybe ExportSortBy
$sel:nextToken:ListExports' :: ListExports -> Maybe Text
$sel:maxResults:ListExports' :: ListExports -> Maybe Natural
$sel:localeId:ListExports' :: ListExports -> Maybe Text
$sel:filters:ListExports' :: ListExports -> Maybe (NonEmpty ExportFilter)
$sel:botVersion:ListExports' :: ListExports -> Maybe Text
$sel:botId:ListExports' :: ListExports -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ExportFilter)
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExportSortBy
sortBy

instance Data.ToHeaders ListExports where
  toHeaders :: ListExports -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListExports where
  toJSON :: ListExports -> Value
toJSON ListExports' {Maybe Natural
Maybe (NonEmpty ExportFilter)
Maybe Text
Maybe ExportSortBy
sortBy :: Maybe ExportSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
localeId :: Maybe Text
filters :: Maybe (NonEmpty ExportFilter)
botVersion :: Maybe Text
botId :: Maybe Text
$sel:sortBy:ListExports' :: ListExports -> Maybe ExportSortBy
$sel:nextToken:ListExports' :: ListExports -> Maybe Text
$sel:maxResults:ListExports' :: ListExports -> Maybe Natural
$sel:localeId:ListExports' :: ListExports -> Maybe Text
$sel:filters:ListExports' :: ListExports -> Maybe (NonEmpty ExportFilter)
$sel:botVersion:ListExports' :: ListExports -> Maybe Text
$sel:botId:ListExports' :: ListExports -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"botId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
botId,
            (Key
"botVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
botVersion,
            (Key
"filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ExportFilter)
filters,
            (Key
"localeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
localeId,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"sortBy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ExportSortBy
sortBy
          ]
      )

instance Data.ToPath ListExports where
  toPath :: ListExports -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/exports/"

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

-- | /See:/ 'newListExportsResponse' smart constructor.
data ListExportsResponse = ListExportsResponse'
  { -- | The unique identifier assigned to the bot by Amazon Lex.
    ListExportsResponse -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
    -- | The version of the bot that was exported.
    ListExportsResponse -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | Summary information for the exports that meet the filter criteria
    -- specified in the request. The length of the list is specified in the
    -- @maxResults@ parameter. If there are more exports available, the
    -- @nextToken@ field contains a token to get the next page of results.
    ListExportsResponse -> Maybe [ExportSummary]
exportSummaries :: Prelude.Maybe [ExportSummary],
    -- | The locale specified in the request.
    ListExportsResponse -> Maybe Text
localeId :: Prelude.Maybe Prelude.Text,
    -- | A token that indicates whether there are more results to return in a
    -- response to the @ListExports@ operation. If the @nextToken@ field is
    -- present, you send the contents as the @nextToken@ parameter of a
    -- @ListExports@ operation request to get the next page of results.
    ListExportsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListExportsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListExportsResponse -> ListExportsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListExportsResponse -> ListExportsResponse -> Bool
$c/= :: ListExportsResponse -> ListExportsResponse -> Bool
== :: ListExportsResponse -> ListExportsResponse -> Bool
$c== :: ListExportsResponse -> ListExportsResponse -> Bool
Prelude.Eq, ReadPrec [ListExportsResponse]
ReadPrec ListExportsResponse
Int -> ReadS ListExportsResponse
ReadS [ListExportsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListExportsResponse]
$creadListPrec :: ReadPrec [ListExportsResponse]
readPrec :: ReadPrec ListExportsResponse
$creadPrec :: ReadPrec ListExportsResponse
readList :: ReadS [ListExportsResponse]
$creadList :: ReadS [ListExportsResponse]
readsPrec :: Int -> ReadS ListExportsResponse
$creadsPrec :: Int -> ReadS ListExportsResponse
Prelude.Read, Int -> ListExportsResponse -> ShowS
[ListExportsResponse] -> ShowS
ListExportsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListExportsResponse] -> ShowS
$cshowList :: [ListExportsResponse] -> ShowS
show :: ListExportsResponse -> String
$cshow :: ListExportsResponse -> String
showsPrec :: Int -> ListExportsResponse -> ShowS
$cshowsPrec :: Int -> ListExportsResponse -> ShowS
Prelude.Show, forall x. Rep ListExportsResponse x -> ListExportsResponse
forall x. ListExportsResponse -> Rep ListExportsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListExportsResponse x -> ListExportsResponse
$cfrom :: forall x. ListExportsResponse -> Rep ListExportsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListExportsResponse' 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:
--
-- 'botId', 'listExportsResponse_botId' - The unique identifier assigned to the bot by Amazon Lex.
--
-- 'botVersion', 'listExportsResponse_botVersion' - The version of the bot that was exported.
--
-- 'exportSummaries', 'listExportsResponse_exportSummaries' - Summary information for the exports that meet the filter criteria
-- specified in the request. The length of the list is specified in the
-- @maxResults@ parameter. If there are more exports available, the
-- @nextToken@ field contains a token to get the next page of results.
--
-- 'localeId', 'listExportsResponse_localeId' - The locale specified in the request.
--
-- 'nextToken', 'listExportsResponse_nextToken' - A token that indicates whether there are more results to return in a
-- response to the @ListExports@ operation. If the @nextToken@ field is
-- present, you send the contents as the @nextToken@ parameter of a
-- @ListExports@ operation request to get the next page of results.
--
-- 'httpStatus', 'listExportsResponse_httpStatus' - The response's http status code.
newListExportsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListExportsResponse
newListExportsResponse :: Int -> ListExportsResponse
newListExportsResponse Int
pHttpStatus_ =
  ListExportsResponse'
    { $sel:botId:ListExportsResponse' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:ListExportsResponse' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:exportSummaries:ListExportsResponse' :: Maybe [ExportSummary]
exportSummaries = forall a. Maybe a
Prelude.Nothing,
      $sel:localeId:ListExportsResponse' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListExportsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListExportsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier assigned to the bot by Amazon Lex.
listExportsResponse_botId :: Lens.Lens' ListExportsResponse (Prelude.Maybe Prelude.Text)
listExportsResponse_botId :: Lens' ListExportsResponse (Maybe Text)
listExportsResponse_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExportsResponse' {Maybe Text
botId :: Maybe Text
$sel:botId:ListExportsResponse' :: ListExportsResponse -> Maybe Text
botId} -> Maybe Text
botId) (\s :: ListExportsResponse
s@ListExportsResponse' {} Maybe Text
a -> ListExportsResponse
s {$sel:botId:ListExportsResponse' :: Maybe Text
botId = Maybe Text
a} :: ListExportsResponse)

-- | The version of the bot that was exported.
listExportsResponse_botVersion :: Lens.Lens' ListExportsResponse (Prelude.Maybe Prelude.Text)
listExportsResponse_botVersion :: Lens' ListExportsResponse (Maybe Text)
listExportsResponse_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExportsResponse' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:ListExportsResponse' :: ListExportsResponse -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: ListExportsResponse
s@ListExportsResponse' {} Maybe Text
a -> ListExportsResponse
s {$sel:botVersion:ListExportsResponse' :: Maybe Text
botVersion = Maybe Text
a} :: ListExportsResponse)

-- | Summary information for the exports that meet the filter criteria
-- specified in the request. The length of the list is specified in the
-- @maxResults@ parameter. If there are more exports available, the
-- @nextToken@ field contains a token to get the next page of results.
listExportsResponse_exportSummaries :: Lens.Lens' ListExportsResponse (Prelude.Maybe [ExportSummary])
listExportsResponse_exportSummaries :: Lens' ListExportsResponse (Maybe [ExportSummary])
listExportsResponse_exportSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExportsResponse' {Maybe [ExportSummary]
exportSummaries :: Maybe [ExportSummary]
$sel:exportSummaries:ListExportsResponse' :: ListExportsResponse -> Maybe [ExportSummary]
exportSummaries} -> Maybe [ExportSummary]
exportSummaries) (\s :: ListExportsResponse
s@ListExportsResponse' {} Maybe [ExportSummary]
a -> ListExportsResponse
s {$sel:exportSummaries:ListExportsResponse' :: Maybe [ExportSummary]
exportSummaries = Maybe [ExportSummary]
a} :: ListExportsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The locale specified in the request.
listExportsResponse_localeId :: Lens.Lens' ListExportsResponse (Prelude.Maybe Prelude.Text)
listExportsResponse_localeId :: Lens' ListExportsResponse (Maybe Text)
listExportsResponse_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExportsResponse' {Maybe Text
localeId :: Maybe Text
$sel:localeId:ListExportsResponse' :: ListExportsResponse -> Maybe Text
localeId} -> Maybe Text
localeId) (\s :: ListExportsResponse
s@ListExportsResponse' {} Maybe Text
a -> ListExportsResponse
s {$sel:localeId:ListExportsResponse' :: Maybe Text
localeId = Maybe Text
a} :: ListExportsResponse)

-- | A token that indicates whether there are more results to return in a
-- response to the @ListExports@ operation. If the @nextToken@ field is
-- present, you send the contents as the @nextToken@ parameter of a
-- @ListExports@ operation request to get the next page of results.
listExportsResponse_nextToken :: Lens.Lens' ListExportsResponse (Prelude.Maybe Prelude.Text)
listExportsResponse_nextToken :: Lens' ListExportsResponse (Maybe Text)
listExportsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListExportsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListExportsResponse' :: ListExportsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListExportsResponse
s@ListExportsResponse' {} Maybe Text
a -> ListExportsResponse
s {$sel:nextToken:ListExportsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListExportsResponse)

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

instance Prelude.NFData ListExportsResponse where
  rnf :: ListExportsResponse -> ()
rnf ListExportsResponse' {Int
Maybe [ExportSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
localeId :: Maybe Text
exportSummaries :: Maybe [ExportSummary]
botVersion :: Maybe Text
botId :: Maybe Text
$sel:httpStatus:ListExportsResponse' :: ListExportsResponse -> Int
$sel:nextToken:ListExportsResponse' :: ListExportsResponse -> Maybe Text
$sel:localeId:ListExportsResponse' :: ListExportsResponse -> Maybe Text
$sel:exportSummaries:ListExportsResponse' :: ListExportsResponse -> Maybe [ExportSummary]
$sel:botVersion:ListExportsResponse' :: ListExportsResponse -> Maybe Text
$sel:botId:ListExportsResponse' :: ListExportsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ExportSummary]
exportSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus