{-# 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.ImageBuilder.ListDistributionConfigurations
-- 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 distribution configurations.
module Amazonka.ImageBuilder.ListDistributionConfigurations
  ( -- * Creating a Request
    ListDistributionConfigurations (..),
    newListDistributionConfigurations,

    -- * Request Lenses
    listDistributionConfigurations_filters,
    listDistributionConfigurations_nextToken,
    listDistributionConfigurations_maxResults,

    -- * Destructuring the Response
    ListDistributionConfigurationsResponse (..),
    newListDistributionConfigurationsResponse,

    -- * Response Lenses
    listDistributionConfigurationsResponse_requestId,
    listDistributionConfigurationsResponse_distributionConfigurationSummaryList,
    listDistributionConfigurationsResponse_nextToken,
    listDistributionConfigurationsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.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:/ 'newListDistributionConfigurations' smart constructor.
data ListDistributionConfigurations = ListDistributionConfigurations'
  { -- | You can filter on @name@ to streamline results.
    ListDistributionConfigurations -> Maybe (NonEmpty Filter)
filters :: Prelude.Maybe (Prelude.NonEmpty Filter),
    -- | A token to specify where to start paginating. This is the NextToken from
    -- a previously truncated response.
    ListDistributionConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum items to return in a request.
    ListDistributionConfigurations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListDistributionConfigurations
-> ListDistributionConfigurations -> Bool
(ListDistributionConfigurations
 -> ListDistributionConfigurations -> Bool)
-> (ListDistributionConfigurations
    -> ListDistributionConfigurations -> Bool)
-> Eq ListDistributionConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributionConfigurations
-> ListDistributionConfigurations -> Bool
$c/= :: ListDistributionConfigurations
-> ListDistributionConfigurations -> Bool
== :: ListDistributionConfigurations
-> ListDistributionConfigurations -> Bool
$c== :: ListDistributionConfigurations
-> ListDistributionConfigurations -> Bool
Prelude.Eq, ReadPrec [ListDistributionConfigurations]
ReadPrec ListDistributionConfigurations
Int -> ReadS ListDistributionConfigurations
ReadS [ListDistributionConfigurations]
(Int -> ReadS ListDistributionConfigurations)
-> ReadS [ListDistributionConfigurations]
-> ReadPrec ListDistributionConfigurations
-> ReadPrec [ListDistributionConfigurations]
-> Read ListDistributionConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributionConfigurations]
$creadListPrec :: ReadPrec [ListDistributionConfigurations]
readPrec :: ReadPrec ListDistributionConfigurations
$creadPrec :: ReadPrec ListDistributionConfigurations
readList :: ReadS [ListDistributionConfigurations]
$creadList :: ReadS [ListDistributionConfigurations]
readsPrec :: Int -> ReadS ListDistributionConfigurations
$creadsPrec :: Int -> ReadS ListDistributionConfigurations
Prelude.Read, Int -> ListDistributionConfigurations -> ShowS
[ListDistributionConfigurations] -> ShowS
ListDistributionConfigurations -> String
(Int -> ListDistributionConfigurations -> ShowS)
-> (ListDistributionConfigurations -> String)
-> ([ListDistributionConfigurations] -> ShowS)
-> Show ListDistributionConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributionConfigurations] -> ShowS
$cshowList :: [ListDistributionConfigurations] -> ShowS
show :: ListDistributionConfigurations -> String
$cshow :: ListDistributionConfigurations -> String
showsPrec :: Int -> ListDistributionConfigurations -> ShowS
$cshowsPrec :: Int -> ListDistributionConfigurations -> ShowS
Prelude.Show, (forall x.
 ListDistributionConfigurations
 -> Rep ListDistributionConfigurations x)
-> (forall x.
    Rep ListDistributionConfigurations x
    -> ListDistributionConfigurations)
-> Generic ListDistributionConfigurations
forall x.
Rep ListDistributionConfigurations x
-> ListDistributionConfigurations
forall x.
ListDistributionConfigurations
-> Rep ListDistributionConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDistributionConfigurations x
-> ListDistributionConfigurations
$cfrom :: forall x.
ListDistributionConfigurations
-> Rep ListDistributionConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'ListDistributionConfigurations' 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:
--
-- 'filters', 'listDistributionConfigurations_filters' - You can filter on @name@ to streamline results.
--
-- 'nextToken', 'listDistributionConfigurations_nextToken' - A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
--
-- 'maxResults', 'listDistributionConfigurations_maxResults' - The maximum items to return in a request.
newListDistributionConfigurations ::
  ListDistributionConfigurations
newListDistributionConfigurations :: ListDistributionConfigurations
newListDistributionConfigurations =
  ListDistributionConfigurations' :: Maybe (NonEmpty Filter)
-> Maybe Text -> Maybe Natural -> ListDistributionConfigurations
ListDistributionConfigurations'
    { $sel:filters:ListDistributionConfigurations' :: Maybe (NonEmpty Filter)
filters =
        Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDistributionConfigurations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDistributionConfigurations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | You can filter on @name@ to streamline results.
listDistributionConfigurations_filters :: Lens.Lens' ListDistributionConfigurations (Prelude.Maybe (Prelude.NonEmpty Filter))
listDistributionConfigurations_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListDistributionConfigurations
-> f ListDistributionConfigurations
listDistributionConfigurations_filters = (ListDistributionConfigurations -> Maybe (NonEmpty Filter))
-> (ListDistributionConfigurations
    -> Maybe (NonEmpty Filter) -> ListDistributionConfigurations)
-> Lens
     ListDistributionConfigurations
     ListDistributionConfigurations
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionConfigurations' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListDistributionConfigurations' :: ListDistributionConfigurations -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListDistributionConfigurations
s@ListDistributionConfigurations' {} Maybe (NonEmpty Filter)
a -> ListDistributionConfigurations
s {$sel:filters:ListDistributionConfigurations' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListDistributionConfigurations) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListDistributionConfigurations
 -> f ListDistributionConfigurations)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListDistributionConfigurations
-> f ListDistributionConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
-> Iso
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
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
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
listDistributionConfigurations_nextToken :: Lens.Lens' ListDistributionConfigurations (Prelude.Maybe Prelude.Text)
listDistributionConfigurations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDistributionConfigurations
-> f ListDistributionConfigurations
listDistributionConfigurations_nextToken = (ListDistributionConfigurations -> Maybe Text)
-> (ListDistributionConfigurations
    -> Maybe Text -> ListDistributionConfigurations)
-> Lens
     ListDistributionConfigurations
     ListDistributionConfigurations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionConfigurations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDistributionConfigurations' :: ListDistributionConfigurations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDistributionConfigurations
s@ListDistributionConfigurations' {} Maybe Text
a -> ListDistributionConfigurations
s {$sel:nextToken:ListDistributionConfigurations' :: Maybe Text
nextToken = Maybe Text
a} :: ListDistributionConfigurations)

-- | The maximum items to return in a request.
listDistributionConfigurations_maxResults :: Lens.Lens' ListDistributionConfigurations (Prelude.Maybe Prelude.Natural)
listDistributionConfigurations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDistributionConfigurations
-> f ListDistributionConfigurations
listDistributionConfigurations_maxResults = (ListDistributionConfigurations -> Maybe Natural)
-> (ListDistributionConfigurations
    -> Maybe Natural -> ListDistributionConfigurations)
-> Lens
     ListDistributionConfigurations
     ListDistributionConfigurations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionConfigurations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDistributionConfigurations' :: ListDistributionConfigurations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDistributionConfigurations
s@ListDistributionConfigurations' {} Maybe Natural
a -> ListDistributionConfigurations
s {$sel:maxResults:ListDistributionConfigurations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDistributionConfigurations)

instance
  Core.AWSRequest
    ListDistributionConfigurations
  where
  type
    AWSResponse ListDistributionConfigurations =
      ListDistributionConfigurationsResponse
  request :: ListDistributionConfigurations
-> Request ListDistributionConfigurations
request = Service
-> ListDistributionConfigurations
-> Request ListDistributionConfigurations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDistributionConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListDistributionConfigurations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDistributionConfigurations))
-> Logger
-> Service
-> Proxy ListDistributionConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListDistributionConfigurations)))
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 [DistributionConfigurationSummary]
-> Maybe Text
-> Int
-> ListDistributionConfigurationsResponse
ListDistributionConfigurationsResponse'
            (Maybe Text
 -> Maybe [DistributionConfigurationSummary]
 -> Maybe Text
 -> Int
 -> ListDistributionConfigurationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DistributionConfigurationSummary]
      -> Maybe Text -> Int -> ListDistributionConfigurationsResponse)
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
"requestId")
            Either
  String
  (Maybe [DistributionConfigurationSummary]
   -> Maybe Text -> Int -> ListDistributionConfigurationsResponse)
-> Either String (Maybe [DistributionConfigurationSummary])
-> Either
     String
     (Maybe Text -> Int -> ListDistributionConfigurationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [DistributionConfigurationSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"distributionConfigurationSummaryList"
                            Either String (Maybe (Maybe [DistributionConfigurationSummary]))
-> Maybe [DistributionConfigurationSummary]
-> Either String (Maybe [DistributionConfigurationSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DistributionConfigurationSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text -> Int -> ListDistributionConfigurationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDistributionConfigurationsResponse)
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 -> ListDistributionConfigurationsResponse)
-> Either String Int
-> Either String ListDistributionConfigurationsResponse
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
    ListDistributionConfigurations

instance
  Prelude.NFData
    ListDistributionConfigurations

instance
  Core.ToHeaders
    ListDistributionConfigurations
  where
  toHeaders :: ListDistributionConfigurations -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListDistributionConfigurations -> 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.ToJSON ListDistributionConfigurations where
  toJSON :: ListDistributionConfigurations -> Value
toJSON ListDistributionConfigurations' {Maybe Natural
Maybe (NonEmpty Filter)
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe (NonEmpty Filter)
$sel:maxResults:ListDistributionConfigurations' :: ListDistributionConfigurations -> Maybe Natural
$sel:nextToken:ListDistributionConfigurations' :: ListDistributionConfigurations -> Maybe Text
$sel:filters:ListDistributionConfigurations' :: ListDistributionConfigurations -> Maybe (NonEmpty Filter)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> NonEmpty Filter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Filter -> Pair) -> Maybe (NonEmpty Filter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Filter)
filters,
            (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newListDistributionConfigurationsResponse' smart constructor.
data ListDistributionConfigurationsResponse = ListDistributionConfigurationsResponse'
  { -- | The request ID that uniquely identifies this request.
    ListDistributionConfigurationsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The list of distributions.
    ListDistributionConfigurationsResponse
-> Maybe [DistributionConfigurationSummary]
distributionConfigurationSummaryList :: Prelude.Maybe [DistributionConfigurationSummary],
    -- | The next token used for paginated responses. When this is not empty,
    -- there are additional elements that the service has not included in this
    -- request. Use this token with the next request to retrieve additional
    -- objects.
    ListDistributionConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDistributionConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDistributionConfigurationsResponse
-> ListDistributionConfigurationsResponse -> Bool
(ListDistributionConfigurationsResponse
 -> ListDistributionConfigurationsResponse -> Bool)
-> (ListDistributionConfigurationsResponse
    -> ListDistributionConfigurationsResponse -> Bool)
-> Eq ListDistributionConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributionConfigurationsResponse
-> ListDistributionConfigurationsResponse -> Bool
$c/= :: ListDistributionConfigurationsResponse
-> ListDistributionConfigurationsResponse -> Bool
== :: ListDistributionConfigurationsResponse
-> ListDistributionConfigurationsResponse -> Bool
$c== :: ListDistributionConfigurationsResponse
-> ListDistributionConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListDistributionConfigurationsResponse]
ReadPrec ListDistributionConfigurationsResponse
Int -> ReadS ListDistributionConfigurationsResponse
ReadS [ListDistributionConfigurationsResponse]
(Int -> ReadS ListDistributionConfigurationsResponse)
-> ReadS [ListDistributionConfigurationsResponse]
-> ReadPrec ListDistributionConfigurationsResponse
-> ReadPrec [ListDistributionConfigurationsResponse]
-> Read ListDistributionConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributionConfigurationsResponse]
$creadListPrec :: ReadPrec [ListDistributionConfigurationsResponse]
readPrec :: ReadPrec ListDistributionConfigurationsResponse
$creadPrec :: ReadPrec ListDistributionConfigurationsResponse
readList :: ReadS [ListDistributionConfigurationsResponse]
$creadList :: ReadS [ListDistributionConfigurationsResponse]
readsPrec :: Int -> ReadS ListDistributionConfigurationsResponse
$creadsPrec :: Int -> ReadS ListDistributionConfigurationsResponse
Prelude.Read, Int -> ListDistributionConfigurationsResponse -> ShowS
[ListDistributionConfigurationsResponse] -> ShowS
ListDistributionConfigurationsResponse -> String
(Int -> ListDistributionConfigurationsResponse -> ShowS)
-> (ListDistributionConfigurationsResponse -> String)
-> ([ListDistributionConfigurationsResponse] -> ShowS)
-> Show ListDistributionConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributionConfigurationsResponse] -> ShowS
$cshowList :: [ListDistributionConfigurationsResponse] -> ShowS
show :: ListDistributionConfigurationsResponse -> String
$cshow :: ListDistributionConfigurationsResponse -> String
showsPrec :: Int -> ListDistributionConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListDistributionConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 ListDistributionConfigurationsResponse
 -> Rep ListDistributionConfigurationsResponse x)
-> (forall x.
    Rep ListDistributionConfigurationsResponse x
    -> ListDistributionConfigurationsResponse)
-> Generic ListDistributionConfigurationsResponse
forall x.
Rep ListDistributionConfigurationsResponse x
-> ListDistributionConfigurationsResponse
forall x.
ListDistributionConfigurationsResponse
-> Rep ListDistributionConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDistributionConfigurationsResponse x
-> ListDistributionConfigurationsResponse
$cfrom :: forall x.
ListDistributionConfigurationsResponse
-> Rep ListDistributionConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDistributionConfigurationsResponse' 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:
--
-- 'requestId', 'listDistributionConfigurationsResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'distributionConfigurationSummaryList', 'listDistributionConfigurationsResponse_distributionConfigurationSummaryList' - The list of distributions.
--
-- 'nextToken', 'listDistributionConfigurationsResponse_nextToken' - The next token used for paginated responses. When this is not empty,
-- there are additional elements that the service has not included in this
-- request. Use this token with the next request to retrieve additional
-- objects.
--
-- 'httpStatus', 'listDistributionConfigurationsResponse_httpStatus' - The response's http status code.
newListDistributionConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDistributionConfigurationsResponse
newListDistributionConfigurationsResponse :: Int -> ListDistributionConfigurationsResponse
newListDistributionConfigurationsResponse
  Int
pHttpStatus_ =
    ListDistributionConfigurationsResponse' :: Maybe Text
-> Maybe [DistributionConfigurationSummary]
-> Maybe Text
-> Int
-> ListDistributionConfigurationsResponse
ListDistributionConfigurationsResponse'
      { $sel:requestId:ListDistributionConfigurationsResponse' :: Maybe Text
requestId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:distributionConfigurationSummaryList:ListDistributionConfigurationsResponse' :: Maybe [DistributionConfigurationSummary]
distributionConfigurationSummaryList =
          Maybe [DistributionConfigurationSummary]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListDistributionConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListDistributionConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The request ID that uniquely identifies this request.
listDistributionConfigurationsResponse_requestId :: Lens.Lens' ListDistributionConfigurationsResponse (Prelude.Maybe Prelude.Text)
listDistributionConfigurationsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListDistributionConfigurationsResponse
-> f ListDistributionConfigurationsResponse
listDistributionConfigurationsResponse_requestId = (ListDistributionConfigurationsResponse -> Maybe Text)
-> (ListDistributionConfigurationsResponse
    -> Maybe Text -> ListDistributionConfigurationsResponse)
-> Lens
     ListDistributionConfigurationsResponse
     ListDistributionConfigurationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionConfigurationsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListDistributionConfigurationsResponse' :: ListDistributionConfigurationsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListDistributionConfigurationsResponse
s@ListDistributionConfigurationsResponse' {} Maybe Text
a -> ListDistributionConfigurationsResponse
s {$sel:requestId:ListDistributionConfigurationsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListDistributionConfigurationsResponse)

-- | The list of distributions.
listDistributionConfigurationsResponse_distributionConfigurationSummaryList :: Lens.Lens' ListDistributionConfigurationsResponse (Prelude.Maybe [DistributionConfigurationSummary])
listDistributionConfigurationsResponse_distributionConfigurationSummaryList :: (Maybe [DistributionConfigurationSummary]
 -> f (Maybe [DistributionConfigurationSummary]))
-> ListDistributionConfigurationsResponse
-> f ListDistributionConfigurationsResponse
listDistributionConfigurationsResponse_distributionConfigurationSummaryList = (ListDistributionConfigurationsResponse
 -> Maybe [DistributionConfigurationSummary])
-> (ListDistributionConfigurationsResponse
    -> Maybe [DistributionConfigurationSummary]
    -> ListDistributionConfigurationsResponse)
-> Lens
     ListDistributionConfigurationsResponse
     ListDistributionConfigurationsResponse
     (Maybe [DistributionConfigurationSummary])
     (Maybe [DistributionConfigurationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionConfigurationsResponse' {Maybe [DistributionConfigurationSummary]
distributionConfigurationSummaryList :: Maybe [DistributionConfigurationSummary]
$sel:distributionConfigurationSummaryList:ListDistributionConfigurationsResponse' :: ListDistributionConfigurationsResponse
-> Maybe [DistributionConfigurationSummary]
distributionConfigurationSummaryList} -> Maybe [DistributionConfigurationSummary]
distributionConfigurationSummaryList) (\s :: ListDistributionConfigurationsResponse
s@ListDistributionConfigurationsResponse' {} Maybe [DistributionConfigurationSummary]
a -> ListDistributionConfigurationsResponse
s {$sel:distributionConfigurationSummaryList:ListDistributionConfigurationsResponse' :: Maybe [DistributionConfigurationSummary]
distributionConfigurationSummaryList = Maybe [DistributionConfigurationSummary]
a} :: ListDistributionConfigurationsResponse) ((Maybe [DistributionConfigurationSummary]
  -> f (Maybe [DistributionConfigurationSummary]))
 -> ListDistributionConfigurationsResponse
 -> f ListDistributionConfigurationsResponse)
-> ((Maybe [DistributionConfigurationSummary]
     -> f (Maybe [DistributionConfigurationSummary]))
    -> Maybe [DistributionConfigurationSummary]
    -> f (Maybe [DistributionConfigurationSummary]))
-> (Maybe [DistributionConfigurationSummary]
    -> f (Maybe [DistributionConfigurationSummary]))
-> ListDistributionConfigurationsResponse
-> f ListDistributionConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DistributionConfigurationSummary]
  [DistributionConfigurationSummary]
  [DistributionConfigurationSummary]
  [DistributionConfigurationSummary]
-> Iso
     (Maybe [DistributionConfigurationSummary])
     (Maybe [DistributionConfigurationSummary])
     (Maybe [DistributionConfigurationSummary])
     (Maybe [DistributionConfigurationSummary])
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
  [DistributionConfigurationSummary]
  [DistributionConfigurationSummary]
  [DistributionConfigurationSummary]
  [DistributionConfigurationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The next token used for paginated responses. When this is not empty,
-- there are additional elements that the service has not included in this
-- request. Use this token with the next request to retrieve additional
-- objects.
listDistributionConfigurationsResponse_nextToken :: Lens.Lens' ListDistributionConfigurationsResponse (Prelude.Maybe Prelude.Text)
listDistributionConfigurationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDistributionConfigurationsResponse
-> f ListDistributionConfigurationsResponse
listDistributionConfigurationsResponse_nextToken = (ListDistributionConfigurationsResponse -> Maybe Text)
-> (ListDistributionConfigurationsResponse
    -> Maybe Text -> ListDistributionConfigurationsResponse)
-> Lens
     ListDistributionConfigurationsResponse
     ListDistributionConfigurationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDistributionConfigurationsResponse' :: ListDistributionConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDistributionConfigurationsResponse
s@ListDistributionConfigurationsResponse' {} Maybe Text
a -> ListDistributionConfigurationsResponse
s {$sel:nextToken:ListDistributionConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDistributionConfigurationsResponse)

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

instance
  Prelude.NFData
    ListDistributionConfigurationsResponse