{-# 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.GetReportGroupTrend
(
GetReportGroupTrend (..),
newGetReportGroupTrend,
getReportGroupTrend_numOfReports,
getReportGroupTrend_reportGroupArn,
getReportGroupTrend_trendField,
GetReportGroupTrendResponse (..),
newGetReportGroupTrendResponse,
getReportGroupTrendResponse_rawData,
getReportGroupTrendResponse_stats,
getReportGroupTrendResponse_httpStatus,
)
where
import Amazonka.CodeBuild.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 GetReportGroupTrend = GetReportGroupTrend'
{
GetReportGroupTrend -> Maybe Natural
numOfReports :: Prelude.Maybe Prelude.Natural,
GetReportGroupTrend -> Text
reportGroupArn :: Prelude.Text,
GetReportGroupTrend -> ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
}
deriving (GetReportGroupTrend -> GetReportGroupTrend -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
$c/= :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
== :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
$c== :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
Prelude.Eq, ReadPrec [GetReportGroupTrend]
ReadPrec GetReportGroupTrend
Int -> ReadS GetReportGroupTrend
ReadS [GetReportGroupTrend]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReportGroupTrend]
$creadListPrec :: ReadPrec [GetReportGroupTrend]
readPrec :: ReadPrec GetReportGroupTrend
$creadPrec :: ReadPrec GetReportGroupTrend
readList :: ReadS [GetReportGroupTrend]
$creadList :: ReadS [GetReportGroupTrend]
readsPrec :: Int -> ReadS GetReportGroupTrend
$creadsPrec :: Int -> ReadS GetReportGroupTrend
Prelude.Read, Int -> GetReportGroupTrend -> ShowS
[GetReportGroupTrend] -> ShowS
GetReportGroupTrend -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReportGroupTrend] -> ShowS
$cshowList :: [GetReportGroupTrend] -> ShowS
show :: GetReportGroupTrend -> String
$cshow :: GetReportGroupTrend -> String
showsPrec :: Int -> GetReportGroupTrend -> ShowS
$cshowsPrec :: Int -> GetReportGroupTrend -> ShowS
Prelude.Show, forall x. Rep GetReportGroupTrend x -> GetReportGroupTrend
forall x. GetReportGroupTrend -> Rep GetReportGroupTrend x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetReportGroupTrend x -> GetReportGroupTrend
$cfrom :: forall x. GetReportGroupTrend -> Rep GetReportGroupTrend x
Prelude.Generic)
newGetReportGroupTrend ::
Prelude.Text ->
ReportGroupTrendFieldType ->
GetReportGroupTrend
newGetReportGroupTrend :: Text -> ReportGroupTrendFieldType -> GetReportGroupTrend
newGetReportGroupTrend Text
pReportGroupArn_ ReportGroupTrendFieldType
pTrendField_ =
GetReportGroupTrend'
{ $sel:numOfReports:GetReportGroupTrend' :: Maybe Natural
numOfReports =
forall a. Maybe a
Prelude.Nothing,
$sel:reportGroupArn:GetReportGroupTrend' :: Text
reportGroupArn = Text
pReportGroupArn_,
$sel:trendField:GetReportGroupTrend' :: ReportGroupTrendFieldType
trendField = ReportGroupTrendFieldType
pTrendField_
}
getReportGroupTrend_numOfReports :: Lens.Lens' GetReportGroupTrend (Prelude.Maybe Prelude.Natural)
getReportGroupTrend_numOfReports :: Lens' GetReportGroupTrend (Maybe Natural)
getReportGroupTrend_numOfReports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrend' {Maybe Natural
numOfReports :: Maybe Natural
$sel:numOfReports:GetReportGroupTrend' :: GetReportGroupTrend -> Maybe Natural
numOfReports} -> Maybe Natural
numOfReports) (\s :: GetReportGroupTrend
s@GetReportGroupTrend' {} Maybe Natural
a -> GetReportGroupTrend
s {$sel:numOfReports:GetReportGroupTrend' :: Maybe Natural
numOfReports = Maybe Natural
a} :: GetReportGroupTrend)
getReportGroupTrend_reportGroupArn :: Lens.Lens' GetReportGroupTrend Prelude.Text
getReportGroupTrend_reportGroupArn :: Lens' GetReportGroupTrend Text
getReportGroupTrend_reportGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrend' {Text
reportGroupArn :: Text
$sel:reportGroupArn:GetReportGroupTrend' :: GetReportGroupTrend -> Text
reportGroupArn} -> Text
reportGroupArn) (\s :: GetReportGroupTrend
s@GetReportGroupTrend' {} Text
a -> GetReportGroupTrend
s {$sel:reportGroupArn:GetReportGroupTrend' :: Text
reportGroupArn = Text
a} :: GetReportGroupTrend)
getReportGroupTrend_trendField :: Lens.Lens' GetReportGroupTrend ReportGroupTrendFieldType
getReportGroupTrend_trendField :: Lens' GetReportGroupTrend ReportGroupTrendFieldType
getReportGroupTrend_trendField = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrend' {ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
$sel:trendField:GetReportGroupTrend' :: GetReportGroupTrend -> ReportGroupTrendFieldType
trendField} -> ReportGroupTrendFieldType
trendField) (\s :: GetReportGroupTrend
s@GetReportGroupTrend' {} ReportGroupTrendFieldType
a -> GetReportGroupTrend
s {$sel:trendField:GetReportGroupTrend' :: ReportGroupTrendFieldType
trendField = ReportGroupTrendFieldType
a} :: GetReportGroupTrend)
instance Core.AWSRequest GetReportGroupTrend where
type
AWSResponse GetReportGroupTrend =
GetReportGroupTrendResponse
request :: (Service -> Service)
-> GetReportGroupTrend -> Request GetReportGroupTrend
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 GetReportGroupTrend
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetReportGroupTrend)))
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 [ReportWithRawData]
-> Maybe ReportGroupTrendStats
-> Int
-> GetReportGroupTrendResponse
GetReportGroupTrendResponse'
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
"rawData" 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
"stats")
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 GetReportGroupTrend where
hashWithSalt :: Int -> GetReportGroupTrend -> Int
hashWithSalt Int
_salt GetReportGroupTrend' {Maybe Natural
Text
ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
reportGroupArn :: Text
numOfReports :: Maybe Natural
$sel:trendField:GetReportGroupTrend' :: GetReportGroupTrend -> ReportGroupTrendFieldType
$sel:reportGroupArn:GetReportGroupTrend' :: GetReportGroupTrend -> Text
$sel:numOfReports:GetReportGroupTrend' :: GetReportGroupTrend -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
numOfReports
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reportGroupArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ReportGroupTrendFieldType
trendField
instance Prelude.NFData GetReportGroupTrend where
rnf :: GetReportGroupTrend -> ()
rnf GetReportGroupTrend' {Maybe Natural
Text
ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
reportGroupArn :: Text
numOfReports :: Maybe Natural
$sel:trendField:GetReportGroupTrend' :: GetReportGroupTrend -> ReportGroupTrendFieldType
$sel:reportGroupArn:GetReportGroupTrend' :: GetReportGroupTrend -> Text
$sel:numOfReports:GetReportGroupTrend' :: GetReportGroupTrend -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
numOfReports
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
reportGroupArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ReportGroupTrendFieldType
trendField
instance Data.ToHeaders GetReportGroupTrend where
toHeaders :: GetReportGroupTrend -> 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
"CodeBuild_20161006.GetReportGroupTrend" ::
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 GetReportGroupTrend where
toJSON :: GetReportGroupTrend -> Value
toJSON GetReportGroupTrend' {Maybe Natural
Text
ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
reportGroupArn :: Text
numOfReports :: Maybe Natural
$sel:trendField:GetReportGroupTrend' :: GetReportGroupTrend -> ReportGroupTrendFieldType
$sel:reportGroupArn:GetReportGroupTrend' :: GetReportGroupTrend -> Text
$sel:numOfReports:GetReportGroupTrend' :: GetReportGroupTrend -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"numOfReports" 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
numOfReports,
forall a. a -> Maybe a
Prelude.Just
(Key
"reportGroupArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
reportGroupArn),
forall a. a -> Maybe a
Prelude.Just (Key
"trendField" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ReportGroupTrendFieldType
trendField)
]
)
instance Data.ToPath GetReportGroupTrend where
toPath :: GetReportGroupTrend -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetReportGroupTrend where
toQuery :: GetReportGroupTrend -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetReportGroupTrendResponse = GetReportGroupTrendResponse'
{
GetReportGroupTrendResponse -> Maybe [ReportWithRawData]
rawData :: Prelude.Maybe [ReportWithRawData],
GetReportGroupTrendResponse -> Maybe ReportGroupTrendStats
stats :: Prelude.Maybe ReportGroupTrendStats,
GetReportGroupTrendResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
$c/= :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
== :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
$c== :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
Prelude.Eq, ReadPrec [GetReportGroupTrendResponse]
ReadPrec GetReportGroupTrendResponse
Int -> ReadS GetReportGroupTrendResponse
ReadS [GetReportGroupTrendResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReportGroupTrendResponse]
$creadListPrec :: ReadPrec [GetReportGroupTrendResponse]
readPrec :: ReadPrec GetReportGroupTrendResponse
$creadPrec :: ReadPrec GetReportGroupTrendResponse
readList :: ReadS [GetReportGroupTrendResponse]
$creadList :: ReadS [GetReportGroupTrendResponse]
readsPrec :: Int -> ReadS GetReportGroupTrendResponse
$creadsPrec :: Int -> ReadS GetReportGroupTrendResponse
Prelude.Read, Int -> GetReportGroupTrendResponse -> ShowS
[GetReportGroupTrendResponse] -> ShowS
GetReportGroupTrendResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReportGroupTrendResponse] -> ShowS
$cshowList :: [GetReportGroupTrendResponse] -> ShowS
show :: GetReportGroupTrendResponse -> String
$cshow :: GetReportGroupTrendResponse -> String
showsPrec :: Int -> GetReportGroupTrendResponse -> ShowS
$cshowsPrec :: Int -> GetReportGroupTrendResponse -> ShowS
Prelude.Show, forall x.
Rep GetReportGroupTrendResponse x -> GetReportGroupTrendResponse
forall x.
GetReportGroupTrendResponse -> Rep GetReportGroupTrendResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReportGroupTrendResponse x -> GetReportGroupTrendResponse
$cfrom :: forall x.
GetReportGroupTrendResponse -> Rep GetReportGroupTrendResponse x
Prelude.Generic)
newGetReportGroupTrendResponse ::
Prelude.Int ->
GetReportGroupTrendResponse
newGetReportGroupTrendResponse :: Int -> GetReportGroupTrendResponse
newGetReportGroupTrendResponse Int
pHttpStatus_ =
GetReportGroupTrendResponse'
{ $sel:rawData:GetReportGroupTrendResponse' :: Maybe [ReportWithRawData]
rawData =
forall a. Maybe a
Prelude.Nothing,
$sel:stats:GetReportGroupTrendResponse' :: Maybe ReportGroupTrendStats
stats = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetReportGroupTrendResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getReportGroupTrendResponse_rawData :: Lens.Lens' GetReportGroupTrendResponse (Prelude.Maybe [ReportWithRawData])
getReportGroupTrendResponse_rawData :: Lens' GetReportGroupTrendResponse (Maybe [ReportWithRawData])
getReportGroupTrendResponse_rawData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrendResponse' {Maybe [ReportWithRawData]
rawData :: Maybe [ReportWithRawData]
$sel:rawData:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Maybe [ReportWithRawData]
rawData} -> Maybe [ReportWithRawData]
rawData) (\s :: GetReportGroupTrendResponse
s@GetReportGroupTrendResponse' {} Maybe [ReportWithRawData]
a -> GetReportGroupTrendResponse
s {$sel:rawData:GetReportGroupTrendResponse' :: Maybe [ReportWithRawData]
rawData = Maybe [ReportWithRawData]
a} :: GetReportGroupTrendResponse) 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
getReportGroupTrendResponse_stats :: Lens.Lens' GetReportGroupTrendResponse (Prelude.Maybe ReportGroupTrendStats)
getReportGroupTrendResponse_stats :: Lens' GetReportGroupTrendResponse (Maybe ReportGroupTrendStats)
getReportGroupTrendResponse_stats = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrendResponse' {Maybe ReportGroupTrendStats
stats :: Maybe ReportGroupTrendStats
$sel:stats:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Maybe ReportGroupTrendStats
stats} -> Maybe ReportGroupTrendStats
stats) (\s :: GetReportGroupTrendResponse
s@GetReportGroupTrendResponse' {} Maybe ReportGroupTrendStats
a -> GetReportGroupTrendResponse
s {$sel:stats:GetReportGroupTrendResponse' :: Maybe ReportGroupTrendStats
stats = Maybe ReportGroupTrendStats
a} :: GetReportGroupTrendResponse)
getReportGroupTrendResponse_httpStatus :: Lens.Lens' GetReportGroupTrendResponse Prelude.Int
getReportGroupTrendResponse_httpStatus :: Lens' GetReportGroupTrendResponse Int
getReportGroupTrendResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrendResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetReportGroupTrendResponse
s@GetReportGroupTrendResponse' {} Int
a -> GetReportGroupTrendResponse
s {$sel:httpStatus:GetReportGroupTrendResponse' :: Int
httpStatus = Int
a} :: GetReportGroupTrendResponse)
instance Prelude.NFData GetReportGroupTrendResponse where
rnf :: GetReportGroupTrendResponse -> ()
rnf GetReportGroupTrendResponse' {Int
Maybe [ReportWithRawData]
Maybe ReportGroupTrendStats
httpStatus :: Int
stats :: Maybe ReportGroupTrendStats
rawData :: Maybe [ReportWithRawData]
$sel:httpStatus:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Int
$sel:stats:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Maybe ReportGroupTrendStats
$sel:rawData:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Maybe [ReportWithRawData]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ReportWithRawData]
rawData
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReportGroupTrendStats
stats
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus