{-# 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.Connect.ListInstanceStorageConfigs
-- 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)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Returns a paginated list of storage configs for the identified instance
-- and resource type.
--
-- This operation returns paginated results.
module Amazonka.Connect.ListInstanceStorageConfigs
  ( -- * Creating a Request
    ListInstanceStorageConfigs (..),
    newListInstanceStorageConfigs,

    -- * Request Lenses
    listInstanceStorageConfigs_nextToken,
    listInstanceStorageConfigs_maxResults,
    listInstanceStorageConfigs_instanceId,
    listInstanceStorageConfigs_resourceType,

    -- * Destructuring the Response
    ListInstanceStorageConfigsResponse (..),
    newListInstanceStorageConfigsResponse,

    -- * Response Lenses
    listInstanceStorageConfigsResponse_storageConfigs,
    listInstanceStorageConfigsResponse_nextToken,
    listInstanceStorageConfigsResponse_httpStatus,
  )
where

import Amazonka.Connect.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

-- | /See:/ 'newListInstanceStorageConfigs' smart constructor.
data ListInstanceStorageConfigs = ListInstanceStorageConfigs'
  { -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    ListInstanceStorageConfigs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per page.
    ListInstanceStorageConfigs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    ListInstanceStorageConfigs -> Text
instanceId :: Prelude.Text,
    -- | A valid resource type.
    ListInstanceStorageConfigs -> InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
  }
  deriving (ListInstanceStorageConfigs -> ListInstanceStorageConfigs -> Bool
(ListInstanceStorageConfigs -> ListInstanceStorageConfigs -> Bool)
-> (ListInstanceStorageConfigs
    -> ListInstanceStorageConfigs -> Bool)
-> Eq ListInstanceStorageConfigs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceStorageConfigs -> ListInstanceStorageConfigs -> Bool
$c/= :: ListInstanceStorageConfigs -> ListInstanceStorageConfigs -> Bool
== :: ListInstanceStorageConfigs -> ListInstanceStorageConfigs -> Bool
$c== :: ListInstanceStorageConfigs -> ListInstanceStorageConfigs -> Bool
Prelude.Eq, ReadPrec [ListInstanceStorageConfigs]
ReadPrec ListInstanceStorageConfigs
Int -> ReadS ListInstanceStorageConfigs
ReadS [ListInstanceStorageConfigs]
(Int -> ReadS ListInstanceStorageConfigs)
-> ReadS [ListInstanceStorageConfigs]
-> ReadPrec ListInstanceStorageConfigs
-> ReadPrec [ListInstanceStorageConfigs]
-> Read ListInstanceStorageConfigs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceStorageConfigs]
$creadListPrec :: ReadPrec [ListInstanceStorageConfigs]
readPrec :: ReadPrec ListInstanceStorageConfigs
$creadPrec :: ReadPrec ListInstanceStorageConfigs
readList :: ReadS [ListInstanceStorageConfigs]
$creadList :: ReadS [ListInstanceStorageConfigs]
readsPrec :: Int -> ReadS ListInstanceStorageConfigs
$creadsPrec :: Int -> ReadS ListInstanceStorageConfigs
Prelude.Read, Int -> ListInstanceStorageConfigs -> ShowS
[ListInstanceStorageConfigs] -> ShowS
ListInstanceStorageConfigs -> String
(Int -> ListInstanceStorageConfigs -> ShowS)
-> (ListInstanceStorageConfigs -> String)
-> ([ListInstanceStorageConfigs] -> ShowS)
-> Show ListInstanceStorageConfigs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceStorageConfigs] -> ShowS
$cshowList :: [ListInstanceStorageConfigs] -> ShowS
show :: ListInstanceStorageConfigs -> String
$cshow :: ListInstanceStorageConfigs -> String
showsPrec :: Int -> ListInstanceStorageConfigs -> ShowS
$cshowsPrec :: Int -> ListInstanceStorageConfigs -> ShowS
Prelude.Show, (forall x.
 ListInstanceStorageConfigs -> Rep ListInstanceStorageConfigs x)
-> (forall x.
    Rep ListInstanceStorageConfigs x -> ListInstanceStorageConfigs)
-> Generic ListInstanceStorageConfigs
forall x.
Rep ListInstanceStorageConfigs x -> ListInstanceStorageConfigs
forall x.
ListInstanceStorageConfigs -> Rep ListInstanceStorageConfigs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInstanceStorageConfigs x -> ListInstanceStorageConfigs
$cfrom :: forall x.
ListInstanceStorageConfigs -> Rep ListInstanceStorageConfigs x
Prelude.Generic)

-- |
-- Create a value of 'ListInstanceStorageConfigs' 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', 'listInstanceStorageConfigs_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'maxResults', 'listInstanceStorageConfigs_maxResults' - The maximum number of results to return per page.
--
-- 'instanceId', 'listInstanceStorageConfigs_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'resourceType', 'listInstanceStorageConfigs_resourceType' - A valid resource type.
newListInstanceStorageConfigs ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'resourceType'
  InstanceStorageResourceType ->
  ListInstanceStorageConfigs
newListInstanceStorageConfigs :: Text -> InstanceStorageResourceType -> ListInstanceStorageConfigs
newListInstanceStorageConfigs
  Text
pInstanceId_
  InstanceStorageResourceType
pResourceType_ =
    ListInstanceStorageConfigs' :: Maybe Text
-> Maybe Natural
-> Text
-> InstanceStorageResourceType
-> ListInstanceStorageConfigs
ListInstanceStorageConfigs'
      { $sel:nextToken:ListInstanceStorageConfigs' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListInstanceStorageConfigs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:ListInstanceStorageConfigs' :: Text
instanceId = Text
pInstanceId_,
        $sel:resourceType:ListInstanceStorageConfigs' :: InstanceStorageResourceType
resourceType = InstanceStorageResourceType
pResourceType_
      }

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
listInstanceStorageConfigs_nextToken :: Lens.Lens' ListInstanceStorageConfigs (Prelude.Maybe Prelude.Text)
listInstanceStorageConfigs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInstanceStorageConfigs -> f ListInstanceStorageConfigs
listInstanceStorageConfigs_nextToken = (ListInstanceStorageConfigs -> Maybe Text)
-> (ListInstanceStorageConfigs
    -> Maybe Text -> ListInstanceStorageConfigs)
-> Lens
     ListInstanceStorageConfigs
     ListInstanceStorageConfigs
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceStorageConfigs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstanceStorageConfigs
s@ListInstanceStorageConfigs' {} Maybe Text
a -> ListInstanceStorageConfigs
s {$sel:nextToken:ListInstanceStorageConfigs' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstanceStorageConfigs)

-- | The maximum number of results to return per page.
listInstanceStorageConfigs_maxResults :: Lens.Lens' ListInstanceStorageConfigs (Prelude.Maybe Prelude.Natural)
listInstanceStorageConfigs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListInstanceStorageConfigs -> f ListInstanceStorageConfigs
listInstanceStorageConfigs_maxResults = (ListInstanceStorageConfigs -> Maybe Natural)
-> (ListInstanceStorageConfigs
    -> Maybe Natural -> ListInstanceStorageConfigs)
-> Lens
     ListInstanceStorageConfigs
     ListInstanceStorageConfigs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceStorageConfigs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListInstanceStorageConfigs
s@ListInstanceStorageConfigs' {} Maybe Natural
a -> ListInstanceStorageConfigs
s {$sel:maxResults:ListInstanceStorageConfigs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListInstanceStorageConfigs)

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
listInstanceStorageConfigs_instanceId :: Lens.Lens' ListInstanceStorageConfigs Prelude.Text
listInstanceStorageConfigs_instanceId :: (Text -> f Text)
-> ListInstanceStorageConfigs -> f ListInstanceStorageConfigs
listInstanceStorageConfigs_instanceId = (ListInstanceStorageConfigs -> Text)
-> (ListInstanceStorageConfigs
    -> Text -> ListInstanceStorageConfigs)
-> Lens
     ListInstanceStorageConfigs ListInstanceStorageConfigs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceStorageConfigs' {Text
instanceId :: Text
$sel:instanceId:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Text
instanceId} -> Text
instanceId) (\s :: ListInstanceStorageConfigs
s@ListInstanceStorageConfigs' {} Text
a -> ListInstanceStorageConfigs
s {$sel:instanceId:ListInstanceStorageConfigs' :: Text
instanceId = Text
a} :: ListInstanceStorageConfigs)

-- | A valid resource type.
listInstanceStorageConfigs_resourceType :: Lens.Lens' ListInstanceStorageConfigs InstanceStorageResourceType
listInstanceStorageConfigs_resourceType :: (InstanceStorageResourceType -> f InstanceStorageResourceType)
-> ListInstanceStorageConfigs -> f ListInstanceStorageConfigs
listInstanceStorageConfigs_resourceType = (ListInstanceStorageConfigs -> InstanceStorageResourceType)
-> (ListInstanceStorageConfigs
    -> InstanceStorageResourceType -> ListInstanceStorageConfigs)
-> Lens
     ListInstanceStorageConfigs
     ListInstanceStorageConfigs
     InstanceStorageResourceType
     InstanceStorageResourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceStorageConfigs' {InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
$sel:resourceType:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> InstanceStorageResourceType
resourceType} -> InstanceStorageResourceType
resourceType) (\s :: ListInstanceStorageConfigs
s@ListInstanceStorageConfigs' {} InstanceStorageResourceType
a -> ListInstanceStorageConfigs
s {$sel:resourceType:ListInstanceStorageConfigs' :: InstanceStorageResourceType
resourceType = InstanceStorageResourceType
a} :: ListInstanceStorageConfigs)

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

instance Prelude.NFData ListInstanceStorageConfigs

instance Core.ToHeaders ListInstanceStorageConfigs where
  toHeaders :: ListInstanceStorageConfigs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListInstanceStorageConfigs -> 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 ListInstanceStorageConfigs where
  toPath :: ListInstanceStorageConfigs -> ByteString
toPath ListInstanceStorageConfigs' {Maybe Natural
Maybe Text
Text
InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:resourceType:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> InstanceStorageResourceType
$sel:instanceId:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Text
$sel:maxResults:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Maybe Natural
$sel:nextToken:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/instance/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/storage-configs"
      ]

instance Core.ToQuery ListInstanceStorageConfigs where
  toQuery :: ListInstanceStorageConfigs -> QueryString
toQuery ListInstanceStorageConfigs' {Maybe Natural
Maybe Text
Text
InstanceStorageResourceType
resourceType :: InstanceStorageResourceType
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:resourceType:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> InstanceStorageResourceType
$sel:instanceId:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Text
$sel:maxResults:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> Maybe Natural
$sel:nextToken:ListInstanceStorageConfigs' :: ListInstanceStorageConfigs -> 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,
        ByteString
"resourceType" ByteString -> InstanceStorageResourceType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: InstanceStorageResourceType
resourceType
      ]

-- | /See:/ 'newListInstanceStorageConfigsResponse' smart constructor.
data ListInstanceStorageConfigsResponse = ListInstanceStorageConfigsResponse'
  { -- | A valid storage type.
    ListInstanceStorageConfigsResponse -> Maybe [InstanceStorageConfig]
storageConfigs :: Prelude.Maybe [InstanceStorageConfig],
    -- | If there are additional results, this is the token for the next set of
    -- results.
    ListInstanceStorageConfigsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListInstanceStorageConfigsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListInstanceStorageConfigsResponse
-> ListInstanceStorageConfigsResponse -> Bool
(ListInstanceStorageConfigsResponse
 -> ListInstanceStorageConfigsResponse -> Bool)
-> (ListInstanceStorageConfigsResponse
    -> ListInstanceStorageConfigsResponse -> Bool)
-> Eq ListInstanceStorageConfigsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceStorageConfigsResponse
-> ListInstanceStorageConfigsResponse -> Bool
$c/= :: ListInstanceStorageConfigsResponse
-> ListInstanceStorageConfigsResponse -> Bool
== :: ListInstanceStorageConfigsResponse
-> ListInstanceStorageConfigsResponse -> Bool
$c== :: ListInstanceStorageConfigsResponse
-> ListInstanceStorageConfigsResponse -> Bool
Prelude.Eq, ReadPrec [ListInstanceStorageConfigsResponse]
ReadPrec ListInstanceStorageConfigsResponse
Int -> ReadS ListInstanceStorageConfigsResponse
ReadS [ListInstanceStorageConfigsResponse]
(Int -> ReadS ListInstanceStorageConfigsResponse)
-> ReadS [ListInstanceStorageConfigsResponse]
-> ReadPrec ListInstanceStorageConfigsResponse
-> ReadPrec [ListInstanceStorageConfigsResponse]
-> Read ListInstanceStorageConfigsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceStorageConfigsResponse]
$creadListPrec :: ReadPrec [ListInstanceStorageConfigsResponse]
readPrec :: ReadPrec ListInstanceStorageConfigsResponse
$creadPrec :: ReadPrec ListInstanceStorageConfigsResponse
readList :: ReadS [ListInstanceStorageConfigsResponse]
$creadList :: ReadS [ListInstanceStorageConfigsResponse]
readsPrec :: Int -> ReadS ListInstanceStorageConfigsResponse
$creadsPrec :: Int -> ReadS ListInstanceStorageConfigsResponse
Prelude.Read, Int -> ListInstanceStorageConfigsResponse -> ShowS
[ListInstanceStorageConfigsResponse] -> ShowS
ListInstanceStorageConfigsResponse -> String
(Int -> ListInstanceStorageConfigsResponse -> ShowS)
-> (ListInstanceStorageConfigsResponse -> String)
-> ([ListInstanceStorageConfigsResponse] -> ShowS)
-> Show ListInstanceStorageConfigsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceStorageConfigsResponse] -> ShowS
$cshowList :: [ListInstanceStorageConfigsResponse] -> ShowS
show :: ListInstanceStorageConfigsResponse -> String
$cshow :: ListInstanceStorageConfigsResponse -> String
showsPrec :: Int -> ListInstanceStorageConfigsResponse -> ShowS
$cshowsPrec :: Int -> ListInstanceStorageConfigsResponse -> ShowS
Prelude.Show, (forall x.
 ListInstanceStorageConfigsResponse
 -> Rep ListInstanceStorageConfigsResponse x)
-> (forall x.
    Rep ListInstanceStorageConfigsResponse x
    -> ListInstanceStorageConfigsResponse)
-> Generic ListInstanceStorageConfigsResponse
forall x.
Rep ListInstanceStorageConfigsResponse x
-> ListInstanceStorageConfigsResponse
forall x.
ListInstanceStorageConfigsResponse
-> Rep ListInstanceStorageConfigsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInstanceStorageConfigsResponse x
-> ListInstanceStorageConfigsResponse
$cfrom :: forall x.
ListInstanceStorageConfigsResponse
-> Rep ListInstanceStorageConfigsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListInstanceStorageConfigsResponse' 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:
--
-- 'storageConfigs', 'listInstanceStorageConfigsResponse_storageConfigs' - A valid storage type.
--
-- 'nextToken', 'listInstanceStorageConfigsResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'httpStatus', 'listInstanceStorageConfigsResponse_httpStatus' - The response's http status code.
newListInstanceStorageConfigsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInstanceStorageConfigsResponse
newListInstanceStorageConfigsResponse :: Int -> ListInstanceStorageConfigsResponse
newListInstanceStorageConfigsResponse Int
pHttpStatus_ =
  ListInstanceStorageConfigsResponse' :: Maybe [InstanceStorageConfig]
-> Maybe Text -> Int -> ListInstanceStorageConfigsResponse
ListInstanceStorageConfigsResponse'
    { $sel:storageConfigs:ListInstanceStorageConfigsResponse' :: Maybe [InstanceStorageConfig]
storageConfigs =
        Maybe [InstanceStorageConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListInstanceStorageConfigsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInstanceStorageConfigsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A valid storage type.
listInstanceStorageConfigsResponse_storageConfigs :: Lens.Lens' ListInstanceStorageConfigsResponse (Prelude.Maybe [InstanceStorageConfig])
listInstanceStorageConfigsResponse_storageConfigs :: (Maybe [InstanceStorageConfig]
 -> f (Maybe [InstanceStorageConfig]))
-> ListInstanceStorageConfigsResponse
-> f ListInstanceStorageConfigsResponse
listInstanceStorageConfigsResponse_storageConfigs = (ListInstanceStorageConfigsResponse
 -> Maybe [InstanceStorageConfig])
-> (ListInstanceStorageConfigsResponse
    -> Maybe [InstanceStorageConfig]
    -> ListInstanceStorageConfigsResponse)
-> Lens'
     ListInstanceStorageConfigsResponse (Maybe [InstanceStorageConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceStorageConfigsResponse' {Maybe [InstanceStorageConfig]
storageConfigs :: Maybe [InstanceStorageConfig]
$sel:storageConfigs:ListInstanceStorageConfigsResponse' :: ListInstanceStorageConfigsResponse -> Maybe [InstanceStorageConfig]
storageConfigs} -> Maybe [InstanceStorageConfig]
storageConfigs) (\s :: ListInstanceStorageConfigsResponse
s@ListInstanceStorageConfigsResponse' {} Maybe [InstanceStorageConfig]
a -> ListInstanceStorageConfigsResponse
s {$sel:storageConfigs:ListInstanceStorageConfigsResponse' :: Maybe [InstanceStorageConfig]
storageConfigs = Maybe [InstanceStorageConfig]
a} :: ListInstanceStorageConfigsResponse) ((Maybe [InstanceStorageConfig]
  -> f (Maybe [InstanceStorageConfig]))
 -> ListInstanceStorageConfigsResponse
 -> f ListInstanceStorageConfigsResponse)
-> ((Maybe [InstanceStorageConfig]
     -> f (Maybe [InstanceStorageConfig]))
    -> Maybe [InstanceStorageConfig]
    -> f (Maybe [InstanceStorageConfig]))
-> (Maybe [InstanceStorageConfig]
    -> f (Maybe [InstanceStorageConfig]))
-> ListInstanceStorageConfigsResponse
-> f ListInstanceStorageConfigsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstanceStorageConfig]
  [InstanceStorageConfig]
  [InstanceStorageConfig]
  [InstanceStorageConfig]
-> Iso
     (Maybe [InstanceStorageConfig])
     (Maybe [InstanceStorageConfig])
     (Maybe [InstanceStorageConfig])
     (Maybe [InstanceStorageConfig])
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
  [InstanceStorageConfig]
  [InstanceStorageConfig]
  [InstanceStorageConfig]
  [InstanceStorageConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If there are additional results, this is the token for the next set of
-- results.
listInstanceStorageConfigsResponse_nextToken :: Lens.Lens' ListInstanceStorageConfigsResponse (Prelude.Maybe Prelude.Text)
listInstanceStorageConfigsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInstanceStorageConfigsResponse
-> f ListInstanceStorageConfigsResponse
listInstanceStorageConfigsResponse_nextToken = (ListInstanceStorageConfigsResponse -> Maybe Text)
-> (ListInstanceStorageConfigsResponse
    -> Maybe Text -> ListInstanceStorageConfigsResponse)
-> Lens' ListInstanceStorageConfigsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceStorageConfigsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstanceStorageConfigsResponse' :: ListInstanceStorageConfigsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstanceStorageConfigsResponse
s@ListInstanceStorageConfigsResponse' {} Maybe Text
a -> ListInstanceStorageConfigsResponse
s {$sel:nextToken:ListInstanceStorageConfigsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstanceStorageConfigsResponse)

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

instance
  Prelude.NFData
    ListInstanceStorageConfigsResponse