{-# 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.UpdateReportGroup
(
UpdateReportGroup (..),
newUpdateReportGroup,
updateReportGroup_exportConfig,
updateReportGroup_tags,
updateReportGroup_arn,
UpdateReportGroupResponse (..),
newUpdateReportGroupResponse,
updateReportGroupResponse_reportGroup,
updateReportGroupResponse_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 UpdateReportGroup = UpdateReportGroup'
{
UpdateReportGroup -> Maybe ReportExportConfig
exportConfig :: Prelude.Maybe ReportExportConfig,
UpdateReportGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
UpdateReportGroup -> Text
arn :: Prelude.Text
}
deriving (UpdateReportGroup -> UpdateReportGroup -> Bool
(UpdateReportGroup -> UpdateReportGroup -> Bool)
-> (UpdateReportGroup -> UpdateReportGroup -> Bool)
-> Eq UpdateReportGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReportGroup -> UpdateReportGroup -> Bool
$c/= :: UpdateReportGroup -> UpdateReportGroup -> Bool
== :: UpdateReportGroup -> UpdateReportGroup -> Bool
$c== :: UpdateReportGroup -> UpdateReportGroup -> Bool
Prelude.Eq, ReadPrec [UpdateReportGroup]
ReadPrec UpdateReportGroup
Int -> ReadS UpdateReportGroup
ReadS [UpdateReportGroup]
(Int -> ReadS UpdateReportGroup)
-> ReadS [UpdateReportGroup]
-> ReadPrec UpdateReportGroup
-> ReadPrec [UpdateReportGroup]
-> Read UpdateReportGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReportGroup]
$creadListPrec :: ReadPrec [UpdateReportGroup]
readPrec :: ReadPrec UpdateReportGroup
$creadPrec :: ReadPrec UpdateReportGroup
readList :: ReadS [UpdateReportGroup]
$creadList :: ReadS [UpdateReportGroup]
readsPrec :: Int -> ReadS UpdateReportGroup
$creadsPrec :: Int -> ReadS UpdateReportGroup
Prelude.Read, Int -> UpdateReportGroup -> ShowS
[UpdateReportGroup] -> ShowS
UpdateReportGroup -> String
(Int -> UpdateReportGroup -> ShowS)
-> (UpdateReportGroup -> String)
-> ([UpdateReportGroup] -> ShowS)
-> Show UpdateReportGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReportGroup] -> ShowS
$cshowList :: [UpdateReportGroup] -> ShowS
show :: UpdateReportGroup -> String
$cshow :: UpdateReportGroup -> String
showsPrec :: Int -> UpdateReportGroup -> ShowS
$cshowsPrec :: Int -> UpdateReportGroup -> ShowS
Prelude.Show, (forall x. UpdateReportGroup -> Rep UpdateReportGroup x)
-> (forall x. Rep UpdateReportGroup x -> UpdateReportGroup)
-> Generic UpdateReportGroup
forall x. Rep UpdateReportGroup x -> UpdateReportGroup
forall x. UpdateReportGroup -> Rep UpdateReportGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateReportGroup x -> UpdateReportGroup
$cfrom :: forall x. UpdateReportGroup -> Rep UpdateReportGroup x
Prelude.Generic)
newUpdateReportGroup ::
Prelude.Text ->
UpdateReportGroup
newUpdateReportGroup :: Text -> UpdateReportGroup
newUpdateReportGroup Text
pArn_ =
UpdateReportGroup' :: Maybe ReportExportConfig
-> Maybe [Tag] -> Text -> UpdateReportGroup
UpdateReportGroup'
{ $sel:exportConfig:UpdateReportGroup' :: Maybe ReportExportConfig
exportConfig = Maybe ReportExportConfig
forall a. Maybe a
Prelude.Nothing,
$sel:tags:UpdateReportGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:arn:UpdateReportGroup' :: Text
arn = Text
pArn_
}
updateReportGroup_exportConfig :: Lens.Lens' UpdateReportGroup (Prelude.Maybe ReportExportConfig)
updateReportGroup_exportConfig :: (Maybe ReportExportConfig -> f (Maybe ReportExportConfig))
-> UpdateReportGroup -> f UpdateReportGroup
updateReportGroup_exportConfig = (UpdateReportGroup -> Maybe ReportExportConfig)
-> (UpdateReportGroup
-> Maybe ReportExportConfig -> UpdateReportGroup)
-> Lens
UpdateReportGroup
UpdateReportGroup
(Maybe ReportExportConfig)
(Maybe ReportExportConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportGroup' {Maybe ReportExportConfig
exportConfig :: Maybe ReportExportConfig
$sel:exportConfig:UpdateReportGroup' :: UpdateReportGroup -> Maybe ReportExportConfig
exportConfig} -> Maybe ReportExportConfig
exportConfig) (\s :: UpdateReportGroup
s@UpdateReportGroup' {} Maybe ReportExportConfig
a -> UpdateReportGroup
s {$sel:exportConfig:UpdateReportGroup' :: Maybe ReportExportConfig
exportConfig = Maybe ReportExportConfig
a} :: UpdateReportGroup)
updateReportGroup_tags :: Lens.Lens' UpdateReportGroup (Prelude.Maybe [Tag])
updateReportGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateReportGroup -> f UpdateReportGroup
updateReportGroup_tags = (UpdateReportGroup -> Maybe [Tag])
-> (UpdateReportGroup -> Maybe [Tag] -> UpdateReportGroup)
-> Lens
UpdateReportGroup UpdateReportGroup (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:UpdateReportGroup' :: UpdateReportGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: UpdateReportGroup
s@UpdateReportGroup' {} Maybe [Tag]
a -> UpdateReportGroup
s {$sel:tags:UpdateReportGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: UpdateReportGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateReportGroup -> f UpdateReportGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateReportGroup
-> f UpdateReportGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateReportGroup_arn :: Lens.Lens' UpdateReportGroup Prelude.Text
updateReportGroup_arn :: (Text -> f Text) -> UpdateReportGroup -> f UpdateReportGroup
updateReportGroup_arn = (UpdateReportGroup -> Text)
-> (UpdateReportGroup -> Text -> UpdateReportGroup)
-> Lens UpdateReportGroup UpdateReportGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportGroup' {Text
arn :: Text
$sel:arn:UpdateReportGroup' :: UpdateReportGroup -> Text
arn} -> Text
arn) (\s :: UpdateReportGroup
s@UpdateReportGroup' {} Text
a -> UpdateReportGroup
s {$sel:arn:UpdateReportGroup' :: Text
arn = Text
a} :: UpdateReportGroup)
instance Core.AWSRequest UpdateReportGroup where
type
AWSResponse UpdateReportGroup =
UpdateReportGroupResponse
request :: UpdateReportGroup -> Request UpdateReportGroup
request = Service -> UpdateReportGroup -> Request UpdateReportGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateReportGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateReportGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateReportGroup))
-> Logger
-> Service
-> Proxy UpdateReportGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateReportGroup)))
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 ReportGroup -> Int -> UpdateReportGroupResponse
UpdateReportGroupResponse'
(Maybe ReportGroup -> Int -> UpdateReportGroupResponse)
-> Either String (Maybe ReportGroup)
-> Either String (Int -> UpdateReportGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ReportGroup)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"reportGroup")
Either String (Int -> UpdateReportGroupResponse)
-> Either String Int -> Either String UpdateReportGroupResponse
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 UpdateReportGroup
instance Prelude.NFData UpdateReportGroup
instance Core.ToHeaders UpdateReportGroup where
toHeaders :: UpdateReportGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateReportGroup -> 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.UpdateReportGroup" ::
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 UpdateReportGroup where
toJSON :: UpdateReportGroup -> Value
toJSON UpdateReportGroup' {Maybe [Tag]
Maybe ReportExportConfig
Text
arn :: Text
tags :: Maybe [Tag]
exportConfig :: Maybe ReportExportConfig
$sel:arn:UpdateReportGroup' :: UpdateReportGroup -> Text
$sel:tags:UpdateReportGroup' :: UpdateReportGroup -> Maybe [Tag]
$sel:exportConfig:UpdateReportGroup' :: UpdateReportGroup -> Maybe ReportExportConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"exportConfig" Text -> ReportExportConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ReportExportConfig -> Pair)
-> Maybe ReportExportConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReportExportConfig
exportConfig,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
]
)
instance Core.ToPath UpdateReportGroup where
toPath :: UpdateReportGroup -> ByteString
toPath = ByteString -> UpdateReportGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateReportGroup where
toQuery :: UpdateReportGroup -> QueryString
toQuery = QueryString -> UpdateReportGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateReportGroupResponse = UpdateReportGroupResponse'
{
UpdateReportGroupResponse -> Maybe ReportGroup
reportGroup :: Prelude.Maybe ReportGroup,
UpdateReportGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateReportGroupResponse -> UpdateReportGroupResponse -> Bool
(UpdateReportGroupResponse -> UpdateReportGroupResponse -> Bool)
-> (UpdateReportGroupResponse -> UpdateReportGroupResponse -> Bool)
-> Eq UpdateReportGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReportGroupResponse -> UpdateReportGroupResponse -> Bool
$c/= :: UpdateReportGroupResponse -> UpdateReportGroupResponse -> Bool
== :: UpdateReportGroupResponse -> UpdateReportGroupResponse -> Bool
$c== :: UpdateReportGroupResponse -> UpdateReportGroupResponse -> Bool
Prelude.Eq, ReadPrec [UpdateReportGroupResponse]
ReadPrec UpdateReportGroupResponse
Int -> ReadS UpdateReportGroupResponse
ReadS [UpdateReportGroupResponse]
(Int -> ReadS UpdateReportGroupResponse)
-> ReadS [UpdateReportGroupResponse]
-> ReadPrec UpdateReportGroupResponse
-> ReadPrec [UpdateReportGroupResponse]
-> Read UpdateReportGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReportGroupResponse]
$creadListPrec :: ReadPrec [UpdateReportGroupResponse]
readPrec :: ReadPrec UpdateReportGroupResponse
$creadPrec :: ReadPrec UpdateReportGroupResponse
readList :: ReadS [UpdateReportGroupResponse]
$creadList :: ReadS [UpdateReportGroupResponse]
readsPrec :: Int -> ReadS UpdateReportGroupResponse
$creadsPrec :: Int -> ReadS UpdateReportGroupResponse
Prelude.Read, Int -> UpdateReportGroupResponse -> ShowS
[UpdateReportGroupResponse] -> ShowS
UpdateReportGroupResponse -> String
(Int -> UpdateReportGroupResponse -> ShowS)
-> (UpdateReportGroupResponse -> String)
-> ([UpdateReportGroupResponse] -> ShowS)
-> Show UpdateReportGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReportGroupResponse] -> ShowS
$cshowList :: [UpdateReportGroupResponse] -> ShowS
show :: UpdateReportGroupResponse -> String
$cshow :: UpdateReportGroupResponse -> String
showsPrec :: Int -> UpdateReportGroupResponse -> ShowS
$cshowsPrec :: Int -> UpdateReportGroupResponse -> ShowS
Prelude.Show, (forall x.
UpdateReportGroupResponse -> Rep UpdateReportGroupResponse x)
-> (forall x.
Rep UpdateReportGroupResponse x -> UpdateReportGroupResponse)
-> Generic UpdateReportGroupResponse
forall x.
Rep UpdateReportGroupResponse x -> UpdateReportGroupResponse
forall x.
UpdateReportGroupResponse -> Rep UpdateReportGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateReportGroupResponse x -> UpdateReportGroupResponse
$cfrom :: forall x.
UpdateReportGroupResponse -> Rep UpdateReportGroupResponse x
Prelude.Generic)
newUpdateReportGroupResponse ::
Prelude.Int ->
UpdateReportGroupResponse
newUpdateReportGroupResponse :: Int -> UpdateReportGroupResponse
newUpdateReportGroupResponse Int
pHttpStatus_ =
UpdateReportGroupResponse' :: Maybe ReportGroup -> Int -> UpdateReportGroupResponse
UpdateReportGroupResponse'
{ $sel:reportGroup:UpdateReportGroupResponse' :: Maybe ReportGroup
reportGroup =
Maybe ReportGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateReportGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateReportGroupResponse_reportGroup :: Lens.Lens' UpdateReportGroupResponse (Prelude.Maybe ReportGroup)
updateReportGroupResponse_reportGroup :: (Maybe ReportGroup -> f (Maybe ReportGroup))
-> UpdateReportGroupResponse -> f UpdateReportGroupResponse
updateReportGroupResponse_reportGroup = (UpdateReportGroupResponse -> Maybe ReportGroup)
-> (UpdateReportGroupResponse
-> Maybe ReportGroup -> UpdateReportGroupResponse)
-> Lens
UpdateReportGroupResponse
UpdateReportGroupResponse
(Maybe ReportGroup)
(Maybe ReportGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportGroupResponse' {Maybe ReportGroup
reportGroup :: Maybe ReportGroup
$sel:reportGroup:UpdateReportGroupResponse' :: UpdateReportGroupResponse -> Maybe ReportGroup
reportGroup} -> Maybe ReportGroup
reportGroup) (\s :: UpdateReportGroupResponse
s@UpdateReportGroupResponse' {} Maybe ReportGroup
a -> UpdateReportGroupResponse
s {$sel:reportGroup:UpdateReportGroupResponse' :: Maybe ReportGroup
reportGroup = Maybe ReportGroup
a} :: UpdateReportGroupResponse)
updateReportGroupResponse_httpStatus :: Lens.Lens' UpdateReportGroupResponse Prelude.Int
updateReportGroupResponse_httpStatus :: (Int -> f Int)
-> UpdateReportGroupResponse -> f UpdateReportGroupResponse
updateReportGroupResponse_httpStatus = (UpdateReportGroupResponse -> Int)
-> (UpdateReportGroupResponse -> Int -> UpdateReportGroupResponse)
-> Lens UpdateReportGroupResponse UpdateReportGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateReportGroupResponse' :: UpdateReportGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateReportGroupResponse
s@UpdateReportGroupResponse' {} Int
a -> UpdateReportGroupResponse
s {$sel:httpStatus:UpdateReportGroupResponse' :: Int
httpStatus = Int
a} :: UpdateReportGroupResponse)
instance Prelude.NFData UpdateReportGroupResponse