{-# 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.SageMaker.ListEndpointConfigs
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists endpoint configurations.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListEndpointConfigs
  ( -- * Creating a Request
    ListEndpointConfigs (..),
    newListEndpointConfigs,

    -- * Request Lenses
    listEndpointConfigs_nameContains,
    listEndpointConfigs_creationTimeAfter,
    listEndpointConfigs_nextToken,
    listEndpointConfigs_sortOrder,
    listEndpointConfigs_creationTimeBefore,
    listEndpointConfigs_maxResults,
    listEndpointConfigs_sortBy,

    -- * Destructuring the Response
    ListEndpointConfigsResponse (..),
    newListEndpointConfigsResponse,

    -- * Response Lenses
    listEndpointConfigsResponse_nextToken,
    listEndpointConfigsResponse_httpStatus,
    listEndpointConfigsResponse_endpointConfigs,
  )
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.SageMaker.Types

-- | /See:/ 'newListEndpointConfigs' smart constructor.
data ListEndpointConfigs = ListEndpointConfigs'
  { -- | A string in the endpoint configuration name. This filter returns only
    -- endpoint configurations whose name contains the specified string.
    ListEndpointConfigs -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | A filter that returns only endpoint configurations with a creation time
    -- greater than or equal to the specified time (timestamp).
    ListEndpointConfigs -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Core.POSIX,
    -- | If the result of the previous @ListEndpointConfig@ request was
    -- truncated, the response includes a @NextToken@. To retrieve the next set
    -- of endpoint configurations, use the token in the next request.
    ListEndpointConfigs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sort order for results. The default is @Descending@.
    ListEndpointConfigs -> Maybe OrderKey
sortOrder :: Prelude.Maybe OrderKey,
    -- | A filter that returns only endpoint configurations created before the
    -- specified time (timestamp).
    ListEndpointConfigs -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Core.POSIX,
    -- | The maximum number of training jobs to return in the response.
    ListEndpointConfigs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The field to sort results by. The default is @CreationTime@.
    ListEndpointConfigs -> Maybe EndpointConfigSortKey
sortBy :: Prelude.Maybe EndpointConfigSortKey
  }
  deriving (ListEndpointConfigs -> ListEndpointConfigs -> Bool
(ListEndpointConfigs -> ListEndpointConfigs -> Bool)
-> (ListEndpointConfigs -> ListEndpointConfigs -> Bool)
-> Eq ListEndpointConfigs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEndpointConfigs -> ListEndpointConfigs -> Bool
$c/= :: ListEndpointConfigs -> ListEndpointConfigs -> Bool
== :: ListEndpointConfigs -> ListEndpointConfigs -> Bool
$c== :: ListEndpointConfigs -> ListEndpointConfigs -> Bool
Prelude.Eq, ReadPrec [ListEndpointConfigs]
ReadPrec ListEndpointConfigs
Int -> ReadS ListEndpointConfigs
ReadS [ListEndpointConfigs]
(Int -> ReadS ListEndpointConfigs)
-> ReadS [ListEndpointConfigs]
-> ReadPrec ListEndpointConfigs
-> ReadPrec [ListEndpointConfigs]
-> Read ListEndpointConfigs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEndpointConfigs]
$creadListPrec :: ReadPrec [ListEndpointConfigs]
readPrec :: ReadPrec ListEndpointConfigs
$creadPrec :: ReadPrec ListEndpointConfigs
readList :: ReadS [ListEndpointConfigs]
$creadList :: ReadS [ListEndpointConfigs]
readsPrec :: Int -> ReadS ListEndpointConfigs
$creadsPrec :: Int -> ReadS ListEndpointConfigs
Prelude.Read, Int -> ListEndpointConfigs -> ShowS
[ListEndpointConfigs] -> ShowS
ListEndpointConfigs -> String
(Int -> ListEndpointConfigs -> ShowS)
-> (ListEndpointConfigs -> String)
-> ([ListEndpointConfigs] -> ShowS)
-> Show ListEndpointConfigs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEndpointConfigs] -> ShowS
$cshowList :: [ListEndpointConfigs] -> ShowS
show :: ListEndpointConfigs -> String
$cshow :: ListEndpointConfigs -> String
showsPrec :: Int -> ListEndpointConfigs -> ShowS
$cshowsPrec :: Int -> ListEndpointConfigs -> ShowS
Prelude.Show, (forall x. ListEndpointConfigs -> Rep ListEndpointConfigs x)
-> (forall x. Rep ListEndpointConfigs x -> ListEndpointConfigs)
-> Generic ListEndpointConfigs
forall x. Rep ListEndpointConfigs x -> ListEndpointConfigs
forall x. ListEndpointConfigs -> Rep ListEndpointConfigs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEndpointConfigs x -> ListEndpointConfigs
$cfrom :: forall x. ListEndpointConfigs -> Rep ListEndpointConfigs x
Prelude.Generic)

-- |
-- Create a value of 'ListEndpointConfigs' 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:
--
-- 'nameContains', 'listEndpointConfigs_nameContains' - A string in the endpoint configuration name. This filter returns only
-- endpoint configurations whose name contains the specified string.
--
-- 'creationTimeAfter', 'listEndpointConfigs_creationTimeAfter' - A filter that returns only endpoint configurations with a creation time
-- greater than or equal to the specified time (timestamp).
--
-- 'nextToken', 'listEndpointConfigs_nextToken' - If the result of the previous @ListEndpointConfig@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of endpoint configurations, use the token in the next request.
--
-- 'sortOrder', 'listEndpointConfigs_sortOrder' - The sort order for results. The default is @Descending@.
--
-- 'creationTimeBefore', 'listEndpointConfigs_creationTimeBefore' - A filter that returns only endpoint configurations created before the
-- specified time (timestamp).
--
-- 'maxResults', 'listEndpointConfigs_maxResults' - The maximum number of training jobs to return in the response.
--
-- 'sortBy', 'listEndpointConfigs_sortBy' - The field to sort results by. The default is @CreationTime@.
newListEndpointConfigs ::
  ListEndpointConfigs
newListEndpointConfigs :: ListEndpointConfigs
newListEndpointConfigs =
  ListEndpointConfigs' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe OrderKey
-> Maybe POSIX
-> Maybe Natural
-> Maybe EndpointConfigSortKey
-> ListEndpointConfigs
ListEndpointConfigs'
    { $sel:nameContains:ListEndpointConfigs' :: Maybe Text
nameContains =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeAfter:ListEndpointConfigs' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListEndpointConfigs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListEndpointConfigs' :: Maybe OrderKey
sortOrder = Maybe OrderKey
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeBefore:ListEndpointConfigs' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListEndpointConfigs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListEndpointConfigs' :: Maybe EndpointConfigSortKey
sortBy = Maybe EndpointConfigSortKey
forall a. Maybe a
Prelude.Nothing
    }

-- | A string in the endpoint configuration name. This filter returns only
-- endpoint configurations whose name contains the specified string.
listEndpointConfigs_nameContains :: Lens.Lens' ListEndpointConfigs (Prelude.Maybe Prelude.Text)
listEndpointConfigs_nameContains :: (Maybe Text -> f (Maybe Text))
-> ListEndpointConfigs -> f ListEndpointConfigs
listEndpointConfigs_nameContains = (ListEndpointConfigs -> Maybe Text)
-> (ListEndpointConfigs -> Maybe Text -> ListEndpointConfigs)
-> Lens
     ListEndpointConfigs ListEndpointConfigs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigs' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListEndpointConfigs
s@ListEndpointConfigs' {} Maybe Text
a -> ListEndpointConfigs
s {$sel:nameContains:ListEndpointConfigs' :: Maybe Text
nameContains = Maybe Text
a} :: ListEndpointConfigs)

-- | A filter that returns only endpoint configurations with a creation time
-- greater than or equal to the specified time (timestamp).
listEndpointConfigs_creationTimeAfter :: Lens.Lens' ListEndpointConfigs (Prelude.Maybe Prelude.UTCTime)
listEndpointConfigs_creationTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListEndpointConfigs -> f ListEndpointConfigs
listEndpointConfigs_creationTimeAfter = (ListEndpointConfigs -> Maybe POSIX)
-> (ListEndpointConfigs -> Maybe POSIX -> ListEndpointConfigs)
-> Lens
     ListEndpointConfigs ListEndpointConfigs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigs' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListEndpointConfigs
s@ListEndpointConfigs' {} Maybe POSIX
a -> ListEndpointConfigs
s {$sel:creationTimeAfter:ListEndpointConfigs' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListEndpointConfigs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListEndpointConfigs -> f ListEndpointConfigs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListEndpointConfigs
-> f ListEndpointConfigs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | If the result of the previous @ListEndpointConfig@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of endpoint configurations, use the token in the next request.
listEndpointConfigs_nextToken :: Lens.Lens' ListEndpointConfigs (Prelude.Maybe Prelude.Text)
listEndpointConfigs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEndpointConfigs -> f ListEndpointConfigs
listEndpointConfigs_nextToken = (ListEndpointConfigs -> Maybe Text)
-> (ListEndpointConfigs -> Maybe Text -> ListEndpointConfigs)
-> Lens
     ListEndpointConfigs ListEndpointConfigs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEndpointConfigs
s@ListEndpointConfigs' {} Maybe Text
a -> ListEndpointConfigs
s {$sel:nextToken:ListEndpointConfigs' :: Maybe Text
nextToken = Maybe Text
a} :: ListEndpointConfigs)

-- | The sort order for results. The default is @Descending@.
listEndpointConfigs_sortOrder :: Lens.Lens' ListEndpointConfigs (Prelude.Maybe OrderKey)
listEndpointConfigs_sortOrder :: (Maybe OrderKey -> f (Maybe OrderKey))
-> ListEndpointConfigs -> f ListEndpointConfigs
listEndpointConfigs_sortOrder = (ListEndpointConfigs -> Maybe OrderKey)
-> (ListEndpointConfigs -> Maybe OrderKey -> ListEndpointConfigs)
-> Lens
     ListEndpointConfigs
     ListEndpointConfigs
     (Maybe OrderKey)
     (Maybe OrderKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigs' {Maybe OrderKey
sortOrder :: Maybe OrderKey
$sel:sortOrder:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe OrderKey
sortOrder} -> Maybe OrderKey
sortOrder) (\s :: ListEndpointConfigs
s@ListEndpointConfigs' {} Maybe OrderKey
a -> ListEndpointConfigs
s {$sel:sortOrder:ListEndpointConfigs' :: Maybe OrderKey
sortOrder = Maybe OrderKey
a} :: ListEndpointConfigs)

-- | A filter that returns only endpoint configurations created before the
-- specified time (timestamp).
listEndpointConfigs_creationTimeBefore :: Lens.Lens' ListEndpointConfigs (Prelude.Maybe Prelude.UTCTime)
listEndpointConfigs_creationTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListEndpointConfigs -> f ListEndpointConfigs
listEndpointConfigs_creationTimeBefore = (ListEndpointConfigs -> Maybe POSIX)
-> (ListEndpointConfigs -> Maybe POSIX -> ListEndpointConfigs)
-> Lens
     ListEndpointConfigs ListEndpointConfigs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigs' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListEndpointConfigs
s@ListEndpointConfigs' {} Maybe POSIX
a -> ListEndpointConfigs
s {$sel:creationTimeBefore:ListEndpointConfigs' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListEndpointConfigs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListEndpointConfigs -> f ListEndpointConfigs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListEndpointConfigs
-> f ListEndpointConfigs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The maximum number of training jobs to return in the response.
listEndpointConfigs_maxResults :: Lens.Lens' ListEndpointConfigs (Prelude.Maybe Prelude.Natural)
listEndpointConfigs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListEndpointConfigs -> f ListEndpointConfigs
listEndpointConfigs_maxResults = (ListEndpointConfigs -> Maybe Natural)
-> (ListEndpointConfigs -> Maybe Natural -> ListEndpointConfigs)
-> Lens
     ListEndpointConfigs
     ListEndpointConfigs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListEndpointConfigs
s@ListEndpointConfigs' {} Maybe Natural
a -> ListEndpointConfigs
s {$sel:maxResults:ListEndpointConfigs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListEndpointConfigs)

-- | The field to sort results by. The default is @CreationTime@.
listEndpointConfigs_sortBy :: Lens.Lens' ListEndpointConfigs (Prelude.Maybe EndpointConfigSortKey)
listEndpointConfigs_sortBy :: (Maybe EndpointConfigSortKey -> f (Maybe EndpointConfigSortKey))
-> ListEndpointConfigs -> f ListEndpointConfigs
listEndpointConfigs_sortBy = (ListEndpointConfigs -> Maybe EndpointConfigSortKey)
-> (ListEndpointConfigs
    -> Maybe EndpointConfigSortKey -> ListEndpointConfigs)
-> Lens
     ListEndpointConfigs
     ListEndpointConfigs
     (Maybe EndpointConfigSortKey)
     (Maybe EndpointConfigSortKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigs' {Maybe EndpointConfigSortKey
sortBy :: Maybe EndpointConfigSortKey
$sel:sortBy:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe EndpointConfigSortKey
sortBy} -> Maybe EndpointConfigSortKey
sortBy) (\s :: ListEndpointConfigs
s@ListEndpointConfigs' {} Maybe EndpointConfigSortKey
a -> ListEndpointConfigs
s {$sel:sortBy:ListEndpointConfigs' :: Maybe EndpointConfigSortKey
sortBy = Maybe EndpointConfigSortKey
a} :: ListEndpointConfigs)

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

instance Prelude.Hashable ListEndpointConfigs

instance Prelude.NFData ListEndpointConfigs

instance Core.ToHeaders ListEndpointConfigs where
  toHeaders :: ListEndpointConfigs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListEndpointConfigs -> 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
"SageMaker.ListEndpointConfigs" ::
                          Prelude.ByteString
                      ),
            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 ListEndpointConfigs where
  toJSON :: ListEndpointConfigs -> Value
toJSON ListEndpointConfigs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe EndpointConfigSortKey
Maybe OrderKey
sortBy :: Maybe EndpointConfigSortKey
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
sortOrder :: Maybe OrderKey
nextToken :: Maybe Text
creationTimeAfter :: Maybe POSIX
nameContains :: Maybe Text
$sel:sortBy:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe EndpointConfigSortKey
$sel:maxResults:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe Natural
$sel:creationTimeBefore:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe POSIX
$sel:sortOrder:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe OrderKey
$sel:nextToken:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe Text
$sel:creationTimeAfter:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe POSIX
$sel:nameContains:ListEndpointConfigs' :: ListEndpointConfigs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NameContains" 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
nameContains,
            (Text
"CreationTimeAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeAfter,
            (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
"SortOrder" Text -> OrderKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OrderKey -> Pair) -> Maybe OrderKey -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OrderKey
sortOrder,
            (Text
"CreationTimeBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeBefore,
            (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,
            (Text
"SortBy" Text -> EndpointConfigSortKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EndpointConfigSortKey -> Pair)
-> Maybe EndpointConfigSortKey -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EndpointConfigSortKey
sortBy
          ]
      )

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

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

-- | /See:/ 'newListEndpointConfigsResponse' smart constructor.
data ListEndpointConfigsResponse = ListEndpointConfigsResponse'
  { -- | If the response is truncated, Amazon SageMaker returns this token. To
    -- retrieve the next set of endpoint configurations, use it in the
    -- subsequent request
    ListEndpointConfigsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListEndpointConfigsResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of endpoint configurations.
    ListEndpointConfigsResponse -> [EndpointConfigSummary]
endpointConfigs :: [EndpointConfigSummary]
  }
  deriving (ListEndpointConfigsResponse -> ListEndpointConfigsResponse -> Bool
(ListEndpointConfigsResponse
 -> ListEndpointConfigsResponse -> Bool)
-> (ListEndpointConfigsResponse
    -> ListEndpointConfigsResponse -> Bool)
-> Eq ListEndpointConfigsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEndpointConfigsResponse -> ListEndpointConfigsResponse -> Bool
$c/= :: ListEndpointConfigsResponse -> ListEndpointConfigsResponse -> Bool
== :: ListEndpointConfigsResponse -> ListEndpointConfigsResponse -> Bool
$c== :: ListEndpointConfigsResponse -> ListEndpointConfigsResponse -> Bool
Prelude.Eq, ReadPrec [ListEndpointConfigsResponse]
ReadPrec ListEndpointConfigsResponse
Int -> ReadS ListEndpointConfigsResponse
ReadS [ListEndpointConfigsResponse]
(Int -> ReadS ListEndpointConfigsResponse)
-> ReadS [ListEndpointConfigsResponse]
-> ReadPrec ListEndpointConfigsResponse
-> ReadPrec [ListEndpointConfigsResponse]
-> Read ListEndpointConfigsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEndpointConfigsResponse]
$creadListPrec :: ReadPrec [ListEndpointConfigsResponse]
readPrec :: ReadPrec ListEndpointConfigsResponse
$creadPrec :: ReadPrec ListEndpointConfigsResponse
readList :: ReadS [ListEndpointConfigsResponse]
$creadList :: ReadS [ListEndpointConfigsResponse]
readsPrec :: Int -> ReadS ListEndpointConfigsResponse
$creadsPrec :: Int -> ReadS ListEndpointConfigsResponse
Prelude.Read, Int -> ListEndpointConfigsResponse -> ShowS
[ListEndpointConfigsResponse] -> ShowS
ListEndpointConfigsResponse -> String
(Int -> ListEndpointConfigsResponse -> ShowS)
-> (ListEndpointConfigsResponse -> String)
-> ([ListEndpointConfigsResponse] -> ShowS)
-> Show ListEndpointConfigsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEndpointConfigsResponse] -> ShowS
$cshowList :: [ListEndpointConfigsResponse] -> ShowS
show :: ListEndpointConfigsResponse -> String
$cshow :: ListEndpointConfigsResponse -> String
showsPrec :: Int -> ListEndpointConfigsResponse -> ShowS
$cshowsPrec :: Int -> ListEndpointConfigsResponse -> ShowS
Prelude.Show, (forall x.
 ListEndpointConfigsResponse -> Rep ListEndpointConfigsResponse x)
-> (forall x.
    Rep ListEndpointConfigsResponse x -> ListEndpointConfigsResponse)
-> Generic ListEndpointConfigsResponse
forall x.
Rep ListEndpointConfigsResponse x -> ListEndpointConfigsResponse
forall x.
ListEndpointConfigsResponse -> Rep ListEndpointConfigsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEndpointConfigsResponse x -> ListEndpointConfigsResponse
$cfrom :: forall x.
ListEndpointConfigsResponse -> Rep ListEndpointConfigsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListEndpointConfigsResponse' 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', 'listEndpointConfigsResponse_nextToken' - If the response is truncated, Amazon SageMaker returns this token. To
-- retrieve the next set of endpoint configurations, use it in the
-- subsequent request
--
-- 'httpStatus', 'listEndpointConfigsResponse_httpStatus' - The response's http status code.
--
-- 'endpointConfigs', 'listEndpointConfigsResponse_endpointConfigs' - An array of endpoint configurations.
newListEndpointConfigsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEndpointConfigsResponse
newListEndpointConfigsResponse :: Int -> ListEndpointConfigsResponse
newListEndpointConfigsResponse Int
pHttpStatus_ =
  ListEndpointConfigsResponse' :: Maybe Text
-> Int -> [EndpointConfigSummary] -> ListEndpointConfigsResponse
ListEndpointConfigsResponse'
    { $sel:nextToken:ListEndpointConfigsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEndpointConfigsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:endpointConfigs:ListEndpointConfigsResponse' :: [EndpointConfigSummary]
endpointConfigs = [EndpointConfigSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | If the response is truncated, Amazon SageMaker returns this token. To
-- retrieve the next set of endpoint configurations, use it in the
-- subsequent request
listEndpointConfigsResponse_nextToken :: Lens.Lens' ListEndpointConfigsResponse (Prelude.Maybe Prelude.Text)
listEndpointConfigsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEndpointConfigsResponse -> f ListEndpointConfigsResponse
listEndpointConfigsResponse_nextToken = (ListEndpointConfigsResponse -> Maybe Text)
-> (ListEndpointConfigsResponse
    -> Maybe Text -> ListEndpointConfigsResponse)
-> Lens' ListEndpointConfigsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEndpointConfigsResponse' :: ListEndpointConfigsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEndpointConfigsResponse
s@ListEndpointConfigsResponse' {} Maybe Text
a -> ListEndpointConfigsResponse
s {$sel:nextToken:ListEndpointConfigsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEndpointConfigsResponse)

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

-- | An array of endpoint configurations.
listEndpointConfigsResponse_endpointConfigs :: Lens.Lens' ListEndpointConfigsResponse [EndpointConfigSummary]
listEndpointConfigsResponse_endpointConfigs :: ([EndpointConfigSummary] -> f [EndpointConfigSummary])
-> ListEndpointConfigsResponse -> f ListEndpointConfigsResponse
listEndpointConfigsResponse_endpointConfigs = (ListEndpointConfigsResponse -> [EndpointConfigSummary])
-> (ListEndpointConfigsResponse
    -> [EndpointConfigSummary] -> ListEndpointConfigsResponse)
-> Lens' ListEndpointConfigsResponse [EndpointConfigSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointConfigsResponse' {[EndpointConfigSummary]
endpointConfigs :: [EndpointConfigSummary]
$sel:endpointConfigs:ListEndpointConfigsResponse' :: ListEndpointConfigsResponse -> [EndpointConfigSummary]
endpointConfigs} -> [EndpointConfigSummary]
endpointConfigs) (\s :: ListEndpointConfigsResponse
s@ListEndpointConfigsResponse' {} [EndpointConfigSummary]
a -> ListEndpointConfigsResponse
s {$sel:endpointConfigs:ListEndpointConfigsResponse' :: [EndpointConfigSummary]
endpointConfigs = [EndpointConfigSummary]
a} :: ListEndpointConfigsResponse) (([EndpointConfigSummary] -> f [EndpointConfigSummary])
 -> ListEndpointConfigsResponse -> f ListEndpointConfigsResponse)
-> (([EndpointConfigSummary] -> f [EndpointConfigSummary])
    -> [EndpointConfigSummary] -> f [EndpointConfigSummary])
-> ([EndpointConfigSummary] -> f [EndpointConfigSummary])
-> ListEndpointConfigsResponse
-> f ListEndpointConfigsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([EndpointConfigSummary] -> f [EndpointConfigSummary])
-> [EndpointConfigSummary] -> f [EndpointConfigSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListEndpointConfigsResponse