{-# 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.MediaPackageVOD.ListPackagingGroups
-- 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 collection of MediaPackage VOD PackagingGroup resources.
--
-- This operation returns paginated results.
module Amazonka.MediaPackageVOD.ListPackagingGroups
  ( -- * Creating a Request
    ListPackagingGroups (..),
    newListPackagingGroups,

    -- * Request Lenses
    listPackagingGroups_nextToken,
    listPackagingGroups_maxResults,

    -- * Destructuring the Response
    ListPackagingGroupsResponse (..),
    newListPackagingGroupsResponse,

    -- * Response Lenses
    listPackagingGroupsResponse_packagingGroups,
    listPackagingGroupsResponse_nextToken,
    listPackagingGroupsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListPackagingGroups' smart constructor.
data ListPackagingGroups = ListPackagingGroups'
  { -- | A token used to resume pagination from the end of a previous request.
    ListPackagingGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Upper bound on number of records to return.
    ListPackagingGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPackagingGroups -> ListPackagingGroups -> Bool
(ListPackagingGroups -> ListPackagingGroups -> Bool)
-> (ListPackagingGroups -> ListPackagingGroups -> Bool)
-> Eq ListPackagingGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackagingGroups -> ListPackagingGroups -> Bool
$c/= :: ListPackagingGroups -> ListPackagingGroups -> Bool
== :: ListPackagingGroups -> ListPackagingGroups -> Bool
$c== :: ListPackagingGroups -> ListPackagingGroups -> Bool
Prelude.Eq, ReadPrec [ListPackagingGroups]
ReadPrec ListPackagingGroups
Int -> ReadS ListPackagingGroups
ReadS [ListPackagingGroups]
(Int -> ReadS ListPackagingGroups)
-> ReadS [ListPackagingGroups]
-> ReadPrec ListPackagingGroups
-> ReadPrec [ListPackagingGroups]
-> Read ListPackagingGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackagingGroups]
$creadListPrec :: ReadPrec [ListPackagingGroups]
readPrec :: ReadPrec ListPackagingGroups
$creadPrec :: ReadPrec ListPackagingGroups
readList :: ReadS [ListPackagingGroups]
$creadList :: ReadS [ListPackagingGroups]
readsPrec :: Int -> ReadS ListPackagingGroups
$creadsPrec :: Int -> ReadS ListPackagingGroups
Prelude.Read, Int -> ListPackagingGroups -> ShowS
[ListPackagingGroups] -> ShowS
ListPackagingGroups -> String
(Int -> ListPackagingGroups -> ShowS)
-> (ListPackagingGroups -> String)
-> ([ListPackagingGroups] -> ShowS)
-> Show ListPackagingGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackagingGroups] -> ShowS
$cshowList :: [ListPackagingGroups] -> ShowS
show :: ListPackagingGroups -> String
$cshow :: ListPackagingGroups -> String
showsPrec :: Int -> ListPackagingGroups -> ShowS
$cshowsPrec :: Int -> ListPackagingGroups -> ShowS
Prelude.Show, (forall x. ListPackagingGroups -> Rep ListPackagingGroups x)
-> (forall x. Rep ListPackagingGroups x -> ListPackagingGroups)
-> Generic ListPackagingGroups
forall x. Rep ListPackagingGroups x -> ListPackagingGroups
forall x. ListPackagingGroups -> Rep ListPackagingGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPackagingGroups x -> ListPackagingGroups
$cfrom :: forall x. ListPackagingGroups -> Rep ListPackagingGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListPackagingGroups' 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', 'listPackagingGroups_nextToken' - A token used to resume pagination from the end of a previous request.
--
-- 'maxResults', 'listPackagingGroups_maxResults' - Upper bound on number of records to return.
newListPackagingGroups ::
  ListPackagingGroups
newListPackagingGroups :: ListPackagingGroups
newListPackagingGroups =
  ListPackagingGroups' :: Maybe Text -> Maybe Natural -> ListPackagingGroups
ListPackagingGroups'
    { $sel:nextToken:ListPackagingGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPackagingGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token used to resume pagination from the end of a previous request.
listPackagingGroups_nextToken :: Lens.Lens' ListPackagingGroups (Prelude.Maybe Prelude.Text)
listPackagingGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPackagingGroups -> f ListPackagingGroups
listPackagingGroups_nextToken = (ListPackagingGroups -> Maybe Text)
-> (ListPackagingGroups -> Maybe Text -> ListPackagingGroups)
-> Lens
     ListPackagingGroups ListPackagingGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackagingGroups' :: ListPackagingGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackagingGroups
s@ListPackagingGroups' {} Maybe Text
a -> ListPackagingGroups
s {$sel:nextToken:ListPackagingGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackagingGroups)

-- | Upper bound on number of records to return.
listPackagingGroups_maxResults :: Lens.Lens' ListPackagingGroups (Prelude.Maybe Prelude.Natural)
listPackagingGroups_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPackagingGroups -> f ListPackagingGroups
listPackagingGroups_maxResults = (ListPackagingGroups -> Maybe Natural)
-> (ListPackagingGroups -> Maybe Natural -> ListPackagingGroups)
-> Lens
     ListPackagingGroups
     ListPackagingGroups
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPackagingGroups' :: ListPackagingGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPackagingGroups
s@ListPackagingGroups' {} Maybe Natural
a -> ListPackagingGroups
s {$sel:maxResults:ListPackagingGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPackagingGroups)

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

instance Prelude.NFData ListPackagingGroups

instance Core.ToHeaders ListPackagingGroups where
  toHeaders :: ListPackagingGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPackagingGroups -> 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 ListPackagingGroups where
  toPath :: ListPackagingGroups -> ByteString
toPath = ByteString -> ListPackagingGroups -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/packaging_groups"

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

-- | /See:/ 'newListPackagingGroupsResponse' smart constructor.
data ListPackagingGroupsResponse = ListPackagingGroupsResponse'
  { -- | A list of MediaPackage VOD PackagingGroup resources.
    ListPackagingGroupsResponse -> Maybe [PackagingGroup]
packagingGroups :: Prelude.Maybe [PackagingGroup],
    -- | A token that can be used to resume pagination from the end of the
    -- collection.
    ListPackagingGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPackagingGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
(ListPackagingGroupsResponse
 -> ListPackagingGroupsResponse -> Bool)
-> (ListPackagingGroupsResponse
    -> ListPackagingGroupsResponse -> Bool)
-> Eq ListPackagingGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
$c/= :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
== :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
$c== :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListPackagingGroupsResponse]
ReadPrec ListPackagingGroupsResponse
Int -> ReadS ListPackagingGroupsResponse
ReadS [ListPackagingGroupsResponse]
(Int -> ReadS ListPackagingGroupsResponse)
-> ReadS [ListPackagingGroupsResponse]
-> ReadPrec ListPackagingGroupsResponse
-> ReadPrec [ListPackagingGroupsResponse]
-> Read ListPackagingGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackagingGroupsResponse]
$creadListPrec :: ReadPrec [ListPackagingGroupsResponse]
readPrec :: ReadPrec ListPackagingGroupsResponse
$creadPrec :: ReadPrec ListPackagingGroupsResponse
readList :: ReadS [ListPackagingGroupsResponse]
$creadList :: ReadS [ListPackagingGroupsResponse]
readsPrec :: Int -> ReadS ListPackagingGroupsResponse
$creadsPrec :: Int -> ReadS ListPackagingGroupsResponse
Prelude.Read, Int -> ListPackagingGroupsResponse -> ShowS
[ListPackagingGroupsResponse] -> ShowS
ListPackagingGroupsResponse -> String
(Int -> ListPackagingGroupsResponse -> ShowS)
-> (ListPackagingGroupsResponse -> String)
-> ([ListPackagingGroupsResponse] -> ShowS)
-> Show ListPackagingGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackagingGroupsResponse] -> ShowS
$cshowList :: [ListPackagingGroupsResponse] -> ShowS
show :: ListPackagingGroupsResponse -> String
$cshow :: ListPackagingGroupsResponse -> String
showsPrec :: Int -> ListPackagingGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListPackagingGroupsResponse -> ShowS
Prelude.Show, (forall x.
 ListPackagingGroupsResponse -> Rep ListPackagingGroupsResponse x)
-> (forall x.
    Rep ListPackagingGroupsResponse x -> ListPackagingGroupsResponse)
-> Generic ListPackagingGroupsResponse
forall x.
Rep ListPackagingGroupsResponse x -> ListPackagingGroupsResponse
forall x.
ListPackagingGroupsResponse -> Rep ListPackagingGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPackagingGroupsResponse x -> ListPackagingGroupsResponse
$cfrom :: forall x.
ListPackagingGroupsResponse -> Rep ListPackagingGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPackagingGroupsResponse' 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:
--
-- 'packagingGroups', 'listPackagingGroupsResponse_packagingGroups' - A list of MediaPackage VOD PackagingGroup resources.
--
-- 'nextToken', 'listPackagingGroupsResponse_nextToken' - A token that can be used to resume pagination from the end of the
-- collection.
--
-- 'httpStatus', 'listPackagingGroupsResponse_httpStatus' - The response's http status code.
newListPackagingGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPackagingGroupsResponse
newListPackagingGroupsResponse :: Int -> ListPackagingGroupsResponse
newListPackagingGroupsResponse Int
pHttpStatus_ =
  ListPackagingGroupsResponse' :: Maybe [PackagingGroup]
-> Maybe Text -> Int -> ListPackagingGroupsResponse
ListPackagingGroupsResponse'
    { $sel:packagingGroups:ListPackagingGroupsResponse' :: Maybe [PackagingGroup]
packagingGroups =
        Maybe [PackagingGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPackagingGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPackagingGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of MediaPackage VOD PackagingGroup resources.
listPackagingGroupsResponse_packagingGroups :: Lens.Lens' ListPackagingGroupsResponse (Prelude.Maybe [PackagingGroup])
listPackagingGroupsResponse_packagingGroups :: (Maybe [PackagingGroup] -> f (Maybe [PackagingGroup]))
-> ListPackagingGroupsResponse -> f ListPackagingGroupsResponse
listPackagingGroupsResponse_packagingGroups = (ListPackagingGroupsResponse -> Maybe [PackagingGroup])
-> (ListPackagingGroupsResponse
    -> Maybe [PackagingGroup] -> ListPackagingGroupsResponse)
-> Lens' ListPackagingGroupsResponse (Maybe [PackagingGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroupsResponse' {Maybe [PackagingGroup]
packagingGroups :: Maybe [PackagingGroup]
$sel:packagingGroups:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> Maybe [PackagingGroup]
packagingGroups} -> Maybe [PackagingGroup]
packagingGroups) (\s :: ListPackagingGroupsResponse
s@ListPackagingGroupsResponse' {} Maybe [PackagingGroup]
a -> ListPackagingGroupsResponse
s {$sel:packagingGroups:ListPackagingGroupsResponse' :: Maybe [PackagingGroup]
packagingGroups = Maybe [PackagingGroup]
a} :: ListPackagingGroupsResponse) ((Maybe [PackagingGroup] -> f (Maybe [PackagingGroup]))
 -> ListPackagingGroupsResponse -> f ListPackagingGroupsResponse)
-> ((Maybe [PackagingGroup] -> f (Maybe [PackagingGroup]))
    -> Maybe [PackagingGroup] -> f (Maybe [PackagingGroup]))
-> (Maybe [PackagingGroup] -> f (Maybe [PackagingGroup]))
-> ListPackagingGroupsResponse
-> f ListPackagingGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PackagingGroup] [PackagingGroup] [PackagingGroup] [PackagingGroup]
-> Iso
     (Maybe [PackagingGroup])
     (Maybe [PackagingGroup])
     (Maybe [PackagingGroup])
     (Maybe [PackagingGroup])
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
  [PackagingGroup] [PackagingGroup] [PackagingGroup] [PackagingGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token that can be used to resume pagination from the end of the
-- collection.
listPackagingGroupsResponse_nextToken :: Lens.Lens' ListPackagingGroupsResponse (Prelude.Maybe Prelude.Text)
listPackagingGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPackagingGroupsResponse -> f ListPackagingGroupsResponse
listPackagingGroupsResponse_nextToken = (ListPackagingGroupsResponse -> Maybe Text)
-> (ListPackagingGroupsResponse
    -> Maybe Text -> ListPackagingGroupsResponse)
-> Lens' ListPackagingGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackagingGroupsResponse
s@ListPackagingGroupsResponse' {} Maybe Text
a -> ListPackagingGroupsResponse
s {$sel:nextToken:ListPackagingGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackagingGroupsResponse)

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

instance Prelude.NFData ListPackagingGroupsResponse