{-# 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.Proton.ListServiceInstances
-- 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)
--
-- List service instances with summaries of detail data.
--
-- This operation returns paginated results.
module Amazonka.Proton.ListServiceInstances
  ( -- * Creating a Request
    ListServiceInstances (..),
    newListServiceInstances,

    -- * Request Lenses
    listServiceInstances_nextToken,
    listServiceInstances_serviceName,
    listServiceInstances_maxResults,

    -- * Destructuring the Response
    ListServiceInstancesResponse (..),
    newListServiceInstancesResponse,

    -- * Response Lenses
    listServiceInstancesResponse_nextToken,
    listServiceInstancesResponse_httpStatus,
    listServiceInstancesResponse_serviceInstances,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListServiceInstances' smart constructor.
data ListServiceInstances = ListServiceInstances'
  { -- | A token to indicate the location of the next service in the array of
    -- service instances, after the list of service instances that was
    -- previously requested.
    ListServiceInstances -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the service that the service instance belongs to.
    ListServiceInstances -> Maybe Text
serviceName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of service instances to list.
    ListServiceInstances -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListServiceInstances -> ListServiceInstances -> Bool
(ListServiceInstances -> ListServiceInstances -> Bool)
-> (ListServiceInstances -> ListServiceInstances -> Bool)
-> Eq ListServiceInstances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServiceInstances -> ListServiceInstances -> Bool
$c/= :: ListServiceInstances -> ListServiceInstances -> Bool
== :: ListServiceInstances -> ListServiceInstances -> Bool
$c== :: ListServiceInstances -> ListServiceInstances -> Bool
Prelude.Eq, ReadPrec [ListServiceInstances]
ReadPrec ListServiceInstances
Int -> ReadS ListServiceInstances
ReadS [ListServiceInstances]
(Int -> ReadS ListServiceInstances)
-> ReadS [ListServiceInstances]
-> ReadPrec ListServiceInstances
-> ReadPrec [ListServiceInstances]
-> Read ListServiceInstances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServiceInstances]
$creadListPrec :: ReadPrec [ListServiceInstances]
readPrec :: ReadPrec ListServiceInstances
$creadPrec :: ReadPrec ListServiceInstances
readList :: ReadS [ListServiceInstances]
$creadList :: ReadS [ListServiceInstances]
readsPrec :: Int -> ReadS ListServiceInstances
$creadsPrec :: Int -> ReadS ListServiceInstances
Prelude.Read, Int -> ListServiceInstances -> ShowS
[ListServiceInstances] -> ShowS
ListServiceInstances -> String
(Int -> ListServiceInstances -> ShowS)
-> (ListServiceInstances -> String)
-> ([ListServiceInstances] -> ShowS)
-> Show ListServiceInstances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServiceInstances] -> ShowS
$cshowList :: [ListServiceInstances] -> ShowS
show :: ListServiceInstances -> String
$cshow :: ListServiceInstances -> String
showsPrec :: Int -> ListServiceInstances -> ShowS
$cshowsPrec :: Int -> ListServiceInstances -> ShowS
Prelude.Show, (forall x. ListServiceInstances -> Rep ListServiceInstances x)
-> (forall x. Rep ListServiceInstances x -> ListServiceInstances)
-> Generic ListServiceInstances
forall x. Rep ListServiceInstances x -> ListServiceInstances
forall x. ListServiceInstances -> Rep ListServiceInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListServiceInstances x -> ListServiceInstances
$cfrom :: forall x. ListServiceInstances -> Rep ListServiceInstances x
Prelude.Generic)

-- |
-- Create a value of 'ListServiceInstances' 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', 'listServiceInstances_nextToken' - A token to indicate the location of the next service in the array of
-- service instances, after the list of service instances that was
-- previously requested.
--
-- 'serviceName', 'listServiceInstances_serviceName' - The name of the service that the service instance belongs to.
--
-- 'maxResults', 'listServiceInstances_maxResults' - The maximum number of service instances to list.
newListServiceInstances ::
  ListServiceInstances
newListServiceInstances :: ListServiceInstances
newListServiceInstances =
  ListServiceInstances' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListServiceInstances
ListServiceInstances'
    { $sel:nextToken:ListServiceInstances' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceName:ListServiceInstances' :: Maybe Text
serviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListServiceInstances' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token to indicate the location of the next service in the array of
-- service instances, after the list of service instances that was
-- previously requested.
listServiceInstances_nextToken :: Lens.Lens' ListServiceInstances (Prelude.Maybe Prelude.Text)
listServiceInstances_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListServiceInstances -> f ListServiceInstances
listServiceInstances_nextToken = (ListServiceInstances -> Maybe Text)
-> (ListServiceInstances -> Maybe Text -> ListServiceInstances)
-> Lens
     ListServiceInstances ListServiceInstances (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceInstances' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListServiceInstances' :: ListServiceInstances -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListServiceInstances
s@ListServiceInstances' {} Maybe Text
a -> ListServiceInstances
s {$sel:nextToken:ListServiceInstances' :: Maybe Text
nextToken = Maybe Text
a} :: ListServiceInstances)

-- | The name of the service that the service instance belongs to.
listServiceInstances_serviceName :: Lens.Lens' ListServiceInstances (Prelude.Maybe Prelude.Text)
listServiceInstances_serviceName :: (Maybe Text -> f (Maybe Text))
-> ListServiceInstances -> f ListServiceInstances
listServiceInstances_serviceName = (ListServiceInstances -> Maybe Text)
-> (ListServiceInstances -> Maybe Text -> ListServiceInstances)
-> Lens
     ListServiceInstances ListServiceInstances (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceInstances' {Maybe Text
serviceName :: Maybe Text
$sel:serviceName:ListServiceInstances' :: ListServiceInstances -> Maybe Text
serviceName} -> Maybe Text
serviceName) (\s :: ListServiceInstances
s@ListServiceInstances' {} Maybe Text
a -> ListServiceInstances
s {$sel:serviceName:ListServiceInstances' :: Maybe Text
serviceName = Maybe Text
a} :: ListServiceInstances)

-- | The maximum number of service instances to list.
listServiceInstances_maxResults :: Lens.Lens' ListServiceInstances (Prelude.Maybe Prelude.Natural)
listServiceInstances_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListServiceInstances -> f ListServiceInstances
listServiceInstances_maxResults = (ListServiceInstances -> Maybe Natural)
-> (ListServiceInstances -> Maybe Natural -> ListServiceInstances)
-> Lens
     ListServiceInstances
     ListServiceInstances
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceInstances' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListServiceInstances' :: ListServiceInstances -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListServiceInstances
s@ListServiceInstances' {} Maybe Natural
a -> ListServiceInstances
s {$sel:maxResults:ListServiceInstances' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListServiceInstances)

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

instance Prelude.Hashable ListServiceInstances

instance Prelude.NFData ListServiceInstances

instance Core.ToHeaders ListServiceInstances where
  toHeaders :: ListServiceInstances -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListServiceInstances -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AwsProton20200720.ListServiceInstances" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListServiceInstances where
  toJSON :: ListServiceInstances -> Value
toJSON ListServiceInstances' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
serviceName :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListServiceInstances' :: ListServiceInstances -> Maybe Natural
$sel:serviceName:ListServiceInstances' :: ListServiceInstances -> Maybe Text
$sel:nextToken:ListServiceInstances' :: ListServiceInstances -> 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
"serviceName" 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
serviceName,
            (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
          ]
      )

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

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

-- | /See:/ 'newListServiceInstancesResponse' smart constructor.
data ListServiceInstancesResponse = ListServiceInstancesResponse'
  { -- | A token to indicate the location of the next service instance in the
    -- array of service instances, after the current requested list of service
    -- instances.
    ListServiceInstancesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListServiceInstancesResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of service instances with summaries of detail data.
    ListServiceInstancesResponse -> [ServiceInstanceSummary]
serviceInstances :: [ServiceInstanceSummary]
  }
  deriving (ListServiceInstancesResponse
-> ListServiceInstancesResponse -> Bool
(ListServiceInstancesResponse
 -> ListServiceInstancesResponse -> Bool)
-> (ListServiceInstancesResponse
    -> ListServiceInstancesResponse -> Bool)
-> Eq ListServiceInstancesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServiceInstancesResponse
-> ListServiceInstancesResponse -> Bool
$c/= :: ListServiceInstancesResponse
-> ListServiceInstancesResponse -> Bool
== :: ListServiceInstancesResponse
-> ListServiceInstancesResponse -> Bool
$c== :: ListServiceInstancesResponse
-> ListServiceInstancesResponse -> Bool
Prelude.Eq, Int -> ListServiceInstancesResponse -> ShowS
[ListServiceInstancesResponse] -> ShowS
ListServiceInstancesResponse -> String
(Int -> ListServiceInstancesResponse -> ShowS)
-> (ListServiceInstancesResponse -> String)
-> ([ListServiceInstancesResponse] -> ShowS)
-> Show ListServiceInstancesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServiceInstancesResponse] -> ShowS
$cshowList :: [ListServiceInstancesResponse] -> ShowS
show :: ListServiceInstancesResponse -> String
$cshow :: ListServiceInstancesResponse -> String
showsPrec :: Int -> ListServiceInstancesResponse -> ShowS
$cshowsPrec :: Int -> ListServiceInstancesResponse -> ShowS
Prelude.Show, (forall x.
 ListServiceInstancesResponse -> Rep ListServiceInstancesResponse x)
-> (forall x.
    Rep ListServiceInstancesResponse x -> ListServiceInstancesResponse)
-> Generic ListServiceInstancesResponse
forall x.
Rep ListServiceInstancesResponse x -> ListServiceInstancesResponse
forall x.
ListServiceInstancesResponse -> Rep ListServiceInstancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListServiceInstancesResponse x -> ListServiceInstancesResponse
$cfrom :: forall x.
ListServiceInstancesResponse -> Rep ListServiceInstancesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListServiceInstancesResponse' 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', 'listServiceInstancesResponse_nextToken' - A token to indicate the location of the next service instance in the
-- array of service instances, after the current requested list of service
-- instances.
--
-- 'httpStatus', 'listServiceInstancesResponse_httpStatus' - The response's http status code.
--
-- 'serviceInstances', 'listServiceInstancesResponse_serviceInstances' - An array of service instances with summaries of detail data.
newListServiceInstancesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListServiceInstancesResponse
newListServiceInstancesResponse :: Int -> ListServiceInstancesResponse
newListServiceInstancesResponse Int
pHttpStatus_ =
  ListServiceInstancesResponse' :: Maybe Text
-> Int -> [ServiceInstanceSummary] -> ListServiceInstancesResponse
ListServiceInstancesResponse'
    { $sel:nextToken:ListServiceInstancesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListServiceInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:serviceInstances:ListServiceInstancesResponse' :: [ServiceInstanceSummary]
serviceInstances = [ServiceInstanceSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token to indicate the location of the next service instance in the
-- array of service instances, after the current requested list of service
-- instances.
listServiceInstancesResponse_nextToken :: Lens.Lens' ListServiceInstancesResponse (Prelude.Maybe Prelude.Text)
listServiceInstancesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListServiceInstancesResponse -> f ListServiceInstancesResponse
listServiceInstancesResponse_nextToken = (ListServiceInstancesResponse -> Maybe Text)
-> (ListServiceInstancesResponse
    -> Maybe Text -> ListServiceInstancesResponse)
-> Lens' ListServiceInstancesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceInstancesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListServiceInstancesResponse' :: ListServiceInstancesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListServiceInstancesResponse
s@ListServiceInstancesResponse' {} Maybe Text
a -> ListServiceInstancesResponse
s {$sel:nextToken:ListServiceInstancesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListServiceInstancesResponse)

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

-- | An array of service instances with summaries of detail data.
listServiceInstancesResponse_serviceInstances :: Lens.Lens' ListServiceInstancesResponse [ServiceInstanceSummary]
listServiceInstancesResponse_serviceInstances :: ([ServiceInstanceSummary] -> f [ServiceInstanceSummary])
-> ListServiceInstancesResponse -> f ListServiceInstancesResponse
listServiceInstancesResponse_serviceInstances = (ListServiceInstancesResponse -> [ServiceInstanceSummary])
-> (ListServiceInstancesResponse
    -> [ServiceInstanceSummary] -> ListServiceInstancesResponse)
-> Lens' ListServiceInstancesResponse [ServiceInstanceSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceInstancesResponse' {[ServiceInstanceSummary]
serviceInstances :: [ServiceInstanceSummary]
$sel:serviceInstances:ListServiceInstancesResponse' :: ListServiceInstancesResponse -> [ServiceInstanceSummary]
serviceInstances} -> [ServiceInstanceSummary]
serviceInstances) (\s :: ListServiceInstancesResponse
s@ListServiceInstancesResponse' {} [ServiceInstanceSummary]
a -> ListServiceInstancesResponse
s {$sel:serviceInstances:ListServiceInstancesResponse' :: [ServiceInstanceSummary]
serviceInstances = [ServiceInstanceSummary]
a} :: ListServiceInstancesResponse) (([ServiceInstanceSummary] -> f [ServiceInstanceSummary])
 -> ListServiceInstancesResponse -> f ListServiceInstancesResponse)
-> (([ServiceInstanceSummary] -> f [ServiceInstanceSummary])
    -> [ServiceInstanceSummary] -> f [ServiceInstanceSummary])
-> ([ServiceInstanceSummary] -> f [ServiceInstanceSummary])
-> ListServiceInstancesResponse
-> f ListServiceInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ServiceInstanceSummary] -> f [ServiceInstanceSummary])
-> [ServiceInstanceSummary] -> f [ServiceInstanceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListServiceInstancesResponse