{-# 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.Kafka.ListClusterOperations
-- 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 all the operations that have been performed on the
-- specified MSK cluster.
--
-- This operation returns paginated results.
module Amazonka.Kafka.ListClusterOperations
  ( -- * Creating a Request
    ListClusterOperations (..),
    newListClusterOperations,

    -- * Request Lenses
    listClusterOperations_nextToken,
    listClusterOperations_maxResults,
    listClusterOperations_clusterArn,

    -- * Destructuring the Response
    ListClusterOperationsResponse (..),
    newListClusterOperationsResponse,

    -- * Response Lenses
    listClusterOperationsResponse_clusterOperationInfoList,
    listClusterOperationsResponse_nextToken,
    listClusterOperationsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListClusterOperations' smart constructor.
data ListClusterOperations = ListClusterOperations'
  { -- | The paginated results marker. When the result of the operation is
    -- truncated, the call returns NextToken in the response. To get the next
    -- batch, provide this token in your next request.
    ListClusterOperations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the response. If there are
    -- more results, the response includes a NextToken parameter.
    ListClusterOperations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) that uniquely identifies the cluster.
    ListClusterOperations -> Text
clusterArn :: Prelude.Text
  }
  deriving (ListClusterOperations -> ListClusterOperations -> Bool
(ListClusterOperations -> ListClusterOperations -> Bool)
-> (ListClusterOperations -> ListClusterOperations -> Bool)
-> Eq ListClusterOperations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClusterOperations -> ListClusterOperations -> Bool
$c/= :: ListClusterOperations -> ListClusterOperations -> Bool
== :: ListClusterOperations -> ListClusterOperations -> Bool
$c== :: ListClusterOperations -> ListClusterOperations -> Bool
Prelude.Eq, ReadPrec [ListClusterOperations]
ReadPrec ListClusterOperations
Int -> ReadS ListClusterOperations
ReadS [ListClusterOperations]
(Int -> ReadS ListClusterOperations)
-> ReadS [ListClusterOperations]
-> ReadPrec ListClusterOperations
-> ReadPrec [ListClusterOperations]
-> Read ListClusterOperations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClusterOperations]
$creadListPrec :: ReadPrec [ListClusterOperations]
readPrec :: ReadPrec ListClusterOperations
$creadPrec :: ReadPrec ListClusterOperations
readList :: ReadS [ListClusterOperations]
$creadList :: ReadS [ListClusterOperations]
readsPrec :: Int -> ReadS ListClusterOperations
$creadsPrec :: Int -> ReadS ListClusterOperations
Prelude.Read, Int -> ListClusterOperations -> ShowS
[ListClusterOperations] -> ShowS
ListClusterOperations -> String
(Int -> ListClusterOperations -> ShowS)
-> (ListClusterOperations -> String)
-> ([ListClusterOperations] -> ShowS)
-> Show ListClusterOperations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClusterOperations] -> ShowS
$cshowList :: [ListClusterOperations] -> ShowS
show :: ListClusterOperations -> String
$cshow :: ListClusterOperations -> String
showsPrec :: Int -> ListClusterOperations -> ShowS
$cshowsPrec :: Int -> ListClusterOperations -> ShowS
Prelude.Show, (forall x. ListClusterOperations -> Rep ListClusterOperations x)
-> (forall x. Rep ListClusterOperations x -> ListClusterOperations)
-> Generic ListClusterOperations
forall x. Rep ListClusterOperations x -> ListClusterOperations
forall x. ListClusterOperations -> Rep ListClusterOperations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListClusterOperations x -> ListClusterOperations
$cfrom :: forall x. ListClusterOperations -> Rep ListClusterOperations x
Prelude.Generic)

-- |
-- Create a value of 'ListClusterOperations' 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', 'listClusterOperations_nextToken' - The paginated results marker. When the result of the operation is
-- truncated, the call returns NextToken in the response. To get the next
-- batch, provide this token in your next request.
--
-- 'maxResults', 'listClusterOperations_maxResults' - The maximum number of results to return in the response. If there are
-- more results, the response includes a NextToken parameter.
--
-- 'clusterArn', 'listClusterOperations_clusterArn' - The Amazon Resource Name (ARN) that uniquely identifies the cluster.
newListClusterOperations ::
  -- | 'clusterArn'
  Prelude.Text ->
  ListClusterOperations
newListClusterOperations :: Text -> ListClusterOperations
newListClusterOperations Text
pClusterArn_ =
  ListClusterOperations' :: Maybe Text -> Maybe Natural -> Text -> ListClusterOperations
ListClusterOperations'
    { $sel:nextToken:ListClusterOperations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListClusterOperations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterArn:ListClusterOperations' :: Text
clusterArn = Text
pClusterArn_
    }

-- | The paginated results marker. When the result of the operation is
-- truncated, the call returns NextToken in the response. To get the next
-- batch, provide this token in your next request.
listClusterOperations_nextToken :: Lens.Lens' ListClusterOperations (Prelude.Maybe Prelude.Text)
listClusterOperations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListClusterOperations -> f ListClusterOperations
listClusterOperations_nextToken = (ListClusterOperations -> Maybe Text)
-> (ListClusterOperations -> Maybe Text -> ListClusterOperations)
-> Lens
     ListClusterOperations
     ListClusterOperations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterOperations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClusterOperations' :: ListClusterOperations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClusterOperations
s@ListClusterOperations' {} Maybe Text
a -> ListClusterOperations
s {$sel:nextToken:ListClusterOperations' :: Maybe Text
nextToken = Maybe Text
a} :: ListClusterOperations)

-- | The maximum number of results to return in the response. If there are
-- more results, the response includes a NextToken parameter.
listClusterOperations_maxResults :: Lens.Lens' ListClusterOperations (Prelude.Maybe Prelude.Natural)
listClusterOperations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListClusterOperations -> f ListClusterOperations
listClusterOperations_maxResults = (ListClusterOperations -> Maybe Natural)
-> (ListClusterOperations
    -> Maybe Natural -> ListClusterOperations)
-> Lens
     ListClusterOperations
     ListClusterOperations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterOperations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListClusterOperations' :: ListClusterOperations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListClusterOperations
s@ListClusterOperations' {} Maybe Natural
a -> ListClusterOperations
s {$sel:maxResults:ListClusterOperations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListClusterOperations)

-- | The Amazon Resource Name (ARN) that uniquely identifies the cluster.
listClusterOperations_clusterArn :: Lens.Lens' ListClusterOperations Prelude.Text
listClusterOperations_clusterArn :: (Text -> f Text)
-> ListClusterOperations -> f ListClusterOperations
listClusterOperations_clusterArn = (ListClusterOperations -> Text)
-> (ListClusterOperations -> Text -> ListClusterOperations)
-> Lens ListClusterOperations ListClusterOperations Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterOperations' {Text
clusterArn :: Text
$sel:clusterArn:ListClusterOperations' :: ListClusterOperations -> Text
clusterArn} -> Text
clusterArn) (\s :: ListClusterOperations
s@ListClusterOperations' {} Text
a -> ListClusterOperations
s {$sel:clusterArn:ListClusterOperations' :: Text
clusterArn = Text
a} :: ListClusterOperations)

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

instance Prelude.NFData ListClusterOperations

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

instance Core.ToPath ListClusterOperations where
  toPath :: ListClusterOperations -> ByteString
toPath ListClusterOperations' {Maybe Natural
Maybe Text
Text
clusterArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:clusterArn:ListClusterOperations' :: ListClusterOperations -> Text
$sel:maxResults:ListClusterOperations' :: ListClusterOperations -> Maybe Natural
$sel:nextToken:ListClusterOperations' :: ListClusterOperations -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/clusters/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
clusterArn,
        ByteString
"/operations"
      ]

instance Core.ToQuery ListClusterOperations where
  toQuery :: ListClusterOperations -> QueryString
toQuery ListClusterOperations' {Maybe Natural
Maybe Text
Text
clusterArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:clusterArn:ListClusterOperations' :: ListClusterOperations -> Text
$sel:maxResults:ListClusterOperations' :: ListClusterOperations -> Maybe Natural
$sel:nextToken:ListClusterOperations' :: ListClusterOperations -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListClusterOperationsResponse' smart constructor.
data ListClusterOperationsResponse = ListClusterOperationsResponse'
  { -- | An array of cluster operation information objects.
    ListClusterOperationsResponse -> Maybe [ClusterOperationInfo]
clusterOperationInfoList :: Prelude.Maybe [ClusterOperationInfo],
    -- | If the response of ListClusterOperations is truncated, it returns a
    -- NextToken in the response. This Nexttoken should be sent in the
    -- subsequent request to ListClusterOperations.
    ListClusterOperationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListClusterOperationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListClusterOperationsResponse
-> ListClusterOperationsResponse -> Bool
(ListClusterOperationsResponse
 -> ListClusterOperationsResponse -> Bool)
-> (ListClusterOperationsResponse
    -> ListClusterOperationsResponse -> Bool)
-> Eq ListClusterOperationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClusterOperationsResponse
-> ListClusterOperationsResponse -> Bool
$c/= :: ListClusterOperationsResponse
-> ListClusterOperationsResponse -> Bool
== :: ListClusterOperationsResponse
-> ListClusterOperationsResponse -> Bool
$c== :: ListClusterOperationsResponse
-> ListClusterOperationsResponse -> Bool
Prelude.Eq, ReadPrec [ListClusterOperationsResponse]
ReadPrec ListClusterOperationsResponse
Int -> ReadS ListClusterOperationsResponse
ReadS [ListClusterOperationsResponse]
(Int -> ReadS ListClusterOperationsResponse)
-> ReadS [ListClusterOperationsResponse]
-> ReadPrec ListClusterOperationsResponse
-> ReadPrec [ListClusterOperationsResponse]
-> Read ListClusterOperationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClusterOperationsResponse]
$creadListPrec :: ReadPrec [ListClusterOperationsResponse]
readPrec :: ReadPrec ListClusterOperationsResponse
$creadPrec :: ReadPrec ListClusterOperationsResponse
readList :: ReadS [ListClusterOperationsResponse]
$creadList :: ReadS [ListClusterOperationsResponse]
readsPrec :: Int -> ReadS ListClusterOperationsResponse
$creadsPrec :: Int -> ReadS ListClusterOperationsResponse
Prelude.Read, Int -> ListClusterOperationsResponse -> ShowS
[ListClusterOperationsResponse] -> ShowS
ListClusterOperationsResponse -> String
(Int -> ListClusterOperationsResponse -> ShowS)
-> (ListClusterOperationsResponse -> String)
-> ([ListClusterOperationsResponse] -> ShowS)
-> Show ListClusterOperationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClusterOperationsResponse] -> ShowS
$cshowList :: [ListClusterOperationsResponse] -> ShowS
show :: ListClusterOperationsResponse -> String
$cshow :: ListClusterOperationsResponse -> String
showsPrec :: Int -> ListClusterOperationsResponse -> ShowS
$cshowsPrec :: Int -> ListClusterOperationsResponse -> ShowS
Prelude.Show, (forall x.
 ListClusterOperationsResponse
 -> Rep ListClusterOperationsResponse x)
-> (forall x.
    Rep ListClusterOperationsResponse x
    -> ListClusterOperationsResponse)
-> Generic ListClusterOperationsResponse
forall x.
Rep ListClusterOperationsResponse x
-> ListClusterOperationsResponse
forall x.
ListClusterOperationsResponse
-> Rep ListClusterOperationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListClusterOperationsResponse x
-> ListClusterOperationsResponse
$cfrom :: forall x.
ListClusterOperationsResponse
-> Rep ListClusterOperationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListClusterOperationsResponse' 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:
--
-- 'clusterOperationInfoList', 'listClusterOperationsResponse_clusterOperationInfoList' - An array of cluster operation information objects.
--
-- 'nextToken', 'listClusterOperationsResponse_nextToken' - If the response of ListClusterOperations is truncated, it returns a
-- NextToken in the response. This Nexttoken should be sent in the
-- subsequent request to ListClusterOperations.
--
-- 'httpStatus', 'listClusterOperationsResponse_httpStatus' - The response's http status code.
newListClusterOperationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListClusterOperationsResponse
newListClusterOperationsResponse :: Int -> ListClusterOperationsResponse
newListClusterOperationsResponse Int
pHttpStatus_ =
  ListClusterOperationsResponse' :: Maybe [ClusterOperationInfo]
-> Maybe Text -> Int -> ListClusterOperationsResponse
ListClusterOperationsResponse'
    { $sel:clusterOperationInfoList:ListClusterOperationsResponse' :: Maybe [ClusterOperationInfo]
clusterOperationInfoList =
        Maybe [ClusterOperationInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListClusterOperationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListClusterOperationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of cluster operation information objects.
listClusterOperationsResponse_clusterOperationInfoList :: Lens.Lens' ListClusterOperationsResponse (Prelude.Maybe [ClusterOperationInfo])
listClusterOperationsResponse_clusterOperationInfoList :: (Maybe [ClusterOperationInfo] -> f (Maybe [ClusterOperationInfo]))
-> ListClusterOperationsResponse -> f ListClusterOperationsResponse
listClusterOperationsResponse_clusterOperationInfoList = (ListClusterOperationsResponse -> Maybe [ClusterOperationInfo])
-> (ListClusterOperationsResponse
    -> Maybe [ClusterOperationInfo] -> ListClusterOperationsResponse)
-> Lens'
     ListClusterOperationsResponse (Maybe [ClusterOperationInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterOperationsResponse' {Maybe [ClusterOperationInfo]
clusterOperationInfoList :: Maybe [ClusterOperationInfo]
$sel:clusterOperationInfoList:ListClusterOperationsResponse' :: ListClusterOperationsResponse -> Maybe [ClusterOperationInfo]
clusterOperationInfoList} -> Maybe [ClusterOperationInfo]
clusterOperationInfoList) (\s :: ListClusterOperationsResponse
s@ListClusterOperationsResponse' {} Maybe [ClusterOperationInfo]
a -> ListClusterOperationsResponse
s {$sel:clusterOperationInfoList:ListClusterOperationsResponse' :: Maybe [ClusterOperationInfo]
clusterOperationInfoList = Maybe [ClusterOperationInfo]
a} :: ListClusterOperationsResponse) ((Maybe [ClusterOperationInfo] -> f (Maybe [ClusterOperationInfo]))
 -> ListClusterOperationsResponse
 -> f ListClusterOperationsResponse)
-> ((Maybe [ClusterOperationInfo]
     -> f (Maybe [ClusterOperationInfo]))
    -> Maybe [ClusterOperationInfo]
    -> f (Maybe [ClusterOperationInfo]))
-> (Maybe [ClusterOperationInfo]
    -> f (Maybe [ClusterOperationInfo]))
-> ListClusterOperationsResponse
-> f ListClusterOperationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ClusterOperationInfo]
  [ClusterOperationInfo]
  [ClusterOperationInfo]
  [ClusterOperationInfo]
-> Iso
     (Maybe [ClusterOperationInfo])
     (Maybe [ClusterOperationInfo])
     (Maybe [ClusterOperationInfo])
     (Maybe [ClusterOperationInfo])
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
  [ClusterOperationInfo]
  [ClusterOperationInfo]
  [ClusterOperationInfo]
  [ClusterOperationInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response of ListClusterOperations is truncated, it returns a
-- NextToken in the response. This Nexttoken should be sent in the
-- subsequent request to ListClusterOperations.
listClusterOperationsResponse_nextToken :: Lens.Lens' ListClusterOperationsResponse (Prelude.Maybe Prelude.Text)
listClusterOperationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListClusterOperationsResponse -> f ListClusterOperationsResponse
listClusterOperationsResponse_nextToken = (ListClusterOperationsResponse -> Maybe Text)
-> (ListClusterOperationsResponse
    -> Maybe Text -> ListClusterOperationsResponse)
-> Lens' ListClusterOperationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterOperationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClusterOperationsResponse' :: ListClusterOperationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClusterOperationsResponse
s@ListClusterOperationsResponse' {} Maybe Text
a -> ListClusterOperationsResponse
s {$sel:nextToken:ListClusterOperationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListClusterOperationsResponse)

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

instance Prelude.NFData ListClusterOperationsResponse