{-# 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 #-}
module Amazonka.AppConfig.ListConfigurationProfiles
(
ListConfigurationProfiles (..),
newListConfigurationProfiles,
listConfigurationProfiles_maxResults,
listConfigurationProfiles_nextToken,
listConfigurationProfiles_type,
listConfigurationProfiles_applicationId,
ListConfigurationProfilesResponse (..),
newListConfigurationProfilesResponse,
listConfigurationProfilesResponse_items,
listConfigurationProfilesResponse_nextToken,
listConfigurationProfilesResponse_httpStatus,
)
where
import Amazonka.AppConfig.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListConfigurationProfiles = ListConfigurationProfiles'
{
ListConfigurationProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListConfigurationProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListConfigurationProfiles -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
ListConfigurationProfiles -> Text
applicationId :: Prelude.Text
}
deriving (ListConfigurationProfiles -> ListConfigurationProfiles -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConfigurationProfiles -> ListConfigurationProfiles -> Bool
$c/= :: ListConfigurationProfiles -> ListConfigurationProfiles -> Bool
== :: ListConfigurationProfiles -> ListConfigurationProfiles -> Bool
$c== :: ListConfigurationProfiles -> ListConfigurationProfiles -> Bool
Prelude.Eq, ReadPrec [ListConfigurationProfiles]
ReadPrec ListConfigurationProfiles
Int -> ReadS ListConfigurationProfiles
ReadS [ListConfigurationProfiles]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConfigurationProfiles]
$creadListPrec :: ReadPrec [ListConfigurationProfiles]
readPrec :: ReadPrec ListConfigurationProfiles
$creadPrec :: ReadPrec ListConfigurationProfiles
readList :: ReadS [ListConfigurationProfiles]
$creadList :: ReadS [ListConfigurationProfiles]
readsPrec :: Int -> ReadS ListConfigurationProfiles
$creadsPrec :: Int -> ReadS ListConfigurationProfiles
Prelude.Read, Int -> ListConfigurationProfiles -> ShowS
[ListConfigurationProfiles] -> ShowS
ListConfigurationProfiles -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConfigurationProfiles] -> ShowS
$cshowList :: [ListConfigurationProfiles] -> ShowS
show :: ListConfigurationProfiles -> String
$cshow :: ListConfigurationProfiles -> String
showsPrec :: Int -> ListConfigurationProfiles -> ShowS
$cshowsPrec :: Int -> ListConfigurationProfiles -> ShowS
Prelude.Show, forall x.
Rep ListConfigurationProfiles x -> ListConfigurationProfiles
forall x.
ListConfigurationProfiles -> Rep ListConfigurationProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListConfigurationProfiles x -> ListConfigurationProfiles
$cfrom :: forall x.
ListConfigurationProfiles -> Rep ListConfigurationProfiles x
Prelude.Generic)
newListConfigurationProfiles ::
Prelude.Text ->
ListConfigurationProfiles
newListConfigurationProfiles :: Text -> ListConfigurationProfiles
newListConfigurationProfiles Text
pApplicationId_ =
ListConfigurationProfiles'
{ $sel:maxResults:ListConfigurationProfiles' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListConfigurationProfiles' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:type':ListConfigurationProfiles' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing,
$sel:applicationId:ListConfigurationProfiles' :: Text
applicationId = Text
pApplicationId_
}
listConfigurationProfiles_maxResults :: Lens.Lens' ListConfigurationProfiles (Prelude.Maybe Prelude.Natural)
listConfigurationProfiles_maxResults :: Lens' ListConfigurationProfiles (Maybe Natural)
listConfigurationProfiles_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationProfiles' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListConfigurationProfiles
s@ListConfigurationProfiles' {} Maybe Natural
a -> ListConfigurationProfiles
s {$sel:maxResults:ListConfigurationProfiles' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListConfigurationProfiles)
listConfigurationProfiles_nextToken :: Lens.Lens' ListConfigurationProfiles (Prelude.Maybe Prelude.Text)
listConfigurationProfiles_nextToken :: Lens' ListConfigurationProfiles (Maybe Text)
listConfigurationProfiles_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConfigurationProfiles
s@ListConfigurationProfiles' {} Maybe Text
a -> ListConfigurationProfiles
s {$sel:nextToken:ListConfigurationProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: ListConfigurationProfiles)
listConfigurationProfiles_type :: Lens.Lens' ListConfigurationProfiles (Prelude.Maybe Prelude.Text)
listConfigurationProfiles_type :: Lens' ListConfigurationProfiles (Maybe Text)
listConfigurationProfiles_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationProfiles' {Maybe Text
type' :: Maybe Text
$sel:type':ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
type'} -> Maybe Text
type') (\s :: ListConfigurationProfiles
s@ListConfigurationProfiles' {} Maybe Text
a -> ListConfigurationProfiles
s {$sel:type':ListConfigurationProfiles' :: Maybe Text
type' = Maybe Text
a} :: ListConfigurationProfiles)
listConfigurationProfiles_applicationId :: Lens.Lens' ListConfigurationProfiles Prelude.Text
listConfigurationProfiles_applicationId :: Lens' ListConfigurationProfiles Text
listConfigurationProfiles_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationProfiles' {Text
applicationId :: Text
$sel:applicationId:ListConfigurationProfiles' :: ListConfigurationProfiles -> Text
applicationId} -> Text
applicationId) (\s :: ListConfigurationProfiles
s@ListConfigurationProfiles' {} Text
a -> ListConfigurationProfiles
s {$sel:applicationId:ListConfigurationProfiles' :: Text
applicationId = Text
a} :: ListConfigurationProfiles)
instance Core.AWSRequest ListConfigurationProfiles where
type
AWSResponse ListConfigurationProfiles =
ListConfigurationProfilesResponse
request :: (Service -> Service)
-> ListConfigurationProfiles -> Request ListConfigurationProfiles
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListConfigurationProfiles
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListConfigurationProfiles)))
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 [ConfigurationProfileSummary]
-> Maybe Text -> Int -> ListConfigurationProfilesResponse
ListConfigurationProfilesResponse'
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
"Items" 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 ListConfigurationProfiles where
hashWithSalt :: Int -> ListConfigurationProfiles -> Int
hashWithSalt Int
_salt ListConfigurationProfiles' {Maybe Natural
Maybe Text
Text
applicationId :: Text
type' :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:applicationId:ListConfigurationProfiles' :: ListConfigurationProfiles -> Text
$sel:type':ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:nextToken:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:maxResults:ListConfigurationProfiles' :: ListConfigurationProfiles -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
instance Prelude.NFData ListConfigurationProfiles where
rnf :: ListConfigurationProfiles -> ()
rnf ListConfigurationProfiles' {Maybe Natural
Maybe Text
Text
applicationId :: Text
type' :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:applicationId:ListConfigurationProfiles' :: ListConfigurationProfiles -> Text
$sel:type':ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:nextToken:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:maxResults:ListConfigurationProfiles' :: ListConfigurationProfiles -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId
instance Data.ToHeaders ListConfigurationProfiles where
toHeaders :: ListConfigurationProfiles -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListConfigurationProfiles where
toPath :: ListConfigurationProfiles -> ByteString
toPath ListConfigurationProfiles' {Maybe Natural
Maybe Text
Text
applicationId :: Text
type' :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:applicationId:ListConfigurationProfiles' :: ListConfigurationProfiles -> Text
$sel:type':ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:nextToken:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:maxResults:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/applications/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationId,
ByteString
"/configurationprofiles"
]
instance Data.ToQuery ListConfigurationProfiles where
toQuery :: ListConfigurationProfiles -> QueryString
toQuery ListConfigurationProfiles' {Maybe Natural
Maybe Text
Text
applicationId :: Text
type' :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:applicationId:ListConfigurationProfiles' :: ListConfigurationProfiles -> Text
$sel:type':ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:nextToken:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Text
$sel:maxResults:ListConfigurationProfiles' :: ListConfigurationProfiles -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"max_results" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"next_token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"type" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
type'
]
data ListConfigurationProfilesResponse = ListConfigurationProfilesResponse'
{
ListConfigurationProfilesResponse
-> Maybe [ConfigurationProfileSummary]
items :: Prelude.Maybe [ConfigurationProfileSummary],
ListConfigurationProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListConfigurationProfilesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListConfigurationProfilesResponse
-> ListConfigurationProfilesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConfigurationProfilesResponse
-> ListConfigurationProfilesResponse -> Bool
$c/= :: ListConfigurationProfilesResponse
-> ListConfigurationProfilesResponse -> Bool
== :: ListConfigurationProfilesResponse
-> ListConfigurationProfilesResponse -> Bool
$c== :: ListConfigurationProfilesResponse
-> ListConfigurationProfilesResponse -> Bool
Prelude.Eq, ReadPrec [ListConfigurationProfilesResponse]
ReadPrec ListConfigurationProfilesResponse
Int -> ReadS ListConfigurationProfilesResponse
ReadS [ListConfigurationProfilesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConfigurationProfilesResponse]
$creadListPrec :: ReadPrec [ListConfigurationProfilesResponse]
readPrec :: ReadPrec ListConfigurationProfilesResponse
$creadPrec :: ReadPrec ListConfigurationProfilesResponse
readList :: ReadS [ListConfigurationProfilesResponse]
$creadList :: ReadS [ListConfigurationProfilesResponse]
readsPrec :: Int -> ReadS ListConfigurationProfilesResponse
$creadsPrec :: Int -> ReadS ListConfigurationProfilesResponse
Prelude.Read, Int -> ListConfigurationProfilesResponse -> ShowS
[ListConfigurationProfilesResponse] -> ShowS
ListConfigurationProfilesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConfigurationProfilesResponse] -> ShowS
$cshowList :: [ListConfigurationProfilesResponse] -> ShowS
show :: ListConfigurationProfilesResponse -> String
$cshow :: ListConfigurationProfilesResponse -> String
showsPrec :: Int -> ListConfigurationProfilesResponse -> ShowS
$cshowsPrec :: Int -> ListConfigurationProfilesResponse -> ShowS
Prelude.Show, forall x.
Rep ListConfigurationProfilesResponse x
-> ListConfigurationProfilesResponse
forall x.
ListConfigurationProfilesResponse
-> Rep ListConfigurationProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListConfigurationProfilesResponse x
-> ListConfigurationProfilesResponse
$cfrom :: forall x.
ListConfigurationProfilesResponse
-> Rep ListConfigurationProfilesResponse x
Prelude.Generic)
newListConfigurationProfilesResponse ::
Prelude.Int ->
ListConfigurationProfilesResponse
newListConfigurationProfilesResponse :: Int -> ListConfigurationProfilesResponse
newListConfigurationProfilesResponse Int
pHttpStatus_ =
ListConfigurationProfilesResponse'
{ $sel:items:ListConfigurationProfilesResponse' :: Maybe [ConfigurationProfileSummary]
items =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListConfigurationProfilesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListConfigurationProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listConfigurationProfilesResponse_items :: Lens.Lens' ListConfigurationProfilesResponse (Prelude.Maybe [ConfigurationProfileSummary])
listConfigurationProfilesResponse_items :: Lens'
ListConfigurationProfilesResponse
(Maybe [ConfigurationProfileSummary])
listConfigurationProfilesResponse_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationProfilesResponse' {Maybe [ConfigurationProfileSummary]
items :: Maybe [ConfigurationProfileSummary]
$sel:items:ListConfigurationProfilesResponse' :: ListConfigurationProfilesResponse
-> Maybe [ConfigurationProfileSummary]
items} -> Maybe [ConfigurationProfileSummary]
items) (\s :: ListConfigurationProfilesResponse
s@ListConfigurationProfilesResponse' {} Maybe [ConfigurationProfileSummary]
a -> ListConfigurationProfilesResponse
s {$sel:items:ListConfigurationProfilesResponse' :: Maybe [ConfigurationProfileSummary]
items = Maybe [ConfigurationProfileSummary]
a} :: ListConfigurationProfilesResponse) 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
listConfigurationProfilesResponse_nextToken :: Lens.Lens' ListConfigurationProfilesResponse (Prelude.Maybe Prelude.Text)
listConfigurationProfilesResponse_nextToken :: Lens' ListConfigurationProfilesResponse (Maybe Text)
listConfigurationProfilesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConfigurationProfilesResponse' :: ListConfigurationProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConfigurationProfilesResponse
s@ListConfigurationProfilesResponse' {} Maybe Text
a -> ListConfigurationProfilesResponse
s {$sel:nextToken:ListConfigurationProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListConfigurationProfilesResponse)
listConfigurationProfilesResponse_httpStatus :: Lens.Lens' ListConfigurationProfilesResponse Prelude.Int
listConfigurationProfilesResponse_httpStatus :: Lens' ListConfigurationProfilesResponse Int
listConfigurationProfilesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationProfilesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListConfigurationProfilesResponse' :: ListConfigurationProfilesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListConfigurationProfilesResponse
s@ListConfigurationProfilesResponse' {} Int
a -> ListConfigurationProfilesResponse
s {$sel:httpStatus:ListConfigurationProfilesResponse' :: Int
httpStatus = Int
a} :: ListConfigurationProfilesResponse)
instance
Prelude.NFData
ListConfigurationProfilesResponse
where
rnf :: ListConfigurationProfilesResponse -> ()
rnf ListConfigurationProfilesResponse' {Int
Maybe [ConfigurationProfileSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
items :: Maybe [ConfigurationProfileSummary]
$sel:httpStatus:ListConfigurationProfilesResponse' :: ListConfigurationProfilesResponse -> Int
$sel:nextToken:ListConfigurationProfilesResponse' :: ListConfigurationProfilesResponse -> Maybe Text
$sel:items:ListConfigurationProfilesResponse' :: ListConfigurationProfilesResponse
-> Maybe [ConfigurationProfileSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConfigurationProfileSummary]
items
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