{-# 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.CodeGuruReviewer.ListRepositoryAssociations
-- 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
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html RepositoryAssociationSummary>
-- objects that contain summary information about a repository association.
-- You can filter the returned list by
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-ProviderType ProviderType>
-- ,
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Name Name>
-- ,
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-State State>
-- , and
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Owner Owner>
-- .
--
-- This operation returns paginated results.
module Amazonka.CodeGuruReviewer.ListRepositoryAssociations
  ( -- * Creating a Request
    ListRepositoryAssociations (..),
    newListRepositoryAssociations,

    -- * Request Lenses
    listRepositoryAssociations_states,
    listRepositoryAssociations_owners,
    listRepositoryAssociations_providerTypes,
    listRepositoryAssociations_nextToken,
    listRepositoryAssociations_names,
    listRepositoryAssociations_maxResults,

    -- * Destructuring the Response
    ListRepositoryAssociationsResponse (..),
    newListRepositoryAssociationsResponse,

    -- * Response Lenses
    listRepositoryAssociationsResponse_nextToken,
    listRepositoryAssociationsResponse_repositoryAssociationSummaries,
    listRepositoryAssociationsResponse_httpStatus,
  )
where

import Amazonka.CodeGuruReviewer.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:/ 'newListRepositoryAssociations' smart constructor.
data ListRepositoryAssociations = ListRepositoryAssociations'
  { -- | List of repository association states to use as a filter.
    --
    -- The valid repository association states are:
    --
    -- -   __Associated__: The repository association is complete.
    --
    -- -   __Associating__: CodeGuru Reviewer is:
    --
    --     -   Setting up pull request notifications. This is required for pull
    --         requests to trigger a CodeGuru Reviewer review.
    --
    --         If your repository @ProviderType@ is @GitHub@,
    --         @GitHub Enterprise Server@, or @Bitbucket@, CodeGuru Reviewer
    --         creates webhooks in your repository to trigger CodeGuru Reviewer
    --         reviews. If you delete these webhooks, reviews of code in your
    --         repository cannot be triggered.
    --
    --     -   Setting up source code access. This is required for CodeGuru
    --         Reviewer to securely clone code in your repository.
    --
    -- -   __Failed__: The repository failed to associate or disassociate.
    --
    -- -   __Disassociating__: CodeGuru Reviewer is removing the repository\'s
    --     pull request notifications and source code access.
    --
    -- -   __Disassociated__: CodeGuru Reviewer successfully disassociated the
    --     repository. You can create a new association with this repository if
    --     you want to review source code in it later. You can control access
    --     to code reviews created in an associated repository with tags after
    --     it has been disassociated. For more information, see
    --     <https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html Using tags to control access to associated repositories>
    --     in the /Amazon CodeGuru Reviewer User Guide/.
    ListRepositoryAssociations
-> Maybe (NonEmpty RepositoryAssociationState)
states :: Prelude.Maybe (Prelude.NonEmpty RepositoryAssociationState),
    -- | List of owners to use as a filter. For Amazon Web Services CodeCommit,
    -- it is the name of the CodeCommit account that was used to associate the
    -- repository. For other repository source providers, such as Bitbucket and
    -- GitHub Enterprise Server, this is name of the account that was used to
    -- associate the repository.
    ListRepositoryAssociations -> Maybe (NonEmpty Text)
owners :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | List of provider types to use as a filter.
    ListRepositoryAssociations -> Maybe (NonEmpty ProviderType)
providerTypes :: Prelude.Maybe (Prelude.NonEmpty ProviderType),
    -- | The @nextToken@ value returned from a previous paginated
    -- @ListRepositoryAssociations@ request where @maxResults@ was used and the
    -- results exceeded the value of that parameter. Pagination continues from
    -- the end of the previous results that returned the @nextToken@ value.
    --
    -- Treat this token as an opaque identifier that is only used to retrieve
    -- the next items in a list and not for other programmatic purposes.
    ListRepositoryAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of repository names to use as a filter.
    ListRepositoryAssociations -> Maybe (NonEmpty Text)
names :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The maximum number of repository association results returned by
    -- @ListRepositoryAssociations@ in paginated output. When this parameter is
    -- used, @ListRepositoryAssociations@ only returns @maxResults@ results in
    -- a single page with a @nextToken@ response element. The remaining results
    -- of the initial request can be seen by sending another
    -- @ListRepositoryAssociations@ request with the returned @nextToken@
    -- value. This value can be between 1 and 100. If this parameter is not
    -- used, @ListRepositoryAssociations@ returns up to 100 results and a
    -- @nextToken@ value if applicable.
    ListRepositoryAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListRepositoryAssociations -> ListRepositoryAssociations -> Bool
(ListRepositoryAssociations -> ListRepositoryAssociations -> Bool)
-> (ListRepositoryAssociations
    -> ListRepositoryAssociations -> Bool)
-> Eq ListRepositoryAssociations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRepositoryAssociations -> ListRepositoryAssociations -> Bool
$c/= :: ListRepositoryAssociations -> ListRepositoryAssociations -> Bool
== :: ListRepositoryAssociations -> ListRepositoryAssociations -> Bool
$c== :: ListRepositoryAssociations -> ListRepositoryAssociations -> Bool
Prelude.Eq, ReadPrec [ListRepositoryAssociations]
ReadPrec ListRepositoryAssociations
Int -> ReadS ListRepositoryAssociations
ReadS [ListRepositoryAssociations]
(Int -> ReadS ListRepositoryAssociations)
-> ReadS [ListRepositoryAssociations]
-> ReadPrec ListRepositoryAssociations
-> ReadPrec [ListRepositoryAssociations]
-> Read ListRepositoryAssociations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRepositoryAssociations]
$creadListPrec :: ReadPrec [ListRepositoryAssociations]
readPrec :: ReadPrec ListRepositoryAssociations
$creadPrec :: ReadPrec ListRepositoryAssociations
readList :: ReadS [ListRepositoryAssociations]
$creadList :: ReadS [ListRepositoryAssociations]
readsPrec :: Int -> ReadS ListRepositoryAssociations
$creadsPrec :: Int -> ReadS ListRepositoryAssociations
Prelude.Read, Int -> ListRepositoryAssociations -> ShowS
[ListRepositoryAssociations] -> ShowS
ListRepositoryAssociations -> String
(Int -> ListRepositoryAssociations -> ShowS)
-> (ListRepositoryAssociations -> String)
-> ([ListRepositoryAssociations] -> ShowS)
-> Show ListRepositoryAssociations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRepositoryAssociations] -> ShowS
$cshowList :: [ListRepositoryAssociations] -> ShowS
show :: ListRepositoryAssociations -> String
$cshow :: ListRepositoryAssociations -> String
showsPrec :: Int -> ListRepositoryAssociations -> ShowS
$cshowsPrec :: Int -> ListRepositoryAssociations -> ShowS
Prelude.Show, (forall x.
 ListRepositoryAssociations -> Rep ListRepositoryAssociations x)
-> (forall x.
    Rep ListRepositoryAssociations x -> ListRepositoryAssociations)
-> Generic ListRepositoryAssociations
forall x.
Rep ListRepositoryAssociations x -> ListRepositoryAssociations
forall x.
ListRepositoryAssociations -> Rep ListRepositoryAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRepositoryAssociations x -> ListRepositoryAssociations
$cfrom :: forall x.
ListRepositoryAssociations -> Rep ListRepositoryAssociations x
Prelude.Generic)

-- |
-- Create a value of 'ListRepositoryAssociations' 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:
--
-- 'states', 'listRepositoryAssociations_states' - List of repository association states to use as a filter.
--
-- The valid repository association states are:
--
-- -   __Associated__: The repository association is complete.
--
-- -   __Associating__: CodeGuru Reviewer is:
--
--     -   Setting up pull request notifications. This is required for pull
--         requests to trigger a CodeGuru Reviewer review.
--
--         If your repository @ProviderType@ is @GitHub@,
--         @GitHub Enterprise Server@, or @Bitbucket@, CodeGuru Reviewer
--         creates webhooks in your repository to trigger CodeGuru Reviewer
--         reviews. If you delete these webhooks, reviews of code in your
--         repository cannot be triggered.
--
--     -   Setting up source code access. This is required for CodeGuru
--         Reviewer to securely clone code in your repository.
--
-- -   __Failed__: The repository failed to associate or disassociate.
--
-- -   __Disassociating__: CodeGuru Reviewer is removing the repository\'s
--     pull request notifications and source code access.
--
-- -   __Disassociated__: CodeGuru Reviewer successfully disassociated the
--     repository. You can create a new association with this repository if
--     you want to review source code in it later. You can control access
--     to code reviews created in an associated repository with tags after
--     it has been disassociated. For more information, see
--     <https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html Using tags to control access to associated repositories>
--     in the /Amazon CodeGuru Reviewer User Guide/.
--
-- 'owners', 'listRepositoryAssociations_owners' - List of owners to use as a filter. For Amazon Web Services CodeCommit,
-- it is the name of the CodeCommit account that was used to associate the
-- repository. For other repository source providers, such as Bitbucket and
-- GitHub Enterprise Server, this is name of the account that was used to
-- associate the repository.
--
-- 'providerTypes', 'listRepositoryAssociations_providerTypes' - List of provider types to use as a filter.
--
-- 'nextToken', 'listRepositoryAssociations_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListRepositoryAssociations@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- Treat this token as an opaque identifier that is only used to retrieve
-- the next items in a list and not for other programmatic purposes.
--
-- 'names', 'listRepositoryAssociations_names' - List of repository names to use as a filter.
--
-- 'maxResults', 'listRepositoryAssociations_maxResults' - The maximum number of repository association results returned by
-- @ListRepositoryAssociations@ in paginated output. When this parameter is
-- used, @ListRepositoryAssociations@ only returns @maxResults@ results in
-- a single page with a @nextToken@ response element. The remaining results
-- of the initial request can be seen by sending another
-- @ListRepositoryAssociations@ request with the returned @nextToken@
-- value. This value can be between 1 and 100. If this parameter is not
-- used, @ListRepositoryAssociations@ returns up to 100 results and a
-- @nextToken@ value if applicable.
newListRepositoryAssociations ::
  ListRepositoryAssociations
newListRepositoryAssociations :: ListRepositoryAssociations
newListRepositoryAssociations =
  ListRepositoryAssociations' :: Maybe (NonEmpty RepositoryAssociationState)
-> Maybe (NonEmpty Text)
-> Maybe (NonEmpty ProviderType)
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Natural
-> ListRepositoryAssociations
ListRepositoryAssociations'
    { $sel:states:ListRepositoryAssociations' :: Maybe (NonEmpty RepositoryAssociationState)
states =
        Maybe (NonEmpty RepositoryAssociationState)
forall a. Maybe a
Prelude.Nothing,
      $sel:owners:ListRepositoryAssociations' :: Maybe (NonEmpty Text)
owners = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:providerTypes:ListRepositoryAssociations' :: Maybe (NonEmpty ProviderType)
providerTypes = Maybe (NonEmpty ProviderType)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRepositoryAssociations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:names:ListRepositoryAssociations' :: Maybe (NonEmpty Text)
names = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRepositoryAssociations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | List of repository association states to use as a filter.
--
-- The valid repository association states are:
--
-- -   __Associated__: The repository association is complete.
--
-- -   __Associating__: CodeGuru Reviewer is:
--
--     -   Setting up pull request notifications. This is required for pull
--         requests to trigger a CodeGuru Reviewer review.
--
--         If your repository @ProviderType@ is @GitHub@,
--         @GitHub Enterprise Server@, or @Bitbucket@, CodeGuru Reviewer
--         creates webhooks in your repository to trigger CodeGuru Reviewer
--         reviews. If you delete these webhooks, reviews of code in your
--         repository cannot be triggered.
--
--     -   Setting up source code access. This is required for CodeGuru
--         Reviewer to securely clone code in your repository.
--
-- -   __Failed__: The repository failed to associate or disassociate.
--
-- -   __Disassociating__: CodeGuru Reviewer is removing the repository\'s
--     pull request notifications and source code access.
--
-- -   __Disassociated__: CodeGuru Reviewer successfully disassociated the
--     repository. You can create a new association with this repository if
--     you want to review source code in it later. You can control access
--     to code reviews created in an associated repository with tags after
--     it has been disassociated. For more information, see
--     <https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html Using tags to control access to associated repositories>
--     in the /Amazon CodeGuru Reviewer User Guide/.
listRepositoryAssociations_states :: Lens.Lens' ListRepositoryAssociations (Prelude.Maybe (Prelude.NonEmpty RepositoryAssociationState))
listRepositoryAssociations_states :: (Maybe (NonEmpty RepositoryAssociationState)
 -> f (Maybe (NonEmpty RepositoryAssociationState)))
-> ListRepositoryAssociations -> f ListRepositoryAssociations
listRepositoryAssociations_states = (ListRepositoryAssociations
 -> Maybe (NonEmpty RepositoryAssociationState))
-> (ListRepositoryAssociations
    -> Maybe (NonEmpty RepositoryAssociationState)
    -> ListRepositoryAssociations)
-> Lens
     ListRepositoryAssociations
     ListRepositoryAssociations
     (Maybe (NonEmpty RepositoryAssociationState))
     (Maybe (NonEmpty RepositoryAssociationState))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociations' {Maybe (NonEmpty RepositoryAssociationState)
states :: Maybe (NonEmpty RepositoryAssociationState)
$sel:states:ListRepositoryAssociations' :: ListRepositoryAssociations
-> Maybe (NonEmpty RepositoryAssociationState)
states} -> Maybe (NonEmpty RepositoryAssociationState)
states) (\s :: ListRepositoryAssociations
s@ListRepositoryAssociations' {} Maybe (NonEmpty RepositoryAssociationState)
a -> ListRepositoryAssociations
s {$sel:states:ListRepositoryAssociations' :: Maybe (NonEmpty RepositoryAssociationState)
states = Maybe (NonEmpty RepositoryAssociationState)
a} :: ListRepositoryAssociations) ((Maybe (NonEmpty RepositoryAssociationState)
  -> f (Maybe (NonEmpty RepositoryAssociationState)))
 -> ListRepositoryAssociations -> f ListRepositoryAssociations)
-> ((Maybe (NonEmpty RepositoryAssociationState)
     -> f (Maybe (NonEmpty RepositoryAssociationState)))
    -> Maybe (NonEmpty RepositoryAssociationState)
    -> f (Maybe (NonEmpty RepositoryAssociationState)))
-> (Maybe (NonEmpty RepositoryAssociationState)
    -> f (Maybe (NonEmpty RepositoryAssociationState)))
-> ListRepositoryAssociations
-> f ListRepositoryAssociations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty RepositoryAssociationState)
  (NonEmpty RepositoryAssociationState)
  (NonEmpty RepositoryAssociationState)
  (NonEmpty RepositoryAssociationState)
-> Iso
     (Maybe (NonEmpty RepositoryAssociationState))
     (Maybe (NonEmpty RepositoryAssociationState))
     (Maybe (NonEmpty RepositoryAssociationState))
     (Maybe (NonEmpty RepositoryAssociationState))
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 RepositoryAssociationState)
  (NonEmpty RepositoryAssociationState)
  (NonEmpty RepositoryAssociationState)
  (NonEmpty RepositoryAssociationState)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | List of owners to use as a filter. For Amazon Web Services CodeCommit,
-- it is the name of the CodeCommit account that was used to associate the
-- repository. For other repository source providers, such as Bitbucket and
-- GitHub Enterprise Server, this is name of the account that was used to
-- associate the repository.
listRepositoryAssociations_owners :: Lens.Lens' ListRepositoryAssociations (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listRepositoryAssociations_owners :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRepositoryAssociations -> f ListRepositoryAssociations
listRepositoryAssociations_owners = (ListRepositoryAssociations -> Maybe (NonEmpty Text))
-> (ListRepositoryAssociations
    -> Maybe (NonEmpty Text) -> ListRepositoryAssociations)
-> Lens
     ListRepositoryAssociations
     ListRepositoryAssociations
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociations' {Maybe (NonEmpty Text)
owners :: Maybe (NonEmpty Text)
$sel:owners:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe (NonEmpty Text)
owners} -> Maybe (NonEmpty Text)
owners) (\s :: ListRepositoryAssociations
s@ListRepositoryAssociations' {} Maybe (NonEmpty Text)
a -> ListRepositoryAssociations
s {$sel:owners:ListRepositoryAssociations' :: Maybe (NonEmpty Text)
owners = Maybe (NonEmpty Text)
a} :: ListRepositoryAssociations) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListRepositoryAssociations -> f ListRepositoryAssociations)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRepositoryAssociations
-> f ListRepositoryAssociations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | List of provider types to use as a filter.
listRepositoryAssociations_providerTypes :: Lens.Lens' ListRepositoryAssociations (Prelude.Maybe (Prelude.NonEmpty ProviderType))
listRepositoryAssociations_providerTypes :: (Maybe (NonEmpty ProviderType)
 -> f (Maybe (NonEmpty ProviderType)))
-> ListRepositoryAssociations -> f ListRepositoryAssociations
listRepositoryAssociations_providerTypes = (ListRepositoryAssociations -> Maybe (NonEmpty ProviderType))
-> (ListRepositoryAssociations
    -> Maybe (NonEmpty ProviderType) -> ListRepositoryAssociations)
-> Lens
     ListRepositoryAssociations
     ListRepositoryAssociations
     (Maybe (NonEmpty ProviderType))
     (Maybe (NonEmpty ProviderType))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociations' {Maybe (NonEmpty ProviderType)
providerTypes :: Maybe (NonEmpty ProviderType)
$sel:providerTypes:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe (NonEmpty ProviderType)
providerTypes} -> Maybe (NonEmpty ProviderType)
providerTypes) (\s :: ListRepositoryAssociations
s@ListRepositoryAssociations' {} Maybe (NonEmpty ProviderType)
a -> ListRepositoryAssociations
s {$sel:providerTypes:ListRepositoryAssociations' :: Maybe (NonEmpty ProviderType)
providerTypes = Maybe (NonEmpty ProviderType)
a} :: ListRepositoryAssociations) ((Maybe (NonEmpty ProviderType)
  -> f (Maybe (NonEmpty ProviderType)))
 -> ListRepositoryAssociations -> f ListRepositoryAssociations)
-> ((Maybe (NonEmpty ProviderType)
     -> f (Maybe (NonEmpty ProviderType)))
    -> Maybe (NonEmpty ProviderType)
    -> f (Maybe (NonEmpty ProviderType)))
-> (Maybe (NonEmpty ProviderType)
    -> f (Maybe (NonEmpty ProviderType)))
-> ListRepositoryAssociations
-> f ListRepositoryAssociations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ProviderType)
  (NonEmpty ProviderType)
  (NonEmpty ProviderType)
  (NonEmpty ProviderType)
-> Iso
     (Maybe (NonEmpty ProviderType))
     (Maybe (NonEmpty ProviderType))
     (Maybe (NonEmpty ProviderType))
     (Maybe (NonEmpty ProviderType))
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 ProviderType)
  (NonEmpty ProviderType)
  (NonEmpty ProviderType)
  (NonEmpty ProviderType)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @nextToken@ value returned from a previous paginated
-- @ListRepositoryAssociations@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- Treat this token as an opaque identifier that is only used to retrieve
-- the next items in a list and not for other programmatic purposes.
listRepositoryAssociations_nextToken :: Lens.Lens' ListRepositoryAssociations (Prelude.Maybe Prelude.Text)
listRepositoryAssociations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRepositoryAssociations -> f ListRepositoryAssociations
listRepositoryAssociations_nextToken = (ListRepositoryAssociations -> Maybe Text)
-> (ListRepositoryAssociations
    -> Maybe Text -> ListRepositoryAssociations)
-> Lens
     ListRepositoryAssociations
     ListRepositoryAssociations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRepositoryAssociations
s@ListRepositoryAssociations' {} Maybe Text
a -> ListRepositoryAssociations
s {$sel:nextToken:ListRepositoryAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: ListRepositoryAssociations)

-- | List of repository names to use as a filter.
listRepositoryAssociations_names :: Lens.Lens' ListRepositoryAssociations (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listRepositoryAssociations_names :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRepositoryAssociations -> f ListRepositoryAssociations
listRepositoryAssociations_names = (ListRepositoryAssociations -> Maybe (NonEmpty Text))
-> (ListRepositoryAssociations
    -> Maybe (NonEmpty Text) -> ListRepositoryAssociations)
-> Lens
     ListRepositoryAssociations
     ListRepositoryAssociations
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociations' {Maybe (NonEmpty Text)
names :: Maybe (NonEmpty Text)
$sel:names:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe (NonEmpty Text)
names} -> Maybe (NonEmpty Text)
names) (\s :: ListRepositoryAssociations
s@ListRepositoryAssociations' {} Maybe (NonEmpty Text)
a -> ListRepositoryAssociations
s {$sel:names:ListRepositoryAssociations' :: Maybe (NonEmpty Text)
names = Maybe (NonEmpty Text)
a} :: ListRepositoryAssociations) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListRepositoryAssociations -> f ListRepositoryAssociations)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRepositoryAssociations
-> f ListRepositoryAssociations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of repository association results returned by
-- @ListRepositoryAssociations@ in paginated output. When this parameter is
-- used, @ListRepositoryAssociations@ only returns @maxResults@ results in
-- a single page with a @nextToken@ response element. The remaining results
-- of the initial request can be seen by sending another
-- @ListRepositoryAssociations@ request with the returned @nextToken@
-- value. This value can be between 1 and 100. If this parameter is not
-- used, @ListRepositoryAssociations@ returns up to 100 results and a
-- @nextToken@ value if applicable.
listRepositoryAssociations_maxResults :: Lens.Lens' ListRepositoryAssociations (Prelude.Maybe Prelude.Natural)
listRepositoryAssociations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListRepositoryAssociations -> f ListRepositoryAssociations
listRepositoryAssociations_maxResults = (ListRepositoryAssociations -> Maybe Natural)
-> (ListRepositoryAssociations
    -> Maybe Natural -> ListRepositoryAssociations)
-> Lens
     ListRepositoryAssociations
     ListRepositoryAssociations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRepositoryAssociations
s@ListRepositoryAssociations' {} Maybe Natural
a -> ListRepositoryAssociations
s {$sel:maxResults:ListRepositoryAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRepositoryAssociations)

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

instance Prelude.NFData ListRepositoryAssociations

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

instance Core.ToQuery ListRepositoryAssociations where
  toQuery :: ListRepositoryAssociations -> QueryString
toQuery ListRepositoryAssociations' {Maybe Natural
Maybe (NonEmpty Text)
Maybe (NonEmpty ProviderType)
Maybe (NonEmpty RepositoryAssociationState)
Maybe Text
maxResults :: Maybe Natural
names :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
providerTypes :: Maybe (NonEmpty ProviderType)
owners :: Maybe (NonEmpty Text)
states :: Maybe (NonEmpty RepositoryAssociationState)
$sel:maxResults:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe Natural
$sel:names:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe (NonEmpty Text)
$sel:nextToken:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe Text
$sel:providerTypes:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe (NonEmpty ProviderType)
$sel:owners:ListRepositoryAssociations' :: ListRepositoryAssociations -> Maybe (NonEmpty Text)
$sel:states:ListRepositoryAssociations' :: ListRepositoryAssociations
-> Maybe (NonEmpty RepositoryAssociationState)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"State"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> NonEmpty RepositoryAssociationState -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" (NonEmpty RepositoryAssociationState -> QueryString)
-> Maybe (NonEmpty RepositoryAssociationState) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty RepositoryAssociationState)
states),
        ByteString
"Owner"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> NonEmpty Text -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" (NonEmpty Text -> QueryString)
-> Maybe (NonEmpty Text) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
owners),
        ByteString
"ProviderType"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> NonEmpty ProviderType -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                (NonEmpty ProviderType -> QueryString)
-> Maybe (NonEmpty ProviderType) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ProviderType)
providerTypes
            ),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"Name"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> NonEmpty Text -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" (NonEmpty Text -> QueryString)
-> Maybe (NonEmpty Text) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
names),
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListRepositoryAssociationsResponse' smart constructor.
data ListRepositoryAssociationsResponse = ListRepositoryAssociationsResponse'
  { -- | The @nextToken@ value to include in a future @ListRecommendations@
    -- request. When the results of a @ListRecommendations@ request exceed
    -- @maxResults@, this value can be used to retrieve the next page of
    -- results. This value is @null@ when there are no more results to return.
    ListRepositoryAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of repository associations that meet the criteria of the request.
    ListRepositoryAssociationsResponse
-> Maybe [RepositoryAssociationSummary]
repositoryAssociationSummaries :: Prelude.Maybe [RepositoryAssociationSummary],
    -- | The response's http status code.
    ListRepositoryAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRepositoryAssociationsResponse
-> ListRepositoryAssociationsResponse -> Bool
(ListRepositoryAssociationsResponse
 -> ListRepositoryAssociationsResponse -> Bool)
-> (ListRepositoryAssociationsResponse
    -> ListRepositoryAssociationsResponse -> Bool)
-> Eq ListRepositoryAssociationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRepositoryAssociationsResponse
-> ListRepositoryAssociationsResponse -> Bool
$c/= :: ListRepositoryAssociationsResponse
-> ListRepositoryAssociationsResponse -> Bool
== :: ListRepositoryAssociationsResponse
-> ListRepositoryAssociationsResponse -> Bool
$c== :: ListRepositoryAssociationsResponse
-> ListRepositoryAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [ListRepositoryAssociationsResponse]
ReadPrec ListRepositoryAssociationsResponse
Int -> ReadS ListRepositoryAssociationsResponse
ReadS [ListRepositoryAssociationsResponse]
(Int -> ReadS ListRepositoryAssociationsResponse)
-> ReadS [ListRepositoryAssociationsResponse]
-> ReadPrec ListRepositoryAssociationsResponse
-> ReadPrec [ListRepositoryAssociationsResponse]
-> Read ListRepositoryAssociationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRepositoryAssociationsResponse]
$creadListPrec :: ReadPrec [ListRepositoryAssociationsResponse]
readPrec :: ReadPrec ListRepositoryAssociationsResponse
$creadPrec :: ReadPrec ListRepositoryAssociationsResponse
readList :: ReadS [ListRepositoryAssociationsResponse]
$creadList :: ReadS [ListRepositoryAssociationsResponse]
readsPrec :: Int -> ReadS ListRepositoryAssociationsResponse
$creadsPrec :: Int -> ReadS ListRepositoryAssociationsResponse
Prelude.Read, Int -> ListRepositoryAssociationsResponse -> ShowS
[ListRepositoryAssociationsResponse] -> ShowS
ListRepositoryAssociationsResponse -> String
(Int -> ListRepositoryAssociationsResponse -> ShowS)
-> (ListRepositoryAssociationsResponse -> String)
-> ([ListRepositoryAssociationsResponse] -> ShowS)
-> Show ListRepositoryAssociationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRepositoryAssociationsResponse] -> ShowS
$cshowList :: [ListRepositoryAssociationsResponse] -> ShowS
show :: ListRepositoryAssociationsResponse -> String
$cshow :: ListRepositoryAssociationsResponse -> String
showsPrec :: Int -> ListRepositoryAssociationsResponse -> ShowS
$cshowsPrec :: Int -> ListRepositoryAssociationsResponse -> ShowS
Prelude.Show, (forall x.
 ListRepositoryAssociationsResponse
 -> Rep ListRepositoryAssociationsResponse x)
-> (forall x.
    Rep ListRepositoryAssociationsResponse x
    -> ListRepositoryAssociationsResponse)
-> Generic ListRepositoryAssociationsResponse
forall x.
Rep ListRepositoryAssociationsResponse x
-> ListRepositoryAssociationsResponse
forall x.
ListRepositoryAssociationsResponse
-> Rep ListRepositoryAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRepositoryAssociationsResponse x
-> ListRepositoryAssociationsResponse
$cfrom :: forall x.
ListRepositoryAssociationsResponse
-> Rep ListRepositoryAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRepositoryAssociationsResponse' 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', 'listRepositoryAssociationsResponse_nextToken' - The @nextToken@ value to include in a future @ListRecommendations@
-- request. When the results of a @ListRecommendations@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
--
-- 'repositoryAssociationSummaries', 'listRepositoryAssociationsResponse_repositoryAssociationSummaries' - A list of repository associations that meet the criteria of the request.
--
-- 'httpStatus', 'listRepositoryAssociationsResponse_httpStatus' - The response's http status code.
newListRepositoryAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRepositoryAssociationsResponse
newListRepositoryAssociationsResponse :: Int -> ListRepositoryAssociationsResponse
newListRepositoryAssociationsResponse Int
pHttpStatus_ =
  ListRepositoryAssociationsResponse' :: Maybe Text
-> Maybe [RepositoryAssociationSummary]
-> Int
-> ListRepositoryAssociationsResponse
ListRepositoryAssociationsResponse'
    { $sel:nextToken:ListRepositoryAssociationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryAssociationSummaries:ListRepositoryAssociationsResponse' :: Maybe [RepositoryAssociationSummary]
repositoryAssociationSummaries =
        Maybe [RepositoryAssociationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRepositoryAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The @nextToken@ value to include in a future @ListRecommendations@
-- request. When the results of a @ListRecommendations@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
listRepositoryAssociationsResponse_nextToken :: Lens.Lens' ListRepositoryAssociationsResponse (Prelude.Maybe Prelude.Text)
listRepositoryAssociationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRepositoryAssociationsResponse
-> f ListRepositoryAssociationsResponse
listRepositoryAssociationsResponse_nextToken = (ListRepositoryAssociationsResponse -> Maybe Text)
-> (ListRepositoryAssociationsResponse
    -> Maybe Text -> ListRepositoryAssociationsResponse)
-> Lens' ListRepositoryAssociationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRepositoryAssociationsResponse' :: ListRepositoryAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRepositoryAssociationsResponse
s@ListRepositoryAssociationsResponse' {} Maybe Text
a -> ListRepositoryAssociationsResponse
s {$sel:nextToken:ListRepositoryAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRepositoryAssociationsResponse)

-- | A list of repository associations that meet the criteria of the request.
listRepositoryAssociationsResponse_repositoryAssociationSummaries :: Lens.Lens' ListRepositoryAssociationsResponse (Prelude.Maybe [RepositoryAssociationSummary])
listRepositoryAssociationsResponse_repositoryAssociationSummaries :: (Maybe [RepositoryAssociationSummary]
 -> f (Maybe [RepositoryAssociationSummary]))
-> ListRepositoryAssociationsResponse
-> f ListRepositoryAssociationsResponse
listRepositoryAssociationsResponse_repositoryAssociationSummaries = (ListRepositoryAssociationsResponse
 -> Maybe [RepositoryAssociationSummary])
-> (ListRepositoryAssociationsResponse
    -> Maybe [RepositoryAssociationSummary]
    -> ListRepositoryAssociationsResponse)
-> Lens'
     ListRepositoryAssociationsResponse
     (Maybe [RepositoryAssociationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRepositoryAssociationsResponse' {Maybe [RepositoryAssociationSummary]
repositoryAssociationSummaries :: Maybe [RepositoryAssociationSummary]
$sel:repositoryAssociationSummaries:ListRepositoryAssociationsResponse' :: ListRepositoryAssociationsResponse
-> Maybe [RepositoryAssociationSummary]
repositoryAssociationSummaries} -> Maybe [RepositoryAssociationSummary]
repositoryAssociationSummaries) (\s :: ListRepositoryAssociationsResponse
s@ListRepositoryAssociationsResponse' {} Maybe [RepositoryAssociationSummary]
a -> ListRepositoryAssociationsResponse
s {$sel:repositoryAssociationSummaries:ListRepositoryAssociationsResponse' :: Maybe [RepositoryAssociationSummary]
repositoryAssociationSummaries = Maybe [RepositoryAssociationSummary]
a} :: ListRepositoryAssociationsResponse) ((Maybe [RepositoryAssociationSummary]
  -> f (Maybe [RepositoryAssociationSummary]))
 -> ListRepositoryAssociationsResponse
 -> f ListRepositoryAssociationsResponse)
-> ((Maybe [RepositoryAssociationSummary]
     -> f (Maybe [RepositoryAssociationSummary]))
    -> Maybe [RepositoryAssociationSummary]
    -> f (Maybe [RepositoryAssociationSummary]))
-> (Maybe [RepositoryAssociationSummary]
    -> f (Maybe [RepositoryAssociationSummary]))
-> ListRepositoryAssociationsResponse
-> f ListRepositoryAssociationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RepositoryAssociationSummary]
  [RepositoryAssociationSummary]
  [RepositoryAssociationSummary]
  [RepositoryAssociationSummary]
-> Iso
     (Maybe [RepositoryAssociationSummary])
     (Maybe [RepositoryAssociationSummary])
     (Maybe [RepositoryAssociationSummary])
     (Maybe [RepositoryAssociationSummary])
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
  [RepositoryAssociationSummary]
  [RepositoryAssociationSummary]
  [RepositoryAssociationSummary]
  [RepositoryAssociationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListRepositoryAssociationsResponse