{-# 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.RobOMaker.ListFleets
-- 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 list of fleets. You can optionally provide filters to retrieve
-- specific fleets.
--
-- This operation returns paginated results.
module Amazonka.RobOMaker.ListFleets
  ( -- * Creating a Request
    ListFleets (..),
    newListFleets,

    -- * Request Lenses
    listFleets_filters,
    listFleets_nextToken,
    listFleets_maxResults,

    -- * Destructuring the Response
    ListFleetsResponse (..),
    newListFleetsResponse,

    -- * Response Lenses
    listFleetsResponse_fleetDetails,
    listFleetsResponse_nextToken,
    listFleetsResponse_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.RobOMaker.Types

-- | /See:/ 'newListFleets' smart constructor.
data ListFleets = ListFleets'
  { -- | Optional filters to limit results.
    --
    -- The filter name @name@ is supported. When filtering, you must use the
    -- complete value of the filtered item. You can use up to three filters.
    ListFleets -> Maybe (NonEmpty Filter)
filters :: Prelude.Maybe (Prelude.NonEmpty Filter),
    -- | If the previous paginated request did not return all of the remaining
    -- results, the response object\'s @nextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call @ListFleets@ again and
    -- assign that token to the request object\'s @nextToken@ parameter. If
    -- there are no remaining results, the previous response object\'s
    -- NextToken parameter is set to null.
    --
    -- This token should be treated as an opaque identifier that is only used
    -- to retrieve the next items in a list and not for other programmatic
    -- purposes.
    ListFleets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When this parameter is used, @ListFleets@ only returns @maxResults@
    -- results in a single page along with a @nextToken@ response element. The
    -- remaining results of the initial request can be seen by sending another
    -- @ListFleets@ request with the returned @nextToken@ value. This value can
    -- be between 1 and 200. If this parameter is not used, then @ListFleets@
    -- returns up to 200 results and a @nextToken@ value if applicable.
    ListFleets -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListFleets -> ListFleets -> Bool
(ListFleets -> ListFleets -> Bool)
-> (ListFleets -> ListFleets -> Bool) -> Eq ListFleets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFleets -> ListFleets -> Bool
$c/= :: ListFleets -> ListFleets -> Bool
== :: ListFleets -> ListFleets -> Bool
$c== :: ListFleets -> ListFleets -> Bool
Prelude.Eq, ReadPrec [ListFleets]
ReadPrec ListFleets
Int -> ReadS ListFleets
ReadS [ListFleets]
(Int -> ReadS ListFleets)
-> ReadS [ListFleets]
-> ReadPrec ListFleets
-> ReadPrec [ListFleets]
-> Read ListFleets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFleets]
$creadListPrec :: ReadPrec [ListFleets]
readPrec :: ReadPrec ListFleets
$creadPrec :: ReadPrec ListFleets
readList :: ReadS [ListFleets]
$creadList :: ReadS [ListFleets]
readsPrec :: Int -> ReadS ListFleets
$creadsPrec :: Int -> ReadS ListFleets
Prelude.Read, Int -> ListFleets -> ShowS
[ListFleets] -> ShowS
ListFleets -> String
(Int -> ListFleets -> ShowS)
-> (ListFleets -> String)
-> ([ListFleets] -> ShowS)
-> Show ListFleets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFleets] -> ShowS
$cshowList :: [ListFleets] -> ShowS
show :: ListFleets -> String
$cshow :: ListFleets -> String
showsPrec :: Int -> ListFleets -> ShowS
$cshowsPrec :: Int -> ListFleets -> ShowS
Prelude.Show, (forall x. ListFleets -> Rep ListFleets x)
-> (forall x. Rep ListFleets x -> ListFleets) -> Generic ListFleets
forall x. Rep ListFleets x -> ListFleets
forall x. ListFleets -> Rep ListFleets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFleets x -> ListFleets
$cfrom :: forall x. ListFleets -> Rep ListFleets x
Prelude.Generic)

-- |
-- Create a value of 'ListFleets' 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:
--
-- 'filters', 'listFleets_filters' - Optional filters to limit results.
--
-- The filter name @name@ is supported. When filtering, you must use the
-- complete value of the filtered item. You can use up to three filters.
--
-- 'nextToken', 'listFleets_nextToken' - If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListFleets@ again and
-- assign that token to the request object\'s @nextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- NextToken parameter is set to null.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
--
-- 'maxResults', 'listFleets_maxResults' - When this parameter is used, @ListFleets@ only returns @maxResults@
-- results in a single page along with a @nextToken@ response element. The
-- remaining results of the initial request can be seen by sending another
-- @ListFleets@ request with the returned @nextToken@ value. This value can
-- be between 1 and 200. If this parameter is not used, then @ListFleets@
-- returns up to 200 results and a @nextToken@ value if applicable.
newListFleets ::
  ListFleets
newListFleets :: ListFleets
newListFleets =
  ListFleets' :: Maybe (NonEmpty Filter) -> Maybe Text -> Maybe Int -> ListFleets
ListFleets'
    { $sel:filters:ListFleets' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFleets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFleets' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filters to limit results.
--
-- The filter name @name@ is supported. When filtering, you must use the
-- complete value of the filtered item. You can use up to three filters.
listFleets_filters :: Lens.Lens' ListFleets (Prelude.Maybe (Prelude.NonEmpty Filter))
listFleets_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListFleets -> f ListFleets
listFleets_filters = (ListFleets -> Maybe (NonEmpty Filter))
-> (ListFleets -> Maybe (NonEmpty Filter) -> ListFleets)
-> Lens
     ListFleets
     ListFleets
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleets' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListFleets' :: ListFleets -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListFleets
s@ListFleets' {} Maybe (NonEmpty Filter)
a -> ListFleets
s {$sel:filters:ListFleets' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListFleets) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListFleets -> f ListFleets)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListFleets
-> f ListFleets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
-> Iso
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
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
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListFleets@ again and
-- assign that token to the request object\'s @nextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- NextToken parameter is set to null.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
listFleets_nextToken :: Lens.Lens' ListFleets (Prelude.Maybe Prelude.Text)
listFleets_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListFleets -> f ListFleets
listFleets_nextToken = (ListFleets -> Maybe Text)
-> (ListFleets -> Maybe Text -> ListFleets)
-> Lens ListFleets ListFleets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFleets' :: ListFleets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFleets
s@ListFleets' {} Maybe Text
a -> ListFleets
s {$sel:nextToken:ListFleets' :: Maybe Text
nextToken = Maybe Text
a} :: ListFleets)

-- | When this parameter is used, @ListFleets@ only returns @maxResults@
-- results in a single page along with a @nextToken@ response element. The
-- remaining results of the initial request can be seen by sending another
-- @ListFleets@ request with the returned @nextToken@ value. This value can
-- be between 1 and 200. If this parameter is not used, then @ListFleets@
-- returns up to 200 results and a @nextToken@ value if applicable.
listFleets_maxResults :: Lens.Lens' ListFleets (Prelude.Maybe Prelude.Int)
listFleets_maxResults :: (Maybe Int -> f (Maybe Int)) -> ListFleets -> f ListFleets
listFleets_maxResults = (ListFleets -> Maybe Int)
-> (ListFleets -> Maybe Int -> ListFleets)
-> Lens ListFleets ListFleets (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleets' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListFleets' :: ListFleets -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListFleets
s@ListFleets' {} Maybe Int
a -> ListFleets
s {$sel:maxResults:ListFleets' :: Maybe Int
maxResults = Maybe Int
a} :: ListFleets)

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

instance Prelude.NFData ListFleets

instance Core.ToHeaders ListFleets where
  toHeaders :: ListFleets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListFleets -> 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.ToJSON ListFleets where
  toJSON :: ListFleets -> Value
toJSON ListFleets' {Maybe Int
Maybe (NonEmpty Filter)
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
filters :: Maybe (NonEmpty Filter)
$sel:maxResults:ListFleets' :: ListFleets -> Maybe Int
$sel:nextToken:ListFleets' :: ListFleets -> Maybe Text
$sel:filters:ListFleets' :: ListFleets -> Maybe (NonEmpty Filter)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> NonEmpty Filter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Filter -> Pair) -> Maybe (NonEmpty Filter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Filter)
filters,
            (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 -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newListFleetsResponse' smart constructor.
data ListFleetsResponse = ListFleetsResponse'
  { -- | A list of fleet details meeting the request criteria.
    ListFleetsResponse -> Maybe [Fleet]
fleetDetails :: Prelude.Maybe [Fleet],
    -- | If the previous paginated request did not return all of the remaining
    -- results, the response object\'s @nextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call @ListFleets@ again and
    -- assign that token to the request object\'s @nextToken@ parameter. If
    -- there are no remaining results, the previous response object\'s
    -- NextToken parameter is set to null.
    ListFleetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFleetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFleetsResponse -> ListFleetsResponse -> Bool
(ListFleetsResponse -> ListFleetsResponse -> Bool)
-> (ListFleetsResponse -> ListFleetsResponse -> Bool)
-> Eq ListFleetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFleetsResponse -> ListFleetsResponse -> Bool
$c/= :: ListFleetsResponse -> ListFleetsResponse -> Bool
== :: ListFleetsResponse -> ListFleetsResponse -> Bool
$c== :: ListFleetsResponse -> ListFleetsResponse -> Bool
Prelude.Eq, ReadPrec [ListFleetsResponse]
ReadPrec ListFleetsResponse
Int -> ReadS ListFleetsResponse
ReadS [ListFleetsResponse]
(Int -> ReadS ListFleetsResponse)
-> ReadS [ListFleetsResponse]
-> ReadPrec ListFleetsResponse
-> ReadPrec [ListFleetsResponse]
-> Read ListFleetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFleetsResponse]
$creadListPrec :: ReadPrec [ListFleetsResponse]
readPrec :: ReadPrec ListFleetsResponse
$creadPrec :: ReadPrec ListFleetsResponse
readList :: ReadS [ListFleetsResponse]
$creadList :: ReadS [ListFleetsResponse]
readsPrec :: Int -> ReadS ListFleetsResponse
$creadsPrec :: Int -> ReadS ListFleetsResponse
Prelude.Read, Int -> ListFleetsResponse -> ShowS
[ListFleetsResponse] -> ShowS
ListFleetsResponse -> String
(Int -> ListFleetsResponse -> ShowS)
-> (ListFleetsResponse -> String)
-> ([ListFleetsResponse] -> ShowS)
-> Show ListFleetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFleetsResponse] -> ShowS
$cshowList :: [ListFleetsResponse] -> ShowS
show :: ListFleetsResponse -> String
$cshow :: ListFleetsResponse -> String
showsPrec :: Int -> ListFleetsResponse -> ShowS
$cshowsPrec :: Int -> ListFleetsResponse -> ShowS
Prelude.Show, (forall x. ListFleetsResponse -> Rep ListFleetsResponse x)
-> (forall x. Rep ListFleetsResponse x -> ListFleetsResponse)
-> Generic ListFleetsResponse
forall x. Rep ListFleetsResponse x -> ListFleetsResponse
forall x. ListFleetsResponse -> Rep ListFleetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFleetsResponse x -> ListFleetsResponse
$cfrom :: forall x. ListFleetsResponse -> Rep ListFleetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFleetsResponse' 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:
--
-- 'fleetDetails', 'listFleetsResponse_fleetDetails' - A list of fleet details meeting the request criteria.
--
-- 'nextToken', 'listFleetsResponse_nextToken' - If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListFleets@ again and
-- assign that token to the request object\'s @nextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- NextToken parameter is set to null.
--
-- 'httpStatus', 'listFleetsResponse_httpStatus' - The response's http status code.
newListFleetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFleetsResponse
newListFleetsResponse :: Int -> ListFleetsResponse
newListFleetsResponse Int
pHttpStatus_ =
  ListFleetsResponse' :: Maybe [Fleet] -> Maybe Text -> Int -> ListFleetsResponse
ListFleetsResponse'
    { $sel:fleetDetails:ListFleetsResponse' :: Maybe [Fleet]
fleetDetails = Maybe [Fleet]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFleetsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFleetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of fleet details meeting the request criteria.
listFleetsResponse_fleetDetails :: Lens.Lens' ListFleetsResponse (Prelude.Maybe [Fleet])
listFleetsResponse_fleetDetails :: (Maybe [Fleet] -> f (Maybe [Fleet]))
-> ListFleetsResponse -> f ListFleetsResponse
listFleetsResponse_fleetDetails = (ListFleetsResponse -> Maybe [Fleet])
-> (ListFleetsResponse -> Maybe [Fleet] -> ListFleetsResponse)
-> Lens' ListFleetsResponse (Maybe [Fleet])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleetsResponse' {Maybe [Fleet]
fleetDetails :: Maybe [Fleet]
$sel:fleetDetails:ListFleetsResponse' :: ListFleetsResponse -> Maybe [Fleet]
fleetDetails} -> Maybe [Fleet]
fleetDetails) (\s :: ListFleetsResponse
s@ListFleetsResponse' {} Maybe [Fleet]
a -> ListFleetsResponse
s {$sel:fleetDetails:ListFleetsResponse' :: Maybe [Fleet]
fleetDetails = Maybe [Fleet]
a} :: ListFleetsResponse) ((Maybe [Fleet] -> f (Maybe [Fleet]))
 -> ListFleetsResponse -> f ListFleetsResponse)
-> ((Maybe [Fleet] -> f (Maybe [Fleet]))
    -> Maybe [Fleet] -> f (Maybe [Fleet]))
-> (Maybe [Fleet] -> f (Maybe [Fleet]))
-> ListFleetsResponse
-> f ListFleetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Fleet] [Fleet] [Fleet] [Fleet]
-> Iso
     (Maybe [Fleet]) (Maybe [Fleet]) (Maybe [Fleet]) (Maybe [Fleet])
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 [Fleet] [Fleet] [Fleet] [Fleet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListFleets@ again and
-- assign that token to the request object\'s @nextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- NextToken parameter is set to null.
listFleetsResponse_nextToken :: Lens.Lens' ListFleetsResponse (Prelude.Maybe Prelude.Text)
listFleetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFleetsResponse -> f ListFleetsResponse
listFleetsResponse_nextToken = (ListFleetsResponse -> Maybe Text)
-> (ListFleetsResponse -> Maybe Text -> ListFleetsResponse)
-> Lens' ListFleetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFleetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFleetsResponse' :: ListFleetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFleetsResponse
s@ListFleetsResponse' {} Maybe Text
a -> ListFleetsResponse
s {$sel:nextToken:ListFleetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFleetsResponse)

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

instance Prelude.NFData ListFleetsResponse