{-# 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.DirectoryService.DescribeTrusts
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Obtains information about the trust relationships for this account.
--
-- If no input parameters are provided, such as DirectoryId or TrustIds,
-- this request describes all the trust relationships belonging to the
-- account.
--
-- This operation returns paginated results.
module Amazonka.DirectoryService.DescribeTrusts
  ( -- * Creating a Request
    DescribeTrusts (..),
    newDescribeTrusts,

    -- * Request Lenses
    describeTrusts_directoryId,
    describeTrusts_limit,
    describeTrusts_nextToken,
    describeTrusts_trustIds,

    -- * Destructuring the Response
    DescribeTrustsResponse (..),
    newDescribeTrustsResponse,

    -- * Response Lenses
    describeTrustsResponse_nextToken,
    describeTrustsResponse_trusts,
    describeTrustsResponse_httpStatus,
  )
where

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

-- | Describes the trust relationships for a particular Managed Microsoft AD
-- directory. If no input parameters are provided, such as directory ID or
-- trust ID, this request describes all the trust relationships.
--
-- /See:/ 'newDescribeTrusts' smart constructor.
data DescribeTrusts = DescribeTrusts'
  { -- | The Directory ID of the Amazon Web Services directory that is a part of
    -- the requested trust relationship.
    DescribeTrusts -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of objects to return.
    DescribeTrusts -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The /DescribeTrustsResult.NextToken/ value from a previous call to
    -- DescribeTrusts. Pass null if this is the first call.
    DescribeTrusts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of identifiers of the trust relationships for which to obtain the
    -- information. If this member is null, all trust relationships that belong
    -- to the current account are returned.
    --
    -- An empty list results in an @InvalidParameterException@ being thrown.
    DescribeTrusts -> Maybe [Text]
trustIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeTrusts -> DescribeTrusts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTrusts -> DescribeTrusts -> Bool
$c/= :: DescribeTrusts -> DescribeTrusts -> Bool
== :: DescribeTrusts -> DescribeTrusts -> Bool
$c== :: DescribeTrusts -> DescribeTrusts -> Bool
Prelude.Eq, ReadPrec [DescribeTrusts]
ReadPrec DescribeTrusts
Int -> ReadS DescribeTrusts
ReadS [DescribeTrusts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTrusts]
$creadListPrec :: ReadPrec [DescribeTrusts]
readPrec :: ReadPrec DescribeTrusts
$creadPrec :: ReadPrec DescribeTrusts
readList :: ReadS [DescribeTrusts]
$creadList :: ReadS [DescribeTrusts]
readsPrec :: Int -> ReadS DescribeTrusts
$creadsPrec :: Int -> ReadS DescribeTrusts
Prelude.Read, Int -> DescribeTrusts -> ShowS
[DescribeTrusts] -> ShowS
DescribeTrusts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTrusts] -> ShowS
$cshowList :: [DescribeTrusts] -> ShowS
show :: DescribeTrusts -> String
$cshow :: DescribeTrusts -> String
showsPrec :: Int -> DescribeTrusts -> ShowS
$cshowsPrec :: Int -> DescribeTrusts -> ShowS
Prelude.Show, forall x. Rep DescribeTrusts x -> DescribeTrusts
forall x. DescribeTrusts -> Rep DescribeTrusts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTrusts x -> DescribeTrusts
$cfrom :: forall x. DescribeTrusts -> Rep DescribeTrusts x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTrusts' 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:
--
-- 'directoryId', 'describeTrusts_directoryId' - The Directory ID of the Amazon Web Services directory that is a part of
-- the requested trust relationship.
--
-- 'limit', 'describeTrusts_limit' - The maximum number of objects to return.
--
-- 'nextToken', 'describeTrusts_nextToken' - The /DescribeTrustsResult.NextToken/ value from a previous call to
-- DescribeTrusts. Pass null if this is the first call.
--
-- 'trustIds', 'describeTrusts_trustIds' - A list of identifiers of the trust relationships for which to obtain the
-- information. If this member is null, all trust relationships that belong
-- to the current account are returned.
--
-- An empty list results in an @InvalidParameterException@ being thrown.
newDescribeTrusts ::
  DescribeTrusts
newDescribeTrusts :: DescribeTrusts
newDescribeTrusts =
  DescribeTrusts'
    { $sel:directoryId:DescribeTrusts' :: Maybe Text
directoryId = forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeTrusts' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeTrusts' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:trustIds:DescribeTrusts' :: Maybe [Text]
trustIds = forall a. Maybe a
Prelude.Nothing
    }

-- | The Directory ID of the Amazon Web Services directory that is a part of
-- the requested trust relationship.
describeTrusts_directoryId :: Lens.Lens' DescribeTrusts (Prelude.Maybe Prelude.Text)
describeTrusts_directoryId :: Lens' DescribeTrusts (Maybe Text)
describeTrusts_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrusts' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:DescribeTrusts' :: DescribeTrusts -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: DescribeTrusts
s@DescribeTrusts' {} Maybe Text
a -> DescribeTrusts
s {$sel:directoryId:DescribeTrusts' :: Maybe Text
directoryId = Maybe Text
a} :: DescribeTrusts)

-- | The maximum number of objects to return.
describeTrusts_limit :: Lens.Lens' DescribeTrusts (Prelude.Maybe Prelude.Natural)
describeTrusts_limit :: Lens' DescribeTrusts (Maybe Natural)
describeTrusts_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrusts' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeTrusts' :: DescribeTrusts -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeTrusts
s@DescribeTrusts' {} Maybe Natural
a -> DescribeTrusts
s {$sel:limit:DescribeTrusts' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeTrusts)

-- | The /DescribeTrustsResult.NextToken/ value from a previous call to
-- DescribeTrusts. Pass null if this is the first call.
describeTrusts_nextToken :: Lens.Lens' DescribeTrusts (Prelude.Maybe Prelude.Text)
describeTrusts_nextToken :: Lens' DescribeTrusts (Maybe Text)
describeTrusts_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrusts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTrusts' :: DescribeTrusts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTrusts
s@DescribeTrusts' {} Maybe Text
a -> DescribeTrusts
s {$sel:nextToken:DescribeTrusts' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTrusts)

-- | A list of identifiers of the trust relationships for which to obtain the
-- information. If this member is null, all trust relationships that belong
-- to the current account are returned.
--
-- An empty list results in an @InvalidParameterException@ being thrown.
describeTrusts_trustIds :: Lens.Lens' DescribeTrusts (Prelude.Maybe [Prelude.Text])
describeTrusts_trustIds :: Lens' DescribeTrusts (Maybe [Text])
describeTrusts_trustIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrusts' {Maybe [Text]
trustIds :: Maybe [Text]
$sel:trustIds:DescribeTrusts' :: DescribeTrusts -> Maybe [Text]
trustIds} -> Maybe [Text]
trustIds) (\s :: DescribeTrusts
s@DescribeTrusts' {} Maybe [Text]
a -> DescribeTrusts
s {$sel:trustIds:DescribeTrusts' :: Maybe [Text]
trustIds = Maybe [Text]
a} :: DescribeTrusts) 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

instance Core.AWSPager DescribeTrusts where
  page :: DescribeTrusts
-> AWSResponse DescribeTrusts -> Maybe DescribeTrusts
page DescribeTrusts
rq AWSResponse DescribeTrusts
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTrusts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTrustsResponse (Maybe Text)
describeTrustsResponse_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 DescribeTrusts
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTrustsResponse (Maybe [Trust])
describeTrustsResponse_trusts
            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.$ DescribeTrusts
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeTrusts (Maybe Text)
describeTrusts_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeTrusts
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTrustsResponse (Maybe Text)
describeTrustsResponse_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 DescribeTrusts where
  type
    AWSResponse DescribeTrusts =
      DescribeTrustsResponse
  request :: (Service -> Service) -> DescribeTrusts -> Request DescribeTrusts
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 DescribeTrusts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTrusts)))
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 Text -> Maybe [Trust] -> Int -> DescribeTrustsResponse
DescribeTrustsResponse'
            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
"NextToken")
            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
"Trusts" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeTrusts where
  hashWithSalt :: Int -> DescribeTrusts -> Int
hashWithSalt Int
_salt DescribeTrusts' {Maybe Natural
Maybe [Text]
Maybe Text
trustIds :: Maybe [Text]
nextToken :: Maybe Text
limit :: Maybe Natural
directoryId :: Maybe Text
$sel:trustIds:DescribeTrusts' :: DescribeTrusts -> Maybe [Text]
$sel:nextToken:DescribeTrusts' :: DescribeTrusts -> Maybe Text
$sel:limit:DescribeTrusts' :: DescribeTrusts -> Maybe Natural
$sel:directoryId:DescribeTrusts' :: DescribeTrusts -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
trustIds

instance Prelude.NFData DescribeTrusts where
  rnf :: DescribeTrusts -> ()
rnf DescribeTrusts' {Maybe Natural
Maybe [Text]
Maybe Text
trustIds :: Maybe [Text]
nextToken :: Maybe Text
limit :: Maybe Natural
directoryId :: Maybe Text
$sel:trustIds:DescribeTrusts' :: DescribeTrusts -> Maybe [Text]
$sel:nextToken:DescribeTrusts' :: DescribeTrusts -> Maybe Text
$sel:limit:DescribeTrusts' :: DescribeTrusts -> Maybe Natural
$sel:directoryId:DescribeTrusts' :: DescribeTrusts -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
      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 Maybe [Text]
trustIds

instance Data.ToHeaders DescribeTrusts where
  toHeaders :: DescribeTrusts -> 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
"DirectoryService_20150416.DescribeTrusts" ::
                          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 DescribeTrusts where
  toJSON :: DescribeTrusts -> Value
toJSON DescribeTrusts' {Maybe Natural
Maybe [Text]
Maybe Text
trustIds :: Maybe [Text]
nextToken :: Maybe Text
limit :: Maybe Natural
directoryId :: Maybe Text
$sel:trustIds:DescribeTrusts' :: DescribeTrusts -> Maybe [Text]
$sel:nextToken:DescribeTrusts' :: DescribeTrusts -> Maybe Text
$sel:limit:DescribeTrusts' :: DescribeTrusts -> Maybe Natural
$sel:directoryId:DescribeTrusts' :: DescribeTrusts -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DirectoryId" 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
directoryId,
            (Key
"Limit" 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
limit,
            (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,
            (Key
"TrustIds" 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]
trustIds
          ]
      )

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

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

-- | The result of a DescribeTrust request.
--
-- /See:/ 'newDescribeTrustsResponse' smart constructor.
data DescribeTrustsResponse = DescribeTrustsResponse'
  { -- | If not null, more results are available. Pass this value for the
    -- /NextToken/ parameter in a subsequent call to DescribeTrusts to retrieve
    -- the next set of items.
    DescribeTrustsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of Trust objects that were retrieved.
    --
    -- It is possible that this list contains less than the number of items
    -- specified in the /Limit/ member of the request. This occurs if there are
    -- less than the requested number of items left to retrieve, or if the
    -- limitations of the operation have been exceeded.
    DescribeTrustsResponse -> Maybe [Trust]
trusts :: Prelude.Maybe [Trust],
    -- | The response's http status code.
    DescribeTrustsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTrustsResponse -> DescribeTrustsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTrustsResponse -> DescribeTrustsResponse -> Bool
$c/= :: DescribeTrustsResponse -> DescribeTrustsResponse -> Bool
== :: DescribeTrustsResponse -> DescribeTrustsResponse -> Bool
$c== :: DescribeTrustsResponse -> DescribeTrustsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTrustsResponse]
ReadPrec DescribeTrustsResponse
Int -> ReadS DescribeTrustsResponse
ReadS [DescribeTrustsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTrustsResponse]
$creadListPrec :: ReadPrec [DescribeTrustsResponse]
readPrec :: ReadPrec DescribeTrustsResponse
$creadPrec :: ReadPrec DescribeTrustsResponse
readList :: ReadS [DescribeTrustsResponse]
$creadList :: ReadS [DescribeTrustsResponse]
readsPrec :: Int -> ReadS DescribeTrustsResponse
$creadsPrec :: Int -> ReadS DescribeTrustsResponse
Prelude.Read, Int -> DescribeTrustsResponse -> ShowS
[DescribeTrustsResponse] -> ShowS
DescribeTrustsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTrustsResponse] -> ShowS
$cshowList :: [DescribeTrustsResponse] -> ShowS
show :: DescribeTrustsResponse -> String
$cshow :: DescribeTrustsResponse -> String
showsPrec :: Int -> DescribeTrustsResponse -> ShowS
$cshowsPrec :: Int -> DescribeTrustsResponse -> ShowS
Prelude.Show, forall x. Rep DescribeTrustsResponse x -> DescribeTrustsResponse
forall x. DescribeTrustsResponse -> Rep DescribeTrustsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTrustsResponse x -> DescribeTrustsResponse
$cfrom :: forall x. DescribeTrustsResponse -> Rep DescribeTrustsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTrustsResponse' 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', 'describeTrustsResponse_nextToken' - If not null, more results are available. Pass this value for the
-- /NextToken/ parameter in a subsequent call to DescribeTrusts to retrieve
-- the next set of items.
--
-- 'trusts', 'describeTrustsResponse_trusts' - The list of Trust objects that were retrieved.
--
-- It is possible that this list contains less than the number of items
-- specified in the /Limit/ member of the request. This occurs if there are
-- less than the requested number of items left to retrieve, or if the
-- limitations of the operation have been exceeded.
--
-- 'httpStatus', 'describeTrustsResponse_httpStatus' - The response's http status code.
newDescribeTrustsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTrustsResponse
newDescribeTrustsResponse :: Int -> DescribeTrustsResponse
newDescribeTrustsResponse Int
pHttpStatus_ =
  DescribeTrustsResponse'
    { $sel:nextToken:DescribeTrustsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:trusts:DescribeTrustsResponse' :: Maybe [Trust]
trusts = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTrustsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If not null, more results are available. Pass this value for the
-- /NextToken/ parameter in a subsequent call to DescribeTrusts to retrieve
-- the next set of items.
describeTrustsResponse_nextToken :: Lens.Lens' DescribeTrustsResponse (Prelude.Maybe Prelude.Text)
describeTrustsResponse_nextToken :: Lens' DescribeTrustsResponse (Maybe Text)
describeTrustsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrustsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTrustsResponse' :: DescribeTrustsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTrustsResponse
s@DescribeTrustsResponse' {} Maybe Text
a -> DescribeTrustsResponse
s {$sel:nextToken:DescribeTrustsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTrustsResponse)

-- | The list of Trust objects that were retrieved.
--
-- It is possible that this list contains less than the number of items
-- specified in the /Limit/ member of the request. This occurs if there are
-- less than the requested number of items left to retrieve, or if the
-- limitations of the operation have been exceeded.
describeTrustsResponse_trusts :: Lens.Lens' DescribeTrustsResponse (Prelude.Maybe [Trust])
describeTrustsResponse_trusts :: Lens' DescribeTrustsResponse (Maybe [Trust])
describeTrustsResponse_trusts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrustsResponse' {Maybe [Trust]
trusts :: Maybe [Trust]
$sel:trusts:DescribeTrustsResponse' :: DescribeTrustsResponse -> Maybe [Trust]
trusts} -> Maybe [Trust]
trusts) (\s :: DescribeTrustsResponse
s@DescribeTrustsResponse' {} Maybe [Trust]
a -> DescribeTrustsResponse
s {$sel:trusts:DescribeTrustsResponse' :: Maybe [Trust]
trusts = Maybe [Trust]
a} :: DescribeTrustsResponse) 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

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

instance Prelude.NFData DescribeTrustsResponse where
  rnf :: DescribeTrustsResponse -> ()
rnf DescribeTrustsResponse' {Int
Maybe [Trust]
Maybe Text
httpStatus :: Int
trusts :: Maybe [Trust]
nextToken :: Maybe Text
$sel:httpStatus:DescribeTrustsResponse' :: DescribeTrustsResponse -> Int
$sel:trusts:DescribeTrustsResponse' :: DescribeTrustsResponse -> Maybe [Trust]
$sel:nextToken:DescribeTrustsResponse' :: DescribeTrustsResponse -> Maybe Text
..} =
    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 Maybe [Trust]
trusts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus