{-# 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.Amplify.ListDomainAssociations
-- 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 the domain associations for an Amplify app.
--
-- This operation returns paginated results.
module Amazonka.Amplify.ListDomainAssociations
  ( -- * Creating a Request
    ListDomainAssociations (..),
    newListDomainAssociations,

    -- * Request Lenses
    listDomainAssociations_nextToken,
    listDomainAssociations_maxResults,
    listDomainAssociations_appId,

    -- * Destructuring the Response
    ListDomainAssociationsResponse (..),
    newListDomainAssociationsResponse,

    -- * Response Lenses
    listDomainAssociationsResponse_nextToken,
    listDomainAssociationsResponse_httpStatus,
    listDomainAssociationsResponse_domainAssociations,
  )
where

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

-- | The request structure for the list domain associations request.
--
-- /See:/ 'newListDomainAssociations' smart constructor.
data ListDomainAssociations = ListDomainAssociations'
  { -- | A pagination token. Set to null to start listing apps from the start. If
    -- non-null, a pagination token is returned in a result. Pass its value in
    -- here to list more projects.
    ListDomainAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to list in a single response.
    ListDomainAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique ID for an Amplify app.
    ListDomainAssociations -> Text
appId :: Prelude.Text
  }
  deriving (ListDomainAssociations -> ListDomainAssociations -> Bool
(ListDomainAssociations -> ListDomainAssociations -> Bool)
-> (ListDomainAssociations -> ListDomainAssociations -> Bool)
-> Eq ListDomainAssociations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainAssociations -> ListDomainAssociations -> Bool
$c/= :: ListDomainAssociations -> ListDomainAssociations -> Bool
== :: ListDomainAssociations -> ListDomainAssociations -> Bool
$c== :: ListDomainAssociations -> ListDomainAssociations -> Bool
Prelude.Eq, ReadPrec [ListDomainAssociations]
ReadPrec ListDomainAssociations
Int -> ReadS ListDomainAssociations
ReadS [ListDomainAssociations]
(Int -> ReadS ListDomainAssociations)
-> ReadS [ListDomainAssociations]
-> ReadPrec ListDomainAssociations
-> ReadPrec [ListDomainAssociations]
-> Read ListDomainAssociations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainAssociations]
$creadListPrec :: ReadPrec [ListDomainAssociations]
readPrec :: ReadPrec ListDomainAssociations
$creadPrec :: ReadPrec ListDomainAssociations
readList :: ReadS [ListDomainAssociations]
$creadList :: ReadS [ListDomainAssociations]
readsPrec :: Int -> ReadS ListDomainAssociations
$creadsPrec :: Int -> ReadS ListDomainAssociations
Prelude.Read, Int -> ListDomainAssociations -> ShowS
[ListDomainAssociations] -> ShowS
ListDomainAssociations -> String
(Int -> ListDomainAssociations -> ShowS)
-> (ListDomainAssociations -> String)
-> ([ListDomainAssociations] -> ShowS)
-> Show ListDomainAssociations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainAssociations] -> ShowS
$cshowList :: [ListDomainAssociations] -> ShowS
show :: ListDomainAssociations -> String
$cshow :: ListDomainAssociations -> String
showsPrec :: Int -> ListDomainAssociations -> ShowS
$cshowsPrec :: Int -> ListDomainAssociations -> ShowS
Prelude.Show, (forall x. ListDomainAssociations -> Rep ListDomainAssociations x)
-> (forall x.
    Rep ListDomainAssociations x -> ListDomainAssociations)
-> Generic ListDomainAssociations
forall x. Rep ListDomainAssociations x -> ListDomainAssociations
forall x. ListDomainAssociations -> Rep ListDomainAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDomainAssociations x -> ListDomainAssociations
$cfrom :: forall x. ListDomainAssociations -> Rep ListDomainAssociations x
Prelude.Generic)

-- |
-- Create a value of 'ListDomainAssociations' 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', 'listDomainAssociations_nextToken' - A pagination token. Set to null to start listing apps from the start. If
-- non-null, a pagination token is returned in a result. Pass its value in
-- here to list more projects.
--
-- 'maxResults', 'listDomainAssociations_maxResults' - The maximum number of records to list in a single response.
--
-- 'appId', 'listDomainAssociations_appId' - The unique ID for an Amplify app.
newListDomainAssociations ::
  -- | 'appId'
  Prelude.Text ->
  ListDomainAssociations
newListDomainAssociations :: Text -> ListDomainAssociations
newListDomainAssociations Text
pAppId_ =
  ListDomainAssociations' :: Maybe Text -> Maybe Natural -> Text -> ListDomainAssociations
ListDomainAssociations'
    { $sel:nextToken:ListDomainAssociations' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDomainAssociations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:ListDomainAssociations' :: Text
appId = Text
pAppId_
    }

-- | A pagination token. Set to null to start listing apps from the start. If
-- non-null, a pagination token is returned in a result. Pass its value in
-- here to list more projects.
listDomainAssociations_nextToken :: Lens.Lens' ListDomainAssociations (Prelude.Maybe Prelude.Text)
listDomainAssociations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDomainAssociations -> f ListDomainAssociations
listDomainAssociations_nextToken = (ListDomainAssociations -> Maybe Text)
-> (ListDomainAssociations -> Maybe Text -> ListDomainAssociations)
-> Lens
     ListDomainAssociations
     ListDomainAssociations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDomainAssociations' :: ListDomainAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDomainAssociations
s@ListDomainAssociations' {} Maybe Text
a -> ListDomainAssociations
s {$sel:nextToken:ListDomainAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: ListDomainAssociations)

-- | The maximum number of records to list in a single response.
listDomainAssociations_maxResults :: Lens.Lens' ListDomainAssociations (Prelude.Maybe Prelude.Natural)
listDomainAssociations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDomainAssociations -> f ListDomainAssociations
listDomainAssociations_maxResults = (ListDomainAssociations -> Maybe Natural)
-> (ListDomainAssociations
    -> Maybe Natural -> ListDomainAssociations)
-> Lens
     ListDomainAssociations
     ListDomainAssociations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDomainAssociations' :: ListDomainAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDomainAssociations
s@ListDomainAssociations' {} Maybe Natural
a -> ListDomainAssociations
s {$sel:maxResults:ListDomainAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDomainAssociations)

-- | The unique ID for an Amplify app.
listDomainAssociations_appId :: Lens.Lens' ListDomainAssociations Prelude.Text
listDomainAssociations_appId :: (Text -> f Text)
-> ListDomainAssociations -> f ListDomainAssociations
listDomainAssociations_appId = (ListDomainAssociations -> Text)
-> (ListDomainAssociations -> Text -> ListDomainAssociations)
-> Lens ListDomainAssociations ListDomainAssociations Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociations' {Text
appId :: Text
$sel:appId:ListDomainAssociations' :: ListDomainAssociations -> Text
appId} -> Text
appId) (\s :: ListDomainAssociations
s@ListDomainAssociations' {} Text
a -> ListDomainAssociations
s {$sel:appId:ListDomainAssociations' :: Text
appId = Text
a} :: ListDomainAssociations)

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

instance Prelude.Hashable ListDomainAssociations

instance Prelude.NFData ListDomainAssociations

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

instance Core.ToQuery ListDomainAssociations where
  toQuery :: ListDomainAssociations -> QueryString
toQuery ListDomainAssociations' {Maybe Natural
Maybe Text
Text
appId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:appId:ListDomainAssociations' :: ListDomainAssociations -> Text
$sel:maxResults:ListDomainAssociations' :: ListDomainAssociations -> Maybe Natural
$sel:nextToken:ListDomainAssociations' :: ListDomainAssociations -> 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
      ]

-- | The result structure for the list domain association request.
--
-- /See:/ 'newListDomainAssociationsResponse' smart constructor.
data ListDomainAssociationsResponse = ListDomainAssociationsResponse'
  { -- | A pagination token. If non-null, a pagination token is returned in a
    -- result. Pass its value in another request to retrieve more entries.
    ListDomainAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDomainAssociationsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of domain associations.
    ListDomainAssociationsResponse -> [DomainAssociation]
domainAssociations :: [DomainAssociation]
  }
  deriving (ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
(ListDomainAssociationsResponse
 -> ListDomainAssociationsResponse -> Bool)
-> (ListDomainAssociationsResponse
    -> ListDomainAssociationsResponse -> Bool)
-> Eq ListDomainAssociationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
$c/= :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
== :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
$c== :: ListDomainAssociationsResponse
-> ListDomainAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [ListDomainAssociationsResponse]
ReadPrec ListDomainAssociationsResponse
Int -> ReadS ListDomainAssociationsResponse
ReadS [ListDomainAssociationsResponse]
(Int -> ReadS ListDomainAssociationsResponse)
-> ReadS [ListDomainAssociationsResponse]
-> ReadPrec ListDomainAssociationsResponse
-> ReadPrec [ListDomainAssociationsResponse]
-> Read ListDomainAssociationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainAssociationsResponse]
$creadListPrec :: ReadPrec [ListDomainAssociationsResponse]
readPrec :: ReadPrec ListDomainAssociationsResponse
$creadPrec :: ReadPrec ListDomainAssociationsResponse
readList :: ReadS [ListDomainAssociationsResponse]
$creadList :: ReadS [ListDomainAssociationsResponse]
readsPrec :: Int -> ReadS ListDomainAssociationsResponse
$creadsPrec :: Int -> ReadS ListDomainAssociationsResponse
Prelude.Read, Int -> ListDomainAssociationsResponse -> ShowS
[ListDomainAssociationsResponse] -> ShowS
ListDomainAssociationsResponse -> String
(Int -> ListDomainAssociationsResponse -> ShowS)
-> (ListDomainAssociationsResponse -> String)
-> ([ListDomainAssociationsResponse] -> ShowS)
-> Show ListDomainAssociationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainAssociationsResponse] -> ShowS
$cshowList :: [ListDomainAssociationsResponse] -> ShowS
show :: ListDomainAssociationsResponse -> String
$cshow :: ListDomainAssociationsResponse -> String
showsPrec :: Int -> ListDomainAssociationsResponse -> ShowS
$cshowsPrec :: Int -> ListDomainAssociationsResponse -> ShowS
Prelude.Show, (forall x.
 ListDomainAssociationsResponse
 -> Rep ListDomainAssociationsResponse x)
-> (forall x.
    Rep ListDomainAssociationsResponse x
    -> ListDomainAssociationsResponse)
-> Generic ListDomainAssociationsResponse
forall x.
Rep ListDomainAssociationsResponse x
-> ListDomainAssociationsResponse
forall x.
ListDomainAssociationsResponse
-> Rep ListDomainAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDomainAssociationsResponse x
-> ListDomainAssociationsResponse
$cfrom :: forall x.
ListDomainAssociationsResponse
-> Rep ListDomainAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDomainAssociationsResponse' 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', 'listDomainAssociationsResponse_nextToken' - A pagination token. If non-null, a pagination token is returned in a
-- result. Pass its value in another request to retrieve more entries.
--
-- 'httpStatus', 'listDomainAssociationsResponse_httpStatus' - The response's http status code.
--
-- 'domainAssociations', 'listDomainAssociationsResponse_domainAssociations' - A list of domain associations.
newListDomainAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDomainAssociationsResponse
newListDomainAssociationsResponse :: Int -> ListDomainAssociationsResponse
newListDomainAssociationsResponse Int
pHttpStatus_ =
  ListDomainAssociationsResponse' :: Maybe Text
-> Int -> [DomainAssociation] -> ListDomainAssociationsResponse
ListDomainAssociationsResponse'
    { $sel:nextToken:ListDomainAssociationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDomainAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:domainAssociations:ListDomainAssociationsResponse' :: [DomainAssociation]
domainAssociations = [DomainAssociation]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A pagination token. If non-null, a pagination token is returned in a
-- result. Pass its value in another request to retrieve more entries.
listDomainAssociationsResponse_nextToken :: Lens.Lens' ListDomainAssociationsResponse (Prelude.Maybe Prelude.Text)
listDomainAssociationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDomainAssociationsResponse
-> f ListDomainAssociationsResponse
listDomainAssociationsResponse_nextToken = (ListDomainAssociationsResponse -> Maybe Text)
-> (ListDomainAssociationsResponse
    -> Maybe Text -> ListDomainAssociationsResponse)
-> Lens' ListDomainAssociationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDomainAssociationsResponse
s@ListDomainAssociationsResponse' {} Maybe Text
a -> ListDomainAssociationsResponse
s {$sel:nextToken:ListDomainAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDomainAssociationsResponse)

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

-- | A list of domain associations.
listDomainAssociationsResponse_domainAssociations :: Lens.Lens' ListDomainAssociationsResponse [DomainAssociation]
listDomainAssociationsResponse_domainAssociations :: ([DomainAssociation] -> f [DomainAssociation])
-> ListDomainAssociationsResponse
-> f ListDomainAssociationsResponse
listDomainAssociationsResponse_domainAssociations = (ListDomainAssociationsResponse -> [DomainAssociation])
-> (ListDomainAssociationsResponse
    -> [DomainAssociation] -> ListDomainAssociationsResponse)
-> Lens' ListDomainAssociationsResponse [DomainAssociation]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainAssociationsResponse' {[DomainAssociation]
domainAssociations :: [DomainAssociation]
$sel:domainAssociations:ListDomainAssociationsResponse' :: ListDomainAssociationsResponse -> [DomainAssociation]
domainAssociations} -> [DomainAssociation]
domainAssociations) (\s :: ListDomainAssociationsResponse
s@ListDomainAssociationsResponse' {} [DomainAssociation]
a -> ListDomainAssociationsResponse
s {$sel:domainAssociations:ListDomainAssociationsResponse' :: [DomainAssociation]
domainAssociations = [DomainAssociation]
a} :: ListDomainAssociationsResponse) (([DomainAssociation] -> f [DomainAssociation])
 -> ListDomainAssociationsResponse
 -> f ListDomainAssociationsResponse)
-> (([DomainAssociation] -> f [DomainAssociation])
    -> [DomainAssociation] -> f [DomainAssociation])
-> ([DomainAssociation] -> f [DomainAssociation])
-> ListDomainAssociationsResponse
-> f ListDomainAssociationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DomainAssociation] -> f [DomainAssociation])
-> [DomainAssociation] -> f [DomainAssociation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListDomainAssociationsResponse