{-# 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.Signer.ListSigningProfiles
-- 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)
--
-- Lists all available signing profiles in your AWS account. Returns only
-- profiles with an @ACTIVE@ status unless the @includeCanceled@ request
-- field is set to @true@. If additional jobs remain to be listed, code
-- signing returns a @nextToken@ value. Use this value in subsequent calls
-- to @ListSigningJobs@ to fetch the remaining values. You can continue
-- calling @ListSigningJobs@ with your @maxResults@ parameter and with new
-- values that code signing returns in the @nextToken@ parameter until all
-- of your signing jobs have been returned.
--
-- This operation returns paginated results.
module Amazonka.Signer.ListSigningProfiles
  ( -- * Creating a Request
    ListSigningProfiles (..),
    newListSigningProfiles,

    -- * Request Lenses
    listSigningProfiles_nextToken,
    listSigningProfiles_platformId,
    listSigningProfiles_statuses,
    listSigningProfiles_includeCanceled,
    listSigningProfiles_maxResults,

    -- * Destructuring the Response
    ListSigningProfilesResponse (..),
    newListSigningProfilesResponse,

    -- * Response Lenses
    listSigningProfilesResponse_profiles,
    listSigningProfilesResponse_nextToken,
    listSigningProfilesResponse_httpStatus,
  )
where

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
import Amazonka.Signer.Types

-- | /See:/ 'newListSigningProfiles' smart constructor.
data ListSigningProfiles = ListSigningProfiles'
  { -- | Value for specifying the next set of paginated results to return. After
    -- you receive a response with truncated results, use this parameter in a
    -- subsequent request. Set it to the value of @nextToken@ from the response
    -- that you just received.
    ListSigningProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters results to return only signing jobs initiated for a specified
    -- signing platform.
    ListSigningProfiles -> Maybe Text
platformId :: Prelude.Maybe Prelude.Text,
    -- | Filters results to return only signing jobs with statuses in the
    -- specified list.
    ListSigningProfiles -> Maybe [SigningProfileStatus]
statuses :: Prelude.Maybe [SigningProfileStatus],
    -- | Designates whether to include profiles with the status of @CANCELED@.
    ListSigningProfiles -> Maybe Bool
includeCanceled :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of profiles to be returned.
    ListSigningProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSigningProfiles -> ListSigningProfiles -> Bool
(ListSigningProfiles -> ListSigningProfiles -> Bool)
-> (ListSigningProfiles -> ListSigningProfiles -> Bool)
-> Eq ListSigningProfiles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSigningProfiles -> ListSigningProfiles -> Bool
$c/= :: ListSigningProfiles -> ListSigningProfiles -> Bool
== :: ListSigningProfiles -> ListSigningProfiles -> Bool
$c== :: ListSigningProfiles -> ListSigningProfiles -> Bool
Prelude.Eq, ReadPrec [ListSigningProfiles]
ReadPrec ListSigningProfiles
Int -> ReadS ListSigningProfiles
ReadS [ListSigningProfiles]
(Int -> ReadS ListSigningProfiles)
-> ReadS [ListSigningProfiles]
-> ReadPrec ListSigningProfiles
-> ReadPrec [ListSigningProfiles]
-> Read ListSigningProfiles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSigningProfiles]
$creadListPrec :: ReadPrec [ListSigningProfiles]
readPrec :: ReadPrec ListSigningProfiles
$creadPrec :: ReadPrec ListSigningProfiles
readList :: ReadS [ListSigningProfiles]
$creadList :: ReadS [ListSigningProfiles]
readsPrec :: Int -> ReadS ListSigningProfiles
$creadsPrec :: Int -> ReadS ListSigningProfiles
Prelude.Read, Int -> ListSigningProfiles -> ShowS
[ListSigningProfiles] -> ShowS
ListSigningProfiles -> String
(Int -> ListSigningProfiles -> ShowS)
-> (ListSigningProfiles -> String)
-> ([ListSigningProfiles] -> ShowS)
-> Show ListSigningProfiles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSigningProfiles] -> ShowS
$cshowList :: [ListSigningProfiles] -> ShowS
show :: ListSigningProfiles -> String
$cshow :: ListSigningProfiles -> String
showsPrec :: Int -> ListSigningProfiles -> ShowS
$cshowsPrec :: Int -> ListSigningProfiles -> ShowS
Prelude.Show, (forall x. ListSigningProfiles -> Rep ListSigningProfiles x)
-> (forall x. Rep ListSigningProfiles x -> ListSigningProfiles)
-> Generic ListSigningProfiles
forall x. Rep ListSigningProfiles x -> ListSigningProfiles
forall x. ListSigningProfiles -> Rep ListSigningProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSigningProfiles x -> ListSigningProfiles
$cfrom :: forall x. ListSigningProfiles -> Rep ListSigningProfiles x
Prelude.Generic)

-- |
-- Create a value of 'ListSigningProfiles' 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', 'listSigningProfiles_nextToken' - Value for specifying the next set of paginated results to return. After
-- you receive a response with truncated results, use this parameter in a
-- subsequent request. Set it to the value of @nextToken@ from the response
-- that you just received.
--
-- 'platformId', 'listSigningProfiles_platformId' - Filters results to return only signing jobs initiated for a specified
-- signing platform.
--
-- 'statuses', 'listSigningProfiles_statuses' - Filters results to return only signing jobs with statuses in the
-- specified list.
--
-- 'includeCanceled', 'listSigningProfiles_includeCanceled' - Designates whether to include profiles with the status of @CANCELED@.
--
-- 'maxResults', 'listSigningProfiles_maxResults' - The maximum number of profiles to be returned.
newListSigningProfiles ::
  ListSigningProfiles
newListSigningProfiles :: ListSigningProfiles
newListSigningProfiles =
  ListSigningProfiles' :: Maybe Text
-> Maybe Text
-> Maybe [SigningProfileStatus]
-> Maybe Bool
-> Maybe Natural
-> ListSigningProfiles
ListSigningProfiles'
    { $sel:nextToken:ListSigningProfiles' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platformId:ListSigningProfiles' :: Maybe Text
platformId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statuses:ListSigningProfiles' :: Maybe [SigningProfileStatus]
statuses = Maybe [SigningProfileStatus]
forall a. Maybe a
Prelude.Nothing,
      $sel:includeCanceled:ListSigningProfiles' :: Maybe Bool
includeCanceled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSigningProfiles' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Value for specifying the next set of paginated results to return. After
-- you receive a response with truncated results, use this parameter in a
-- subsequent request. Set it to the value of @nextToken@ from the response
-- that you just received.
listSigningProfiles_nextToken :: Lens.Lens' ListSigningProfiles (Prelude.Maybe Prelude.Text)
listSigningProfiles_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSigningProfiles -> f ListSigningProfiles
listSigningProfiles_nextToken = (ListSigningProfiles -> Maybe Text)
-> (ListSigningProfiles -> Maybe Text -> ListSigningProfiles)
-> Lens
     ListSigningProfiles ListSigningProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSigningProfiles' :: ListSigningProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSigningProfiles
s@ListSigningProfiles' {} Maybe Text
a -> ListSigningProfiles
s {$sel:nextToken:ListSigningProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: ListSigningProfiles)

-- | Filters results to return only signing jobs initiated for a specified
-- signing platform.
listSigningProfiles_platformId :: Lens.Lens' ListSigningProfiles (Prelude.Maybe Prelude.Text)
listSigningProfiles_platformId :: (Maybe Text -> f (Maybe Text))
-> ListSigningProfiles -> f ListSigningProfiles
listSigningProfiles_platformId = (ListSigningProfiles -> Maybe Text)
-> (ListSigningProfiles -> Maybe Text -> ListSigningProfiles)
-> Lens
     ListSigningProfiles ListSigningProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningProfiles' {Maybe Text
platformId :: Maybe Text
$sel:platformId:ListSigningProfiles' :: ListSigningProfiles -> Maybe Text
platformId} -> Maybe Text
platformId) (\s :: ListSigningProfiles
s@ListSigningProfiles' {} Maybe Text
a -> ListSigningProfiles
s {$sel:platformId:ListSigningProfiles' :: Maybe Text
platformId = Maybe Text
a} :: ListSigningProfiles)

-- | Filters results to return only signing jobs with statuses in the
-- specified list.
listSigningProfiles_statuses :: Lens.Lens' ListSigningProfiles (Prelude.Maybe [SigningProfileStatus])
listSigningProfiles_statuses :: (Maybe [SigningProfileStatus] -> f (Maybe [SigningProfileStatus]))
-> ListSigningProfiles -> f ListSigningProfiles
listSigningProfiles_statuses = (ListSigningProfiles -> Maybe [SigningProfileStatus])
-> (ListSigningProfiles
    -> Maybe [SigningProfileStatus] -> ListSigningProfiles)
-> Lens
     ListSigningProfiles
     ListSigningProfiles
     (Maybe [SigningProfileStatus])
     (Maybe [SigningProfileStatus])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningProfiles' {Maybe [SigningProfileStatus]
statuses :: Maybe [SigningProfileStatus]
$sel:statuses:ListSigningProfiles' :: ListSigningProfiles -> Maybe [SigningProfileStatus]
statuses} -> Maybe [SigningProfileStatus]
statuses) (\s :: ListSigningProfiles
s@ListSigningProfiles' {} Maybe [SigningProfileStatus]
a -> ListSigningProfiles
s {$sel:statuses:ListSigningProfiles' :: Maybe [SigningProfileStatus]
statuses = Maybe [SigningProfileStatus]
a} :: ListSigningProfiles) ((Maybe [SigningProfileStatus] -> f (Maybe [SigningProfileStatus]))
 -> ListSigningProfiles -> f ListSigningProfiles)
-> ((Maybe [SigningProfileStatus]
     -> f (Maybe [SigningProfileStatus]))
    -> Maybe [SigningProfileStatus]
    -> f (Maybe [SigningProfileStatus]))
-> (Maybe [SigningProfileStatus]
    -> f (Maybe [SigningProfileStatus]))
-> ListSigningProfiles
-> f ListSigningProfiles
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SigningProfileStatus]
  [SigningProfileStatus]
  [SigningProfileStatus]
  [SigningProfileStatus]
-> Iso
     (Maybe [SigningProfileStatus])
     (Maybe [SigningProfileStatus])
     (Maybe [SigningProfileStatus])
     (Maybe [SigningProfileStatus])
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
  [SigningProfileStatus]
  [SigningProfileStatus]
  [SigningProfileStatus]
  [SigningProfileStatus]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Designates whether to include profiles with the status of @CANCELED@.
listSigningProfiles_includeCanceled :: Lens.Lens' ListSigningProfiles (Prelude.Maybe Prelude.Bool)
listSigningProfiles_includeCanceled :: (Maybe Bool -> f (Maybe Bool))
-> ListSigningProfiles -> f ListSigningProfiles
listSigningProfiles_includeCanceled = (ListSigningProfiles -> Maybe Bool)
-> (ListSigningProfiles -> Maybe Bool -> ListSigningProfiles)
-> Lens
     ListSigningProfiles ListSigningProfiles (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningProfiles' {Maybe Bool
includeCanceled :: Maybe Bool
$sel:includeCanceled:ListSigningProfiles' :: ListSigningProfiles -> Maybe Bool
includeCanceled} -> Maybe Bool
includeCanceled) (\s :: ListSigningProfiles
s@ListSigningProfiles' {} Maybe Bool
a -> ListSigningProfiles
s {$sel:includeCanceled:ListSigningProfiles' :: Maybe Bool
includeCanceled = Maybe Bool
a} :: ListSigningProfiles)

-- | The maximum number of profiles to be returned.
listSigningProfiles_maxResults :: Lens.Lens' ListSigningProfiles (Prelude.Maybe Prelude.Natural)
listSigningProfiles_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListSigningProfiles -> f ListSigningProfiles
listSigningProfiles_maxResults = (ListSigningProfiles -> Maybe Natural)
-> (ListSigningProfiles -> Maybe Natural -> ListSigningProfiles)
-> Lens
     ListSigningProfiles
     ListSigningProfiles
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningProfiles' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSigningProfiles' :: ListSigningProfiles -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSigningProfiles
s@ListSigningProfiles' {} Maybe Natural
a -> ListSigningProfiles
s {$sel:maxResults:ListSigningProfiles' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSigningProfiles)

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

instance Prelude.NFData ListSigningProfiles

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

instance Core.ToQuery ListSigningProfiles where
  toQuery :: ListSigningProfiles -> QueryString
toQuery ListSigningProfiles' {Maybe Bool
Maybe Natural
Maybe [SigningProfileStatus]
Maybe Text
maxResults :: Maybe Natural
includeCanceled :: Maybe Bool
statuses :: Maybe [SigningProfileStatus]
platformId :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListSigningProfiles' :: ListSigningProfiles -> Maybe Natural
$sel:includeCanceled:ListSigningProfiles' :: ListSigningProfiles -> Maybe Bool
$sel:statuses:ListSigningProfiles' :: ListSigningProfiles -> Maybe [SigningProfileStatus]
$sel:platformId:ListSigningProfiles' :: ListSigningProfiles -> Maybe Text
$sel:nextToken:ListSigningProfiles' :: ListSigningProfiles -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"platformId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
platformId,
        ByteString
"statuses"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [SigningProfileStatus] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([SigningProfileStatus] -> QueryString)
-> Maybe [SigningProfileStatus] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SigningProfileStatus]
statuses),
        ByteString
"includeCanceled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
includeCanceled,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListSigningProfilesResponse' smart constructor.
data ListSigningProfilesResponse = ListSigningProfilesResponse'
  { -- | A list of profiles that are available in the AWS account. This includes
    -- profiles with the status of @CANCELED@ if the @includeCanceled@
    -- parameter is set to @true@.
    ListSigningProfilesResponse -> Maybe [SigningProfile]
profiles :: Prelude.Maybe [SigningProfile],
    -- | Value for specifying the next set of paginated results to return.
    ListSigningProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListSigningProfilesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSigningProfilesResponse -> ListSigningProfilesResponse -> Bool
(ListSigningProfilesResponse
 -> ListSigningProfilesResponse -> Bool)
-> (ListSigningProfilesResponse
    -> ListSigningProfilesResponse -> Bool)
-> Eq ListSigningProfilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSigningProfilesResponse -> ListSigningProfilesResponse -> Bool
$c/= :: ListSigningProfilesResponse -> ListSigningProfilesResponse -> Bool
== :: ListSigningProfilesResponse -> ListSigningProfilesResponse -> Bool
$c== :: ListSigningProfilesResponse -> ListSigningProfilesResponse -> Bool
Prelude.Eq, ReadPrec [ListSigningProfilesResponse]
ReadPrec ListSigningProfilesResponse
Int -> ReadS ListSigningProfilesResponse
ReadS [ListSigningProfilesResponse]
(Int -> ReadS ListSigningProfilesResponse)
-> ReadS [ListSigningProfilesResponse]
-> ReadPrec ListSigningProfilesResponse
-> ReadPrec [ListSigningProfilesResponse]
-> Read ListSigningProfilesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSigningProfilesResponse]
$creadListPrec :: ReadPrec [ListSigningProfilesResponse]
readPrec :: ReadPrec ListSigningProfilesResponse
$creadPrec :: ReadPrec ListSigningProfilesResponse
readList :: ReadS [ListSigningProfilesResponse]
$creadList :: ReadS [ListSigningProfilesResponse]
readsPrec :: Int -> ReadS ListSigningProfilesResponse
$creadsPrec :: Int -> ReadS ListSigningProfilesResponse
Prelude.Read, Int -> ListSigningProfilesResponse -> ShowS
[ListSigningProfilesResponse] -> ShowS
ListSigningProfilesResponse -> String
(Int -> ListSigningProfilesResponse -> ShowS)
-> (ListSigningProfilesResponse -> String)
-> ([ListSigningProfilesResponse] -> ShowS)
-> Show ListSigningProfilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSigningProfilesResponse] -> ShowS
$cshowList :: [ListSigningProfilesResponse] -> ShowS
show :: ListSigningProfilesResponse -> String
$cshow :: ListSigningProfilesResponse -> String
showsPrec :: Int -> ListSigningProfilesResponse -> ShowS
$cshowsPrec :: Int -> ListSigningProfilesResponse -> ShowS
Prelude.Show, (forall x.
 ListSigningProfilesResponse -> Rep ListSigningProfilesResponse x)
-> (forall x.
    Rep ListSigningProfilesResponse x -> ListSigningProfilesResponse)
-> Generic ListSigningProfilesResponse
forall x.
Rep ListSigningProfilesResponse x -> ListSigningProfilesResponse
forall x.
ListSigningProfilesResponse -> Rep ListSigningProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSigningProfilesResponse x -> ListSigningProfilesResponse
$cfrom :: forall x.
ListSigningProfilesResponse -> Rep ListSigningProfilesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSigningProfilesResponse' 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:
--
-- 'profiles', 'listSigningProfilesResponse_profiles' - A list of profiles that are available in the AWS account. This includes
-- profiles with the status of @CANCELED@ if the @includeCanceled@
-- parameter is set to @true@.
--
-- 'nextToken', 'listSigningProfilesResponse_nextToken' - Value for specifying the next set of paginated results to return.
--
-- 'httpStatus', 'listSigningProfilesResponse_httpStatus' - The response's http status code.
newListSigningProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSigningProfilesResponse
newListSigningProfilesResponse :: Int -> ListSigningProfilesResponse
newListSigningProfilesResponse Int
pHttpStatus_ =
  ListSigningProfilesResponse' :: Maybe [SigningProfile]
-> Maybe Text -> Int -> ListSigningProfilesResponse
ListSigningProfilesResponse'
    { $sel:profiles:ListSigningProfilesResponse' :: Maybe [SigningProfile]
profiles =
        Maybe [SigningProfile]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSigningProfilesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSigningProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of profiles that are available in the AWS account. This includes
-- profiles with the status of @CANCELED@ if the @includeCanceled@
-- parameter is set to @true@.
listSigningProfilesResponse_profiles :: Lens.Lens' ListSigningProfilesResponse (Prelude.Maybe [SigningProfile])
listSigningProfilesResponse_profiles :: (Maybe [SigningProfile] -> f (Maybe [SigningProfile]))
-> ListSigningProfilesResponse -> f ListSigningProfilesResponse
listSigningProfilesResponse_profiles = (ListSigningProfilesResponse -> Maybe [SigningProfile])
-> (ListSigningProfilesResponse
    -> Maybe [SigningProfile] -> ListSigningProfilesResponse)
-> Lens' ListSigningProfilesResponse (Maybe [SigningProfile])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningProfilesResponse' {Maybe [SigningProfile]
profiles :: Maybe [SigningProfile]
$sel:profiles:ListSigningProfilesResponse' :: ListSigningProfilesResponse -> Maybe [SigningProfile]
profiles} -> Maybe [SigningProfile]
profiles) (\s :: ListSigningProfilesResponse
s@ListSigningProfilesResponse' {} Maybe [SigningProfile]
a -> ListSigningProfilesResponse
s {$sel:profiles:ListSigningProfilesResponse' :: Maybe [SigningProfile]
profiles = Maybe [SigningProfile]
a} :: ListSigningProfilesResponse) ((Maybe [SigningProfile] -> f (Maybe [SigningProfile]))
 -> ListSigningProfilesResponse -> f ListSigningProfilesResponse)
-> ((Maybe [SigningProfile] -> f (Maybe [SigningProfile]))
    -> Maybe [SigningProfile] -> f (Maybe [SigningProfile]))
-> (Maybe [SigningProfile] -> f (Maybe [SigningProfile]))
-> ListSigningProfilesResponse
-> f ListSigningProfilesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SigningProfile] [SigningProfile] [SigningProfile] [SigningProfile]
-> Iso
     (Maybe [SigningProfile])
     (Maybe [SigningProfile])
     (Maybe [SigningProfile])
     (Maybe [SigningProfile])
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
  [SigningProfile] [SigningProfile] [SigningProfile] [SigningProfile]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Value for specifying the next set of paginated results to return.
listSigningProfilesResponse_nextToken :: Lens.Lens' ListSigningProfilesResponse (Prelude.Maybe Prelude.Text)
listSigningProfilesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSigningProfilesResponse -> f ListSigningProfilesResponse
listSigningProfilesResponse_nextToken = (ListSigningProfilesResponse -> Maybe Text)
-> (ListSigningProfilesResponse
    -> Maybe Text -> ListSigningProfilesResponse)
-> Lens' ListSigningProfilesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSigningProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSigningProfilesResponse' :: ListSigningProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSigningProfilesResponse
s@ListSigningProfilesResponse' {} Maybe Text
a -> ListSigningProfilesResponse
s {$sel:nextToken:ListSigningProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSigningProfilesResponse)

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

instance Prelude.NFData ListSigningProfilesResponse