{-# 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.Organizations.ListAWSServiceAccessForOrganization
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of the Amazon Web Services services that you enabled to
-- integrate with your organization. After a service on this list creates
-- the resources that it requires for the integration, it can perform
-- operations on your organization and its accounts.
--
-- For more information about integrating other services with
-- Organizations, including the list of services that currently work with
-- Organizations, see
-- <https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html Integrating Organizations with Other Amazon Web Services Services>
-- in the /Organizations User Guide./
--
-- This operation can be called only from the organization\'s management
-- account or by a member account that is a delegated administrator for an
-- Amazon Web Services service.
--
-- This operation returns paginated results.
module Amazonka.Organizations.ListAWSServiceAccessForOrganization
  ( -- * Creating a Request
    ListAWSServiceAccessForOrganization (..),
    newListAWSServiceAccessForOrganization,

    -- * Request Lenses
    listAWSServiceAccessForOrganization_maxResults,
    listAWSServiceAccessForOrganization_nextToken,

    -- * Destructuring the Response
    ListAWSServiceAccessForOrganizationResponse (..),
    newListAWSServiceAccessForOrganizationResponse,

    -- * Response Lenses
    listAWSServiceAccessForOrganizationResponse_enabledServicePrincipals,
    listAWSServiceAccessForOrganizationResponse_nextToken,
    listAWSServiceAccessForOrganizationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListAWSServiceAccessForOrganization' smart constructor.
data ListAWSServiceAccessForOrganization = ListAWSServiceAccessForOrganization'
  { -- | The total number of results that you want included on each page of the
    -- response. If you do not include this parameter, it defaults to a value
    -- that is specific to the operation. If additional items exist beyond the
    -- maximum you specify, the @NextToken@ response element is present and has
    -- a value (is not null). Include that value as the @NextToken@ request
    -- parameter in the next call to the operation to get the next part of the
    -- results. Note that Organizations might return fewer results than the
    -- maximum even when there are more results available. You should check
    -- @NextToken@ after every operation to ensure that you receive all of the
    -- results.
    ListAWSServiceAccessForOrganization -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The parameter for receiving additional results if you receive a
    -- @NextToken@ response in a previous request. A @NextToken@ response
    -- indicates that more output is available. Set this parameter to the value
    -- of the previous call\'s @NextToken@ response to indicate where the
    -- output should continue from.
    ListAWSServiceAccessForOrganization -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListAWSServiceAccessForOrganization
-> ListAWSServiceAccessForOrganization -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAWSServiceAccessForOrganization
-> ListAWSServiceAccessForOrganization -> Bool
$c/= :: ListAWSServiceAccessForOrganization
-> ListAWSServiceAccessForOrganization -> Bool
== :: ListAWSServiceAccessForOrganization
-> ListAWSServiceAccessForOrganization -> Bool
$c== :: ListAWSServiceAccessForOrganization
-> ListAWSServiceAccessForOrganization -> Bool
Prelude.Eq, ReadPrec [ListAWSServiceAccessForOrganization]
ReadPrec ListAWSServiceAccessForOrganization
Int -> ReadS ListAWSServiceAccessForOrganization
ReadS [ListAWSServiceAccessForOrganization]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAWSServiceAccessForOrganization]
$creadListPrec :: ReadPrec [ListAWSServiceAccessForOrganization]
readPrec :: ReadPrec ListAWSServiceAccessForOrganization
$creadPrec :: ReadPrec ListAWSServiceAccessForOrganization
readList :: ReadS [ListAWSServiceAccessForOrganization]
$creadList :: ReadS [ListAWSServiceAccessForOrganization]
readsPrec :: Int -> ReadS ListAWSServiceAccessForOrganization
$creadsPrec :: Int -> ReadS ListAWSServiceAccessForOrganization
Prelude.Read, Int -> ListAWSServiceAccessForOrganization -> ShowS
[ListAWSServiceAccessForOrganization] -> ShowS
ListAWSServiceAccessForOrganization -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAWSServiceAccessForOrganization] -> ShowS
$cshowList :: [ListAWSServiceAccessForOrganization] -> ShowS
show :: ListAWSServiceAccessForOrganization -> String
$cshow :: ListAWSServiceAccessForOrganization -> String
showsPrec :: Int -> ListAWSServiceAccessForOrganization -> ShowS
$cshowsPrec :: Int -> ListAWSServiceAccessForOrganization -> ShowS
Prelude.Show, forall x.
Rep ListAWSServiceAccessForOrganization x
-> ListAWSServiceAccessForOrganization
forall x.
ListAWSServiceAccessForOrganization
-> Rep ListAWSServiceAccessForOrganization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAWSServiceAccessForOrganization x
-> ListAWSServiceAccessForOrganization
$cfrom :: forall x.
ListAWSServiceAccessForOrganization
-> Rep ListAWSServiceAccessForOrganization x
Prelude.Generic)

-- |
-- Create a value of 'ListAWSServiceAccessForOrganization' 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:
--
-- 'maxResults', 'listAWSServiceAccessForOrganization_maxResults' - The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
--
-- 'nextToken', 'listAWSServiceAccessForOrganization_nextToken' - The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
newListAWSServiceAccessForOrganization ::
  ListAWSServiceAccessForOrganization
newListAWSServiceAccessForOrganization :: ListAWSServiceAccessForOrganization
newListAWSServiceAccessForOrganization =
  ListAWSServiceAccessForOrganization'
    { $sel:maxResults:ListAWSServiceAccessForOrganization' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAWSServiceAccessForOrganization' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
listAWSServiceAccessForOrganization_maxResults :: Lens.Lens' ListAWSServiceAccessForOrganization (Prelude.Maybe Prelude.Natural)
listAWSServiceAccessForOrganization_maxResults :: Lens' ListAWSServiceAccessForOrganization (Maybe Natural)
listAWSServiceAccessForOrganization_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSServiceAccessForOrganization' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAWSServiceAccessForOrganization
s@ListAWSServiceAccessForOrganization' {} Maybe Natural
a -> ListAWSServiceAccessForOrganization
s {$sel:maxResults:ListAWSServiceAccessForOrganization' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAWSServiceAccessForOrganization)

-- | The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
listAWSServiceAccessForOrganization_nextToken :: Lens.Lens' ListAWSServiceAccessForOrganization (Prelude.Maybe Prelude.Text)
listAWSServiceAccessForOrganization_nextToken :: Lens' ListAWSServiceAccessForOrganization (Maybe Text)
listAWSServiceAccessForOrganization_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSServiceAccessForOrganization' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAWSServiceAccessForOrganization
s@ListAWSServiceAccessForOrganization' {} Maybe Text
a -> ListAWSServiceAccessForOrganization
s {$sel:nextToken:ListAWSServiceAccessForOrganization' :: Maybe Text
nextToken = Maybe Text
a} :: ListAWSServiceAccessForOrganization)

instance
  Core.AWSPager
    ListAWSServiceAccessForOrganization
  where
  page :: ListAWSServiceAccessForOrganization
-> AWSResponse ListAWSServiceAccessForOrganization
-> Maybe ListAWSServiceAccessForOrganization
page ListAWSServiceAccessForOrganization
rq AWSResponse ListAWSServiceAccessForOrganization
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAWSServiceAccessForOrganization
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAWSServiceAccessForOrganizationResponse (Maybe Text)
listAWSServiceAccessForOrganizationResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAWSServiceAccessForOrganization
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListAWSServiceAccessForOrganizationResponse
  (Maybe [EnabledServicePrincipal])
listAWSServiceAccessForOrganizationResponse_enabledServicePrincipals
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListAWSServiceAccessForOrganization
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAWSServiceAccessForOrganization (Maybe Text)
listAWSServiceAccessForOrganization_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAWSServiceAccessForOrganization
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAWSServiceAccessForOrganizationResponse (Maybe Text)
listAWSServiceAccessForOrganizationResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    ListAWSServiceAccessForOrganization
  where
  type
    AWSResponse ListAWSServiceAccessForOrganization =
      ListAWSServiceAccessForOrganizationResponse
  request :: (Service -> Service)
-> ListAWSServiceAccessForOrganization
-> Request ListAWSServiceAccessForOrganization
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAWSServiceAccessForOrganization
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListAWSServiceAccessForOrganization)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [EnabledServicePrincipal]
-> Maybe Text -> Int -> ListAWSServiceAccessForOrganizationResponse
ListAWSServiceAccessForOrganizationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EnabledServicePrincipals"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListAWSServiceAccessForOrganization
  where
  hashWithSalt :: Int -> ListAWSServiceAccessForOrganization -> Int
hashWithSalt
    Int
_salt
    ListAWSServiceAccessForOrganization' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Text
$sel:maxResults:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance
  Prelude.NFData
    ListAWSServiceAccessForOrganization
  where
  rnf :: ListAWSServiceAccessForOrganization -> ()
rnf ListAWSServiceAccessForOrganization' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Text
$sel:maxResults:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance
  Data.ToHeaders
    ListAWSServiceAccessForOrganization
  where
  toHeaders :: ListAWSServiceAccessForOrganization -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSOrganizationsV20161128.ListAWSServiceAccessForOrganization" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    ListAWSServiceAccessForOrganization
  where
  toJSON :: ListAWSServiceAccessForOrganization -> Value
toJSON ListAWSServiceAccessForOrganization' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Text
$sel:maxResults:ListAWSServiceAccessForOrganization' :: ListAWSServiceAccessForOrganization -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

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

-- | /See:/ 'newListAWSServiceAccessForOrganizationResponse' smart constructor.
data ListAWSServiceAccessForOrganizationResponse = ListAWSServiceAccessForOrganizationResponse'
  { -- | A list of the service principals for the services that are enabled to
    -- integrate with your organization. Each principal is a structure that
    -- includes the name and the date that it was enabled for integration with
    -- Organizations.
    ListAWSServiceAccessForOrganizationResponse
-> Maybe [EnabledServicePrincipal]
enabledServicePrincipals :: Prelude.Maybe [EnabledServicePrincipal],
    -- | If present, indicates that more output is available than is included in
    -- the current response. Use this value in the @NextToken@ request
    -- parameter in a subsequent call to the operation to get the next part of
    -- the output. You should repeat this until the @NextToken@ response
    -- element comes back as @null@.
    ListAWSServiceAccessForOrganizationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAWSServiceAccessForOrganizationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAWSServiceAccessForOrganizationResponse
-> ListAWSServiceAccessForOrganizationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAWSServiceAccessForOrganizationResponse
-> ListAWSServiceAccessForOrganizationResponse -> Bool
$c/= :: ListAWSServiceAccessForOrganizationResponse
-> ListAWSServiceAccessForOrganizationResponse -> Bool
== :: ListAWSServiceAccessForOrganizationResponse
-> ListAWSServiceAccessForOrganizationResponse -> Bool
$c== :: ListAWSServiceAccessForOrganizationResponse
-> ListAWSServiceAccessForOrganizationResponse -> Bool
Prelude.Eq, ReadPrec [ListAWSServiceAccessForOrganizationResponse]
ReadPrec ListAWSServiceAccessForOrganizationResponse
Int -> ReadS ListAWSServiceAccessForOrganizationResponse
ReadS [ListAWSServiceAccessForOrganizationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAWSServiceAccessForOrganizationResponse]
$creadListPrec :: ReadPrec [ListAWSServiceAccessForOrganizationResponse]
readPrec :: ReadPrec ListAWSServiceAccessForOrganizationResponse
$creadPrec :: ReadPrec ListAWSServiceAccessForOrganizationResponse
readList :: ReadS [ListAWSServiceAccessForOrganizationResponse]
$creadList :: ReadS [ListAWSServiceAccessForOrganizationResponse]
readsPrec :: Int -> ReadS ListAWSServiceAccessForOrganizationResponse
$creadsPrec :: Int -> ReadS ListAWSServiceAccessForOrganizationResponse
Prelude.Read, Int -> ListAWSServiceAccessForOrganizationResponse -> ShowS
[ListAWSServiceAccessForOrganizationResponse] -> ShowS
ListAWSServiceAccessForOrganizationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAWSServiceAccessForOrganizationResponse] -> ShowS
$cshowList :: [ListAWSServiceAccessForOrganizationResponse] -> ShowS
show :: ListAWSServiceAccessForOrganizationResponse -> String
$cshow :: ListAWSServiceAccessForOrganizationResponse -> String
showsPrec :: Int -> ListAWSServiceAccessForOrganizationResponse -> ShowS
$cshowsPrec :: Int -> ListAWSServiceAccessForOrganizationResponse -> ShowS
Prelude.Show, forall x.
Rep ListAWSServiceAccessForOrganizationResponse x
-> ListAWSServiceAccessForOrganizationResponse
forall x.
ListAWSServiceAccessForOrganizationResponse
-> Rep ListAWSServiceAccessForOrganizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAWSServiceAccessForOrganizationResponse x
-> ListAWSServiceAccessForOrganizationResponse
$cfrom :: forall x.
ListAWSServiceAccessForOrganizationResponse
-> Rep ListAWSServiceAccessForOrganizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAWSServiceAccessForOrganizationResponse' 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:
--
-- 'enabledServicePrincipals', 'listAWSServiceAccessForOrganizationResponse_enabledServicePrincipals' - A list of the service principals for the services that are enabled to
-- integrate with your organization. Each principal is a structure that
-- includes the name and the date that it was enabled for integration with
-- Organizations.
--
-- 'nextToken', 'listAWSServiceAccessForOrganizationResponse_nextToken' - If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
--
-- 'httpStatus', 'listAWSServiceAccessForOrganizationResponse_httpStatus' - The response's http status code.
newListAWSServiceAccessForOrganizationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAWSServiceAccessForOrganizationResponse
newListAWSServiceAccessForOrganizationResponse :: Int -> ListAWSServiceAccessForOrganizationResponse
newListAWSServiceAccessForOrganizationResponse
  Int
pHttpStatus_ =
    ListAWSServiceAccessForOrganizationResponse'
      { $sel:enabledServicePrincipals:ListAWSServiceAccessForOrganizationResponse' :: Maybe [EnabledServicePrincipal]
enabledServicePrincipals =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListAWSServiceAccessForOrganizationResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListAWSServiceAccessForOrganizationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of the service principals for the services that are enabled to
-- integrate with your organization. Each principal is a structure that
-- includes the name and the date that it was enabled for integration with
-- Organizations.
listAWSServiceAccessForOrganizationResponse_enabledServicePrincipals :: Lens.Lens' ListAWSServiceAccessForOrganizationResponse (Prelude.Maybe [EnabledServicePrincipal])
listAWSServiceAccessForOrganizationResponse_enabledServicePrincipals :: Lens'
  ListAWSServiceAccessForOrganizationResponse
  (Maybe [EnabledServicePrincipal])
listAWSServiceAccessForOrganizationResponse_enabledServicePrincipals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSServiceAccessForOrganizationResponse' {Maybe [EnabledServicePrincipal]
enabledServicePrincipals :: Maybe [EnabledServicePrincipal]
$sel:enabledServicePrincipals:ListAWSServiceAccessForOrganizationResponse' :: ListAWSServiceAccessForOrganizationResponse
-> Maybe [EnabledServicePrincipal]
enabledServicePrincipals} -> Maybe [EnabledServicePrincipal]
enabledServicePrincipals) (\s :: ListAWSServiceAccessForOrganizationResponse
s@ListAWSServiceAccessForOrganizationResponse' {} Maybe [EnabledServicePrincipal]
a -> ListAWSServiceAccessForOrganizationResponse
s {$sel:enabledServicePrincipals:ListAWSServiceAccessForOrganizationResponse' :: Maybe [EnabledServicePrincipal]
enabledServicePrincipals = Maybe [EnabledServicePrincipal]
a} :: ListAWSServiceAccessForOrganizationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
listAWSServiceAccessForOrganizationResponse_nextToken :: Lens.Lens' ListAWSServiceAccessForOrganizationResponse (Prelude.Maybe Prelude.Text)
listAWSServiceAccessForOrganizationResponse_nextToken :: Lens' ListAWSServiceAccessForOrganizationResponse (Maybe Text)
listAWSServiceAccessForOrganizationResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAWSServiceAccessForOrganizationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAWSServiceAccessForOrganizationResponse' :: ListAWSServiceAccessForOrganizationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAWSServiceAccessForOrganizationResponse
s@ListAWSServiceAccessForOrganizationResponse' {} Maybe Text
a -> ListAWSServiceAccessForOrganizationResponse
s {$sel:nextToken:ListAWSServiceAccessForOrganizationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAWSServiceAccessForOrganizationResponse)

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

instance
  Prelude.NFData
    ListAWSServiceAccessForOrganizationResponse
  where
  rnf :: ListAWSServiceAccessForOrganizationResponse -> ()
rnf ListAWSServiceAccessForOrganizationResponse' {Int
Maybe [EnabledServicePrincipal]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
enabledServicePrincipals :: Maybe [EnabledServicePrincipal]
$sel:httpStatus:ListAWSServiceAccessForOrganizationResponse' :: ListAWSServiceAccessForOrganizationResponse -> Int
$sel:nextToken:ListAWSServiceAccessForOrganizationResponse' :: ListAWSServiceAccessForOrganizationResponse -> Maybe Text
$sel:enabledServicePrincipals:ListAWSServiceAccessForOrganizationResponse' :: ListAWSServiceAccessForOrganizationResponse
-> Maybe [EnabledServicePrincipal]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [EnabledServicePrincipal]
enabledServicePrincipals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus