{-# 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.APIGateway.GetResources
-- 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 information about a collection of Resource resources.
--
-- This operation returns paginated results.
module Amazonka.APIGateway.GetResources
  ( -- * Creating a Request
    GetResources (..),
    newGetResources,

    -- * Request Lenses
    getResources_embed,
    getResources_limit,
    getResources_position,
    getResources_restApiId,

    -- * Destructuring the Response
    GetResourcesResponse (..),
    newGetResourcesResponse,

    -- * Response Lenses
    getResourcesResponse_items,
    getResourcesResponse_position,
    getResourcesResponse_httpStatus,
  )
where

import Amazonka.APIGateway.Types
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

-- | Request to list information about a collection of resources.
--
-- /See:/ 'newGetResources' smart constructor.
data GetResources = GetResources'
  { -- | A query parameter used to retrieve the specified resources embedded in
    -- the returned Resources resource in the response. This @embed@ parameter
    -- value is a list of comma-separated strings. Currently, the request
    -- supports only retrieval of the embedded Method resources this way. The
    -- query parameter value must be a single-valued list and contain the
    -- @\"methods\"@ string. For example,
    -- @GET \/restapis\/{restapi_id}\/resources?embed=methods@.
    GetResources -> Maybe [Text]
embed :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of returned results per page. The default value is 25
    -- and the maximum value is 500.
    GetResources -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The current pagination position in the paged result set.
    GetResources -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | [Required] The string identifier of the associated RestApi.
    GetResources -> Text
restApiId :: Prelude.Text
  }
  deriving (GetResources -> GetResources -> Bool
(GetResources -> GetResources -> Bool)
-> (GetResources -> GetResources -> Bool) -> Eq GetResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResources -> GetResources -> Bool
$c/= :: GetResources -> GetResources -> Bool
== :: GetResources -> GetResources -> Bool
$c== :: GetResources -> GetResources -> Bool
Prelude.Eq, ReadPrec [GetResources]
ReadPrec GetResources
Int -> ReadS GetResources
ReadS [GetResources]
(Int -> ReadS GetResources)
-> ReadS [GetResources]
-> ReadPrec GetResources
-> ReadPrec [GetResources]
-> Read GetResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResources]
$creadListPrec :: ReadPrec [GetResources]
readPrec :: ReadPrec GetResources
$creadPrec :: ReadPrec GetResources
readList :: ReadS [GetResources]
$creadList :: ReadS [GetResources]
readsPrec :: Int -> ReadS GetResources
$creadsPrec :: Int -> ReadS GetResources
Prelude.Read, Int -> GetResources -> ShowS
[GetResources] -> ShowS
GetResources -> String
(Int -> GetResources -> ShowS)
-> (GetResources -> String)
-> ([GetResources] -> ShowS)
-> Show GetResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResources] -> ShowS
$cshowList :: [GetResources] -> ShowS
show :: GetResources -> String
$cshow :: GetResources -> String
showsPrec :: Int -> GetResources -> ShowS
$cshowsPrec :: Int -> GetResources -> ShowS
Prelude.Show, (forall x. GetResources -> Rep GetResources x)
-> (forall x. Rep GetResources x -> GetResources)
-> Generic GetResources
forall x. Rep GetResources x -> GetResources
forall x. GetResources -> Rep GetResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResources x -> GetResources
$cfrom :: forall x. GetResources -> Rep GetResources x
Prelude.Generic)

-- |
-- Create a value of 'GetResources' 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:
--
-- 'embed', 'getResources_embed' - A query parameter used to retrieve the specified resources embedded in
-- the returned Resources resource in the response. This @embed@ parameter
-- value is a list of comma-separated strings. Currently, the request
-- supports only retrieval of the embedded Method resources this way. The
-- query parameter value must be a single-valued list and contain the
-- @\"methods\"@ string. For example,
-- @GET \/restapis\/{restapi_id}\/resources?embed=methods@.
--
-- 'limit', 'getResources_limit' - The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
--
-- 'position', 'getResources_position' - The current pagination position in the paged result set.
--
-- 'restApiId', 'getResources_restApiId' - [Required] The string identifier of the associated RestApi.
newGetResources ::
  -- | 'restApiId'
  Prelude.Text ->
  GetResources
newGetResources :: Text -> GetResources
newGetResources Text
pRestApiId_ =
  GetResources' :: Maybe [Text] -> Maybe Int -> Maybe Text -> Text -> GetResources
GetResources'
    { $sel:embed:GetResources' :: Maybe [Text]
embed = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:GetResources' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetResources' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:restApiId:GetResources' :: Text
restApiId = Text
pRestApiId_
    }

-- | A query parameter used to retrieve the specified resources embedded in
-- the returned Resources resource in the response. This @embed@ parameter
-- value is a list of comma-separated strings. Currently, the request
-- supports only retrieval of the embedded Method resources this way. The
-- query parameter value must be a single-valued list and contain the
-- @\"methods\"@ string. For example,
-- @GET \/restapis\/{restapi_id}\/resources?embed=methods@.
getResources_embed :: Lens.Lens' GetResources (Prelude.Maybe [Prelude.Text])
getResources_embed :: (Maybe [Text] -> f (Maybe [Text]))
-> GetResources -> f GetResources
getResources_embed = (GetResources -> Maybe [Text])
-> (GetResources -> Maybe [Text] -> GetResources)
-> Lens GetResources GetResources (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe [Text]
embed :: Maybe [Text]
$sel:embed:GetResources' :: GetResources -> Maybe [Text]
embed} -> Maybe [Text]
embed) (\s :: GetResources
s@GetResources' {} Maybe [Text]
a -> GetResources
s {$sel:embed:GetResources' :: Maybe [Text]
embed = Maybe [Text]
a} :: GetResources) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetResources -> f GetResources)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetResources
-> f GetResources
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
getResources_limit :: Lens.Lens' GetResources (Prelude.Maybe Prelude.Int)
getResources_limit :: (Maybe Int -> f (Maybe Int)) -> GetResources -> f GetResources
getResources_limit = (GetResources -> Maybe Int)
-> (GetResources -> Maybe Int -> GetResources)
-> Lens GetResources GetResources (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe Int
limit :: Maybe Int
$sel:limit:GetResources' :: GetResources -> Maybe Int
limit} -> Maybe Int
limit) (\s :: GetResources
s@GetResources' {} Maybe Int
a -> GetResources
s {$sel:limit:GetResources' :: Maybe Int
limit = Maybe Int
a} :: GetResources)

-- | The current pagination position in the paged result set.
getResources_position :: Lens.Lens' GetResources (Prelude.Maybe Prelude.Text)
getResources_position :: (Maybe Text -> f (Maybe Text)) -> GetResources -> f GetResources
getResources_position = (GetResources -> Maybe Text)
-> (GetResources -> Maybe Text -> GetResources)
-> Lens GetResources GetResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Maybe Text
position :: Maybe Text
$sel:position:GetResources' :: GetResources -> Maybe Text
position} -> Maybe Text
position) (\s :: GetResources
s@GetResources' {} Maybe Text
a -> GetResources
s {$sel:position:GetResources' :: Maybe Text
position = Maybe Text
a} :: GetResources)

-- | [Required] The string identifier of the associated RestApi.
getResources_restApiId :: Lens.Lens' GetResources Prelude.Text
getResources_restApiId :: (Text -> f Text) -> GetResources -> f GetResources
getResources_restApiId = (GetResources -> Text)
-> (GetResources -> Text -> GetResources)
-> Lens GetResources GetResources Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResources' {Text
restApiId :: Text
$sel:restApiId:GetResources' :: GetResources -> Text
restApiId} -> Text
restApiId) (\s :: GetResources
s@GetResources' {} Text
a -> GetResources
s {$sel:restApiId:GetResources' :: Text
restApiId = Text
a} :: GetResources)

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

instance Prelude.NFData GetResources

instance Core.ToHeaders GetResources where
  toHeaders :: GetResources -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToPath GetResources where
  toPath :: GetResources -> ByteString
toPath GetResources' {Maybe Int
Maybe [Text]
Maybe Text
Text
restApiId :: Text
position :: Maybe Text
limit :: Maybe Int
embed :: Maybe [Text]
$sel:restApiId:GetResources' :: GetResources -> Text
$sel:position:GetResources' :: GetResources -> Maybe Text
$sel:limit:GetResources' :: GetResources -> Maybe Int
$sel:embed:GetResources' :: GetResources -> Maybe [Text]
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/restapis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId, ByteString
"/resources"]

instance Core.ToQuery GetResources where
  toQuery :: GetResources -> QueryString
toQuery GetResources' {Maybe Int
Maybe [Text]
Maybe Text
Text
restApiId :: Text
position :: Maybe Text
limit :: Maybe Int
embed :: Maybe [Text]
$sel:restApiId:GetResources' :: GetResources -> Text
$sel:position:GetResources' :: GetResources -> Maybe Text
$sel:limit:GetResources' :: GetResources -> Maybe Int
$sel:embed:GetResources' :: GetResources -> Maybe [Text]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"embed"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
embed),
        ByteString
"limit" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
limit,
        ByteString
"position" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
position
      ]

-- | Represents a collection of Resource resources.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html Create an API>
--
-- /See:/ 'newGetResourcesResponse' smart constructor.
data GetResourcesResponse = GetResourcesResponse'
  { -- | The current page of elements from this collection.
    GetResourcesResponse -> Maybe [Resource]
items :: Prelude.Maybe [Resource],
    GetResourcesResponse -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetResourcesResponse -> GetResourcesResponse -> Bool
(GetResourcesResponse -> GetResourcesResponse -> Bool)
-> (GetResourcesResponse -> GetResourcesResponse -> Bool)
-> Eq GetResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourcesResponse -> GetResourcesResponse -> Bool
$c/= :: GetResourcesResponse -> GetResourcesResponse -> Bool
== :: GetResourcesResponse -> GetResourcesResponse -> Bool
$c== :: GetResourcesResponse -> GetResourcesResponse -> Bool
Prelude.Eq, ReadPrec [GetResourcesResponse]
ReadPrec GetResourcesResponse
Int -> ReadS GetResourcesResponse
ReadS [GetResourcesResponse]
(Int -> ReadS GetResourcesResponse)
-> ReadS [GetResourcesResponse]
-> ReadPrec GetResourcesResponse
-> ReadPrec [GetResourcesResponse]
-> Read GetResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourcesResponse]
$creadListPrec :: ReadPrec [GetResourcesResponse]
readPrec :: ReadPrec GetResourcesResponse
$creadPrec :: ReadPrec GetResourcesResponse
readList :: ReadS [GetResourcesResponse]
$creadList :: ReadS [GetResourcesResponse]
readsPrec :: Int -> ReadS GetResourcesResponse
$creadsPrec :: Int -> ReadS GetResourcesResponse
Prelude.Read, Int -> GetResourcesResponse -> ShowS
[GetResourcesResponse] -> ShowS
GetResourcesResponse -> String
(Int -> GetResourcesResponse -> ShowS)
-> (GetResourcesResponse -> String)
-> ([GetResourcesResponse] -> ShowS)
-> Show GetResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourcesResponse] -> ShowS
$cshowList :: [GetResourcesResponse] -> ShowS
show :: GetResourcesResponse -> String
$cshow :: GetResourcesResponse -> String
showsPrec :: Int -> GetResourcesResponse -> ShowS
$cshowsPrec :: Int -> GetResourcesResponse -> ShowS
Prelude.Show, (forall x. GetResourcesResponse -> Rep GetResourcesResponse x)
-> (forall x. Rep GetResourcesResponse x -> GetResourcesResponse)
-> Generic GetResourcesResponse
forall x. Rep GetResourcesResponse x -> GetResourcesResponse
forall x. GetResourcesResponse -> Rep GetResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetResourcesResponse x -> GetResourcesResponse
$cfrom :: forall x. GetResourcesResponse -> Rep GetResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetResourcesResponse' 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:
--
-- 'items', 'getResourcesResponse_items' - The current page of elements from this collection.
--
-- 'position', 'getResourcesResponse_position' - Undocumented member.
--
-- 'httpStatus', 'getResourcesResponse_httpStatus' - The response's http status code.
newGetResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetResourcesResponse
newGetResourcesResponse :: Int -> GetResourcesResponse
newGetResourcesResponse Int
pHttpStatus_ =
  GetResourcesResponse' :: Maybe [Resource] -> Maybe Text -> Int -> GetResourcesResponse
GetResourcesResponse'
    { $sel:items:GetResourcesResponse' :: Maybe [Resource]
items = Maybe [Resource]
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetResourcesResponse' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current page of elements from this collection.
getResourcesResponse_items :: Lens.Lens' GetResourcesResponse (Prelude.Maybe [Resource])
getResourcesResponse_items :: (Maybe [Resource] -> f (Maybe [Resource]))
-> GetResourcesResponse -> f GetResourcesResponse
getResourcesResponse_items = (GetResourcesResponse -> Maybe [Resource])
-> (GetResourcesResponse
    -> Maybe [Resource] -> GetResourcesResponse)
-> Lens' GetResourcesResponse (Maybe [Resource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcesResponse' {Maybe [Resource]
items :: Maybe [Resource]
$sel:items:GetResourcesResponse' :: GetResourcesResponse -> Maybe [Resource]
items} -> Maybe [Resource]
items) (\s :: GetResourcesResponse
s@GetResourcesResponse' {} Maybe [Resource]
a -> GetResourcesResponse
s {$sel:items:GetResourcesResponse' :: Maybe [Resource]
items = Maybe [Resource]
a} :: GetResourcesResponse) ((Maybe [Resource] -> f (Maybe [Resource]))
 -> GetResourcesResponse -> f GetResourcesResponse)
-> ((Maybe [Resource] -> f (Maybe [Resource]))
    -> Maybe [Resource] -> f (Maybe [Resource]))
-> (Maybe [Resource] -> f (Maybe [Resource]))
-> GetResourcesResponse
-> f GetResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Resource] [Resource] [Resource] [Resource]
-> Iso
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
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 [Resource] [Resource] [Resource] [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
getResourcesResponse_position :: Lens.Lens' GetResourcesResponse (Prelude.Maybe Prelude.Text)
getResourcesResponse_position :: (Maybe Text -> f (Maybe Text))
-> GetResourcesResponse -> f GetResourcesResponse
getResourcesResponse_position = (GetResourcesResponse -> Maybe Text)
-> (GetResourcesResponse -> Maybe Text -> GetResourcesResponse)
-> Lens' GetResourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourcesResponse' {Maybe Text
position :: Maybe Text
$sel:position:GetResourcesResponse' :: GetResourcesResponse -> Maybe Text
position} -> Maybe Text
position) (\s :: GetResourcesResponse
s@GetResourcesResponse' {} Maybe Text
a -> GetResourcesResponse
s {$sel:position:GetResourcesResponse' :: Maybe Text
position = Maybe Text
a} :: GetResourcesResponse)

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

instance Prelude.NFData GetResourcesResponse