{-# 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.DeviceFarm.ListRemoteAccessSessions
-- 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 currently running remote access sessions.
--
-- This operation returns paginated results.
module Amazonka.DeviceFarm.ListRemoteAccessSessions
  ( -- * Creating a Request
    ListRemoteAccessSessions (..),
    newListRemoteAccessSessions,

    -- * Request Lenses
    listRemoteAccessSessions_nextToken,
    listRemoteAccessSessions_arn,

    -- * Destructuring the Response
    ListRemoteAccessSessionsResponse (..),
    newListRemoteAccessSessionsResponse,

    -- * Response Lenses
    listRemoteAccessSessionsResponse_nextToken,
    listRemoteAccessSessionsResponse_remoteAccessSessions,
    listRemoteAccessSessionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.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

-- | Represents the request to return information about the remote access
-- session.
--
-- /See:/ 'newListRemoteAccessSessions' smart constructor.
data ListRemoteAccessSessions = ListRemoteAccessSessions'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListRemoteAccessSessions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the project about which you are
    -- requesting information.
    ListRemoteAccessSessions -> Text
arn :: Prelude.Text
  }
  deriving (ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
(ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool)
-> (ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool)
-> Eq ListRemoteAccessSessions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
$c/= :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
== :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
$c== :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
Prelude.Eq, ReadPrec [ListRemoteAccessSessions]
ReadPrec ListRemoteAccessSessions
Int -> ReadS ListRemoteAccessSessions
ReadS [ListRemoteAccessSessions]
(Int -> ReadS ListRemoteAccessSessions)
-> ReadS [ListRemoteAccessSessions]
-> ReadPrec ListRemoteAccessSessions
-> ReadPrec [ListRemoteAccessSessions]
-> Read ListRemoteAccessSessions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRemoteAccessSessions]
$creadListPrec :: ReadPrec [ListRemoteAccessSessions]
readPrec :: ReadPrec ListRemoteAccessSessions
$creadPrec :: ReadPrec ListRemoteAccessSessions
readList :: ReadS [ListRemoteAccessSessions]
$creadList :: ReadS [ListRemoteAccessSessions]
readsPrec :: Int -> ReadS ListRemoteAccessSessions
$creadsPrec :: Int -> ReadS ListRemoteAccessSessions
Prelude.Read, Int -> ListRemoteAccessSessions -> ShowS
[ListRemoteAccessSessions] -> ShowS
ListRemoteAccessSessions -> String
(Int -> ListRemoteAccessSessions -> ShowS)
-> (ListRemoteAccessSessions -> String)
-> ([ListRemoteAccessSessions] -> ShowS)
-> Show ListRemoteAccessSessions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRemoteAccessSessions] -> ShowS
$cshowList :: [ListRemoteAccessSessions] -> ShowS
show :: ListRemoteAccessSessions -> String
$cshow :: ListRemoteAccessSessions -> String
showsPrec :: Int -> ListRemoteAccessSessions -> ShowS
$cshowsPrec :: Int -> ListRemoteAccessSessions -> ShowS
Prelude.Show, (forall x.
 ListRemoteAccessSessions -> Rep ListRemoteAccessSessions x)
-> (forall x.
    Rep ListRemoteAccessSessions x -> ListRemoteAccessSessions)
-> Generic ListRemoteAccessSessions
forall x.
Rep ListRemoteAccessSessions x -> ListRemoteAccessSessions
forall x.
ListRemoteAccessSessions -> Rep ListRemoteAccessSessions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRemoteAccessSessions x -> ListRemoteAccessSessions
$cfrom :: forall x.
ListRemoteAccessSessions -> Rep ListRemoteAccessSessions x
Prelude.Generic)

-- |
-- Create a value of 'ListRemoteAccessSessions' 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', 'listRemoteAccessSessions_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'arn', 'listRemoteAccessSessions_arn' - The Amazon Resource Name (ARN) of the project about which you are
-- requesting information.
newListRemoteAccessSessions ::
  -- | 'arn'
  Prelude.Text ->
  ListRemoteAccessSessions
newListRemoteAccessSessions :: Text -> ListRemoteAccessSessions
newListRemoteAccessSessions Text
pArn_ =
  ListRemoteAccessSessions' :: Maybe Text -> Text -> ListRemoteAccessSessions
ListRemoteAccessSessions'
    { $sel:nextToken:ListRemoteAccessSessions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ListRemoteAccessSessions' :: Text
arn = Text
pArn_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listRemoteAccessSessions_nextToken :: Lens.Lens' ListRemoteAccessSessions (Prelude.Maybe Prelude.Text)
listRemoteAccessSessions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRemoteAccessSessions -> f ListRemoteAccessSessions
listRemoteAccessSessions_nextToken = (ListRemoteAccessSessions -> Maybe Text)
-> (ListRemoteAccessSessions
    -> Maybe Text -> ListRemoteAccessSessions)
-> Lens
     ListRemoteAccessSessions
     ListRemoteAccessSessions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRemoteAccessSessions
s@ListRemoteAccessSessions' {} Maybe Text
a -> ListRemoteAccessSessions
s {$sel:nextToken:ListRemoteAccessSessions' :: Maybe Text
nextToken = Maybe Text
a} :: ListRemoteAccessSessions)

-- | The Amazon Resource Name (ARN) of the project about which you are
-- requesting information.
listRemoteAccessSessions_arn :: Lens.Lens' ListRemoteAccessSessions Prelude.Text
listRemoteAccessSessions_arn :: (Text -> f Text)
-> ListRemoteAccessSessions -> f ListRemoteAccessSessions
listRemoteAccessSessions_arn = (ListRemoteAccessSessions -> Text)
-> (ListRemoteAccessSessions -> Text -> ListRemoteAccessSessions)
-> Lens ListRemoteAccessSessions ListRemoteAccessSessions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessions' {Text
arn :: Text
$sel:arn:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Text
arn} -> Text
arn) (\s :: ListRemoteAccessSessions
s@ListRemoteAccessSessions' {} Text
a -> ListRemoteAccessSessions
s {$sel:arn:ListRemoteAccessSessions' :: Text
arn = Text
a} :: ListRemoteAccessSessions)

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

instance Prelude.NFData ListRemoteAccessSessions

instance Core.ToHeaders ListRemoteAccessSessions where
  toHeaders :: ListRemoteAccessSessions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRemoteAccessSessions -> 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
"DeviceFarm_20150623.ListRemoteAccessSessions" ::
                          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 ListRemoteAccessSessions where
  toJSON :: ListRemoteAccessSessions -> Value
toJSON ListRemoteAccessSessions' {Maybe Text
Text
arn :: Text
nextToken :: Maybe Text
$sel:arn:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Text
$sel:nextToken:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> 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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
          ]
      )

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

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

-- | Represents the response from the server after AWS Device Farm makes a
-- request to return information about the remote access session.
--
-- /See:/ 'newListRemoteAccessSessionsResponse' smart constructor.
data ListRemoteAccessSessionsResponse = ListRemoteAccessSessionsResponse'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListRemoteAccessSessionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A container that represents the metadata from the service about each
    -- remote access session you are requesting.
    ListRemoteAccessSessionsResponse -> Maybe [RemoteAccessSession]
remoteAccessSessions :: Prelude.Maybe [RemoteAccessSession],
    -- | The response's http status code.
    ListRemoteAccessSessionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
(ListRemoteAccessSessionsResponse
 -> ListRemoteAccessSessionsResponse -> Bool)
-> (ListRemoteAccessSessionsResponse
    -> ListRemoteAccessSessionsResponse -> Bool)
-> Eq ListRemoteAccessSessionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
$c/= :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
== :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
$c== :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
Prelude.Eq, ReadPrec [ListRemoteAccessSessionsResponse]
ReadPrec ListRemoteAccessSessionsResponse
Int -> ReadS ListRemoteAccessSessionsResponse
ReadS [ListRemoteAccessSessionsResponse]
(Int -> ReadS ListRemoteAccessSessionsResponse)
-> ReadS [ListRemoteAccessSessionsResponse]
-> ReadPrec ListRemoteAccessSessionsResponse
-> ReadPrec [ListRemoteAccessSessionsResponse]
-> Read ListRemoteAccessSessionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRemoteAccessSessionsResponse]
$creadListPrec :: ReadPrec [ListRemoteAccessSessionsResponse]
readPrec :: ReadPrec ListRemoteAccessSessionsResponse
$creadPrec :: ReadPrec ListRemoteAccessSessionsResponse
readList :: ReadS [ListRemoteAccessSessionsResponse]
$creadList :: ReadS [ListRemoteAccessSessionsResponse]
readsPrec :: Int -> ReadS ListRemoteAccessSessionsResponse
$creadsPrec :: Int -> ReadS ListRemoteAccessSessionsResponse
Prelude.Read, Int -> ListRemoteAccessSessionsResponse -> ShowS
[ListRemoteAccessSessionsResponse] -> ShowS
ListRemoteAccessSessionsResponse -> String
(Int -> ListRemoteAccessSessionsResponse -> ShowS)
-> (ListRemoteAccessSessionsResponse -> String)
-> ([ListRemoteAccessSessionsResponse] -> ShowS)
-> Show ListRemoteAccessSessionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRemoteAccessSessionsResponse] -> ShowS
$cshowList :: [ListRemoteAccessSessionsResponse] -> ShowS
show :: ListRemoteAccessSessionsResponse -> String
$cshow :: ListRemoteAccessSessionsResponse -> String
showsPrec :: Int -> ListRemoteAccessSessionsResponse -> ShowS
$cshowsPrec :: Int -> ListRemoteAccessSessionsResponse -> ShowS
Prelude.Show, (forall x.
 ListRemoteAccessSessionsResponse
 -> Rep ListRemoteAccessSessionsResponse x)
-> (forall x.
    Rep ListRemoteAccessSessionsResponse x
    -> ListRemoteAccessSessionsResponse)
-> Generic ListRemoteAccessSessionsResponse
forall x.
Rep ListRemoteAccessSessionsResponse x
-> ListRemoteAccessSessionsResponse
forall x.
ListRemoteAccessSessionsResponse
-> Rep ListRemoteAccessSessionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRemoteAccessSessionsResponse x
-> ListRemoteAccessSessionsResponse
$cfrom :: forall x.
ListRemoteAccessSessionsResponse
-> Rep ListRemoteAccessSessionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRemoteAccessSessionsResponse' 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', 'listRemoteAccessSessionsResponse_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'remoteAccessSessions', 'listRemoteAccessSessionsResponse_remoteAccessSessions' - A container that represents the metadata from the service about each
-- remote access session you are requesting.
--
-- 'httpStatus', 'listRemoteAccessSessionsResponse_httpStatus' - The response's http status code.
newListRemoteAccessSessionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRemoteAccessSessionsResponse
newListRemoteAccessSessionsResponse :: Int -> ListRemoteAccessSessionsResponse
newListRemoteAccessSessionsResponse Int
pHttpStatus_ =
  ListRemoteAccessSessionsResponse' :: Maybe Text
-> Maybe [RemoteAccessSession]
-> Int
-> ListRemoteAccessSessionsResponse
ListRemoteAccessSessionsResponse'
    { $sel:nextToken:ListRemoteAccessSessionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:remoteAccessSessions:ListRemoteAccessSessionsResponse' :: Maybe [RemoteAccessSession]
remoteAccessSessions = Maybe [RemoteAccessSession]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRemoteAccessSessionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listRemoteAccessSessionsResponse_nextToken :: Lens.Lens' ListRemoteAccessSessionsResponse (Prelude.Maybe Prelude.Text)
listRemoteAccessSessionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRemoteAccessSessionsResponse
-> f ListRemoteAccessSessionsResponse
listRemoteAccessSessionsResponse_nextToken = (ListRemoteAccessSessionsResponse -> Maybe Text)
-> (ListRemoteAccessSessionsResponse
    -> Maybe Text -> ListRemoteAccessSessionsResponse)
-> Lens' ListRemoteAccessSessionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRemoteAccessSessionsResponse
s@ListRemoteAccessSessionsResponse' {} Maybe Text
a -> ListRemoteAccessSessionsResponse
s {$sel:nextToken:ListRemoteAccessSessionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRemoteAccessSessionsResponse)

-- | A container that represents the metadata from the service about each
-- remote access session you are requesting.
listRemoteAccessSessionsResponse_remoteAccessSessions :: Lens.Lens' ListRemoteAccessSessionsResponse (Prelude.Maybe [RemoteAccessSession])
listRemoteAccessSessionsResponse_remoteAccessSessions :: (Maybe [RemoteAccessSession] -> f (Maybe [RemoteAccessSession]))
-> ListRemoteAccessSessionsResponse
-> f ListRemoteAccessSessionsResponse
listRemoteAccessSessionsResponse_remoteAccessSessions = (ListRemoteAccessSessionsResponse -> Maybe [RemoteAccessSession])
-> (ListRemoteAccessSessionsResponse
    -> Maybe [RemoteAccessSession] -> ListRemoteAccessSessionsResponse)
-> Lens'
     ListRemoteAccessSessionsResponse (Maybe [RemoteAccessSession])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessionsResponse' {Maybe [RemoteAccessSession]
remoteAccessSessions :: Maybe [RemoteAccessSession]
$sel:remoteAccessSessions:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> Maybe [RemoteAccessSession]
remoteAccessSessions} -> Maybe [RemoteAccessSession]
remoteAccessSessions) (\s :: ListRemoteAccessSessionsResponse
s@ListRemoteAccessSessionsResponse' {} Maybe [RemoteAccessSession]
a -> ListRemoteAccessSessionsResponse
s {$sel:remoteAccessSessions:ListRemoteAccessSessionsResponse' :: Maybe [RemoteAccessSession]
remoteAccessSessions = Maybe [RemoteAccessSession]
a} :: ListRemoteAccessSessionsResponse) ((Maybe [RemoteAccessSession] -> f (Maybe [RemoteAccessSession]))
 -> ListRemoteAccessSessionsResponse
 -> f ListRemoteAccessSessionsResponse)
-> ((Maybe [RemoteAccessSession]
     -> f (Maybe [RemoteAccessSession]))
    -> Maybe [RemoteAccessSession] -> f (Maybe [RemoteAccessSession]))
-> (Maybe [RemoteAccessSession] -> f (Maybe [RemoteAccessSession]))
-> ListRemoteAccessSessionsResponse
-> f ListRemoteAccessSessionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RemoteAccessSession]
  [RemoteAccessSession]
  [RemoteAccessSession]
  [RemoteAccessSession]
-> Iso
     (Maybe [RemoteAccessSession])
     (Maybe [RemoteAccessSession])
     (Maybe [RemoteAccessSession])
     (Maybe [RemoteAccessSession])
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
  [RemoteAccessSession]
  [RemoteAccessSession]
  [RemoteAccessSession]
  [RemoteAccessSession]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListRemoteAccessSessionsResponse