{-# 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.CodeBuild.ListSourceCredentials
(
ListSourceCredentials (..),
newListSourceCredentials,
ListSourceCredentialsResponse (..),
newListSourceCredentialsResponse,
listSourceCredentialsResponse_sourceCredentialsInfos,
listSourceCredentialsResponse_httpStatus,
)
where
import Amazonka.CodeBuild.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListSourceCredentials = ListSourceCredentials'
{
}
deriving (ListSourceCredentials -> ListSourceCredentials -> Bool
(ListSourceCredentials -> ListSourceCredentials -> Bool)
-> (ListSourceCredentials -> ListSourceCredentials -> Bool)
-> Eq ListSourceCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSourceCredentials -> ListSourceCredentials -> Bool
$c/= :: ListSourceCredentials -> ListSourceCredentials -> Bool
== :: ListSourceCredentials -> ListSourceCredentials -> Bool
$c== :: ListSourceCredentials -> ListSourceCredentials -> Bool
Prelude.Eq, ReadPrec [ListSourceCredentials]
ReadPrec ListSourceCredentials
Int -> ReadS ListSourceCredentials
ReadS [ListSourceCredentials]
(Int -> ReadS ListSourceCredentials)
-> ReadS [ListSourceCredentials]
-> ReadPrec ListSourceCredentials
-> ReadPrec [ListSourceCredentials]
-> Read ListSourceCredentials
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSourceCredentials]
$creadListPrec :: ReadPrec [ListSourceCredentials]
readPrec :: ReadPrec ListSourceCredentials
$creadPrec :: ReadPrec ListSourceCredentials
readList :: ReadS [ListSourceCredentials]
$creadList :: ReadS [ListSourceCredentials]
readsPrec :: Int -> ReadS ListSourceCredentials
$creadsPrec :: Int -> ReadS ListSourceCredentials
Prelude.Read, Int -> ListSourceCredentials -> ShowS
[ListSourceCredentials] -> ShowS
ListSourceCredentials -> String
(Int -> ListSourceCredentials -> ShowS)
-> (ListSourceCredentials -> String)
-> ([ListSourceCredentials] -> ShowS)
-> Show ListSourceCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSourceCredentials] -> ShowS
$cshowList :: [ListSourceCredentials] -> ShowS
show :: ListSourceCredentials -> String
$cshow :: ListSourceCredentials -> String
showsPrec :: Int -> ListSourceCredentials -> ShowS
$cshowsPrec :: Int -> ListSourceCredentials -> ShowS
Prelude.Show, (forall x. ListSourceCredentials -> Rep ListSourceCredentials x)
-> (forall x. Rep ListSourceCredentials x -> ListSourceCredentials)
-> Generic ListSourceCredentials
forall x. Rep ListSourceCredentials x -> ListSourceCredentials
forall x. ListSourceCredentials -> Rep ListSourceCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSourceCredentials x -> ListSourceCredentials
$cfrom :: forall x. ListSourceCredentials -> Rep ListSourceCredentials x
Prelude.Generic)
newListSourceCredentials ::
ListSourceCredentials
newListSourceCredentials :: ListSourceCredentials
newListSourceCredentials = ListSourceCredentials
ListSourceCredentials'
instance Core.AWSRequest ListSourceCredentials where
type
AWSResponse ListSourceCredentials =
ListSourceCredentialsResponse
request :: ListSourceCredentials -> Request ListSourceCredentials
request = Service -> ListSourceCredentials -> Request ListSourceCredentials
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListSourceCredentials
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListSourceCredentials)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListSourceCredentials))
-> Logger
-> Service
-> Proxy ListSourceCredentials
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListSourceCredentials)))
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 [SourceCredentialsInfo]
-> Int -> ListSourceCredentialsResponse
ListSourceCredentialsResponse'
(Maybe [SourceCredentialsInfo]
-> Int -> ListSourceCredentialsResponse)
-> Either String (Maybe [SourceCredentialsInfo])
-> Either String (Int -> ListSourceCredentialsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Key -> Either String (Maybe (Maybe [SourceCredentialsInfo]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"sourceCredentialsInfos"
Either String (Maybe (Maybe [SourceCredentialsInfo]))
-> Maybe [SourceCredentialsInfo]
-> Either String (Maybe [SourceCredentialsInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SourceCredentialsInfo]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListSourceCredentialsResponse)
-> Either String Int -> Either String ListSourceCredentialsResponse
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 ListSourceCredentials
instance Prelude.NFData ListSourceCredentials
instance Core.ToHeaders ListSourceCredentials where
toHeaders :: ListSourceCredentials -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListSourceCredentials -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeBuild_20161006.ListSourceCredentials" ::
Prelude.ByteString
),
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.ToJSON ListSourceCredentials where
toJSON :: ListSourceCredentials -> Value
toJSON = Value -> ListSourceCredentials -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath ListSourceCredentials where
toPath :: ListSourceCredentials -> ByteString
toPath = ByteString -> ListSourceCredentials -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListSourceCredentials where
toQuery :: ListSourceCredentials -> QueryString
toQuery = QueryString -> ListSourceCredentials -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListSourceCredentialsResponse = ListSourceCredentialsResponse'
{
ListSourceCredentialsResponse -> Maybe [SourceCredentialsInfo]
sourceCredentialsInfos :: Prelude.Maybe [SourceCredentialsInfo],
ListSourceCredentialsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListSourceCredentialsResponse
-> ListSourceCredentialsResponse -> Bool
(ListSourceCredentialsResponse
-> ListSourceCredentialsResponse -> Bool)
-> (ListSourceCredentialsResponse
-> ListSourceCredentialsResponse -> Bool)
-> Eq ListSourceCredentialsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSourceCredentialsResponse
-> ListSourceCredentialsResponse -> Bool
$c/= :: ListSourceCredentialsResponse
-> ListSourceCredentialsResponse -> Bool
== :: ListSourceCredentialsResponse
-> ListSourceCredentialsResponse -> Bool
$c== :: ListSourceCredentialsResponse
-> ListSourceCredentialsResponse -> Bool
Prelude.Eq, ReadPrec [ListSourceCredentialsResponse]
ReadPrec ListSourceCredentialsResponse
Int -> ReadS ListSourceCredentialsResponse
ReadS [ListSourceCredentialsResponse]
(Int -> ReadS ListSourceCredentialsResponse)
-> ReadS [ListSourceCredentialsResponse]
-> ReadPrec ListSourceCredentialsResponse
-> ReadPrec [ListSourceCredentialsResponse]
-> Read ListSourceCredentialsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSourceCredentialsResponse]
$creadListPrec :: ReadPrec [ListSourceCredentialsResponse]
readPrec :: ReadPrec ListSourceCredentialsResponse
$creadPrec :: ReadPrec ListSourceCredentialsResponse
readList :: ReadS [ListSourceCredentialsResponse]
$creadList :: ReadS [ListSourceCredentialsResponse]
readsPrec :: Int -> ReadS ListSourceCredentialsResponse
$creadsPrec :: Int -> ReadS ListSourceCredentialsResponse
Prelude.Read, Int -> ListSourceCredentialsResponse -> ShowS
[ListSourceCredentialsResponse] -> ShowS
ListSourceCredentialsResponse -> String
(Int -> ListSourceCredentialsResponse -> ShowS)
-> (ListSourceCredentialsResponse -> String)
-> ([ListSourceCredentialsResponse] -> ShowS)
-> Show ListSourceCredentialsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSourceCredentialsResponse] -> ShowS
$cshowList :: [ListSourceCredentialsResponse] -> ShowS
show :: ListSourceCredentialsResponse -> String
$cshow :: ListSourceCredentialsResponse -> String
showsPrec :: Int -> ListSourceCredentialsResponse -> ShowS
$cshowsPrec :: Int -> ListSourceCredentialsResponse -> ShowS
Prelude.Show, (forall x.
ListSourceCredentialsResponse
-> Rep ListSourceCredentialsResponse x)
-> (forall x.
Rep ListSourceCredentialsResponse x
-> ListSourceCredentialsResponse)
-> Generic ListSourceCredentialsResponse
forall x.
Rep ListSourceCredentialsResponse x
-> ListSourceCredentialsResponse
forall x.
ListSourceCredentialsResponse
-> Rep ListSourceCredentialsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSourceCredentialsResponse x
-> ListSourceCredentialsResponse
$cfrom :: forall x.
ListSourceCredentialsResponse
-> Rep ListSourceCredentialsResponse x
Prelude.Generic)
newListSourceCredentialsResponse ::
Prelude.Int ->
ListSourceCredentialsResponse
newListSourceCredentialsResponse :: Int -> ListSourceCredentialsResponse
newListSourceCredentialsResponse Int
pHttpStatus_ =
ListSourceCredentialsResponse' :: Maybe [SourceCredentialsInfo]
-> Int -> ListSourceCredentialsResponse
ListSourceCredentialsResponse'
{ $sel:sourceCredentialsInfos:ListSourceCredentialsResponse' :: Maybe [SourceCredentialsInfo]
sourceCredentialsInfos =
Maybe [SourceCredentialsInfo]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListSourceCredentialsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listSourceCredentialsResponse_sourceCredentialsInfos :: Lens.Lens' ListSourceCredentialsResponse (Prelude.Maybe [SourceCredentialsInfo])
listSourceCredentialsResponse_sourceCredentialsInfos :: (Maybe [SourceCredentialsInfo]
-> f (Maybe [SourceCredentialsInfo]))
-> ListSourceCredentialsResponse -> f ListSourceCredentialsResponse
listSourceCredentialsResponse_sourceCredentialsInfos = (ListSourceCredentialsResponse -> Maybe [SourceCredentialsInfo])
-> (ListSourceCredentialsResponse
-> Maybe [SourceCredentialsInfo] -> ListSourceCredentialsResponse)
-> Lens
ListSourceCredentialsResponse
ListSourceCredentialsResponse
(Maybe [SourceCredentialsInfo])
(Maybe [SourceCredentialsInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSourceCredentialsResponse' {Maybe [SourceCredentialsInfo]
sourceCredentialsInfos :: Maybe [SourceCredentialsInfo]
$sel:sourceCredentialsInfos:ListSourceCredentialsResponse' :: ListSourceCredentialsResponse -> Maybe [SourceCredentialsInfo]
sourceCredentialsInfos} -> Maybe [SourceCredentialsInfo]
sourceCredentialsInfos) (\s :: ListSourceCredentialsResponse
s@ListSourceCredentialsResponse' {} Maybe [SourceCredentialsInfo]
a -> ListSourceCredentialsResponse
s {$sel:sourceCredentialsInfos:ListSourceCredentialsResponse' :: Maybe [SourceCredentialsInfo]
sourceCredentialsInfos = Maybe [SourceCredentialsInfo]
a} :: ListSourceCredentialsResponse) ((Maybe [SourceCredentialsInfo]
-> f (Maybe [SourceCredentialsInfo]))
-> ListSourceCredentialsResponse
-> f ListSourceCredentialsResponse)
-> ((Maybe [SourceCredentialsInfo]
-> f (Maybe [SourceCredentialsInfo]))
-> Maybe [SourceCredentialsInfo]
-> f (Maybe [SourceCredentialsInfo]))
-> (Maybe [SourceCredentialsInfo]
-> f (Maybe [SourceCredentialsInfo]))
-> ListSourceCredentialsResponse
-> f ListSourceCredentialsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SourceCredentialsInfo]
[SourceCredentialsInfo]
[SourceCredentialsInfo]
[SourceCredentialsInfo]
-> Iso
(Maybe [SourceCredentialsInfo])
(Maybe [SourceCredentialsInfo])
(Maybe [SourceCredentialsInfo])
(Maybe [SourceCredentialsInfo])
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
[SourceCredentialsInfo]
[SourceCredentialsInfo]
[SourceCredentialsInfo]
[SourceCredentialsInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listSourceCredentialsResponse_httpStatus :: Lens.Lens' ListSourceCredentialsResponse Prelude.Int
listSourceCredentialsResponse_httpStatus :: (Int -> f Int)
-> ListSourceCredentialsResponse -> f ListSourceCredentialsResponse
listSourceCredentialsResponse_httpStatus = (ListSourceCredentialsResponse -> Int)
-> (ListSourceCredentialsResponse
-> Int -> ListSourceCredentialsResponse)
-> Lens
ListSourceCredentialsResponse ListSourceCredentialsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSourceCredentialsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSourceCredentialsResponse' :: ListSourceCredentialsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSourceCredentialsResponse
s@ListSourceCredentialsResponse' {} Int
a -> ListSourceCredentialsResponse
s {$sel:httpStatus:ListSourceCredentialsResponse' :: Int
httpStatus = Int
a} :: ListSourceCredentialsResponse)
instance Prelude.NFData ListSourceCredentialsResponse