{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodeBuild.Types.ReportWithRawData
-- 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)
module Amazonka.CodeBuild.Types.ReportWithRawData where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the unmodified data for the report. For more information, see .
--
-- /See:/ 'newReportWithRawData' smart constructor.
data ReportWithRawData = ReportWithRawData'
  { -- | The value of the requested data field from the report.
    ReportWithRawData -> Maybe Text
data' :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the report.
    ReportWithRawData -> Maybe Text
reportArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ReportWithRawData -> ReportWithRawData -> Bool
(ReportWithRawData -> ReportWithRawData -> Bool)
-> (ReportWithRawData -> ReportWithRawData -> Bool)
-> Eq ReportWithRawData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReportWithRawData -> ReportWithRawData -> Bool
$c/= :: ReportWithRawData -> ReportWithRawData -> Bool
== :: ReportWithRawData -> ReportWithRawData -> Bool
$c== :: ReportWithRawData -> ReportWithRawData -> Bool
Prelude.Eq, ReadPrec [ReportWithRawData]
ReadPrec ReportWithRawData
Int -> ReadS ReportWithRawData
ReadS [ReportWithRawData]
(Int -> ReadS ReportWithRawData)
-> ReadS [ReportWithRawData]
-> ReadPrec ReportWithRawData
-> ReadPrec [ReportWithRawData]
-> Read ReportWithRawData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReportWithRawData]
$creadListPrec :: ReadPrec [ReportWithRawData]
readPrec :: ReadPrec ReportWithRawData
$creadPrec :: ReadPrec ReportWithRawData
readList :: ReadS [ReportWithRawData]
$creadList :: ReadS [ReportWithRawData]
readsPrec :: Int -> ReadS ReportWithRawData
$creadsPrec :: Int -> ReadS ReportWithRawData
Prelude.Read, Int -> ReportWithRawData -> ShowS
[ReportWithRawData] -> ShowS
ReportWithRawData -> String
(Int -> ReportWithRawData -> ShowS)
-> (ReportWithRawData -> String)
-> ([ReportWithRawData] -> ShowS)
-> Show ReportWithRawData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReportWithRawData] -> ShowS
$cshowList :: [ReportWithRawData] -> ShowS
show :: ReportWithRawData -> String
$cshow :: ReportWithRawData -> String
showsPrec :: Int -> ReportWithRawData -> ShowS
$cshowsPrec :: Int -> ReportWithRawData -> ShowS
Prelude.Show, (forall x. ReportWithRawData -> Rep ReportWithRawData x)
-> (forall x. Rep ReportWithRawData x -> ReportWithRawData)
-> Generic ReportWithRawData
forall x. Rep ReportWithRawData x -> ReportWithRawData
forall x. ReportWithRawData -> Rep ReportWithRawData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReportWithRawData x -> ReportWithRawData
$cfrom :: forall x. ReportWithRawData -> Rep ReportWithRawData x
Prelude.Generic)

-- |
-- Create a value of 'ReportWithRawData' 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:
--
-- 'data'', 'reportWithRawData_data' - The value of the requested data field from the report.
--
-- 'reportArn', 'reportWithRawData_reportArn' - The ARN of the report.
newReportWithRawData ::
  ReportWithRawData
newReportWithRawData :: ReportWithRawData
newReportWithRawData =
  ReportWithRawData' :: Maybe Text -> Maybe Text -> ReportWithRawData
ReportWithRawData'
    { $sel:data':ReportWithRawData' :: Maybe Text
data' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reportArn:ReportWithRawData' :: Maybe Text
reportArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The value of the requested data field from the report.
reportWithRawData_data :: Lens.Lens' ReportWithRawData (Prelude.Maybe Prelude.Text)
reportWithRawData_data :: (Maybe Text -> f (Maybe Text))
-> ReportWithRawData -> f ReportWithRawData
reportWithRawData_data = (ReportWithRawData -> Maybe Text)
-> (ReportWithRawData -> Maybe Text -> ReportWithRawData)
-> Lens
     ReportWithRawData ReportWithRawData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportWithRawData' {Maybe Text
data' :: Maybe Text
$sel:data':ReportWithRawData' :: ReportWithRawData -> Maybe Text
data'} -> Maybe Text
data') (\s :: ReportWithRawData
s@ReportWithRawData' {} Maybe Text
a -> ReportWithRawData
s {$sel:data':ReportWithRawData' :: Maybe Text
data' = Maybe Text
a} :: ReportWithRawData)

-- | The ARN of the report.
reportWithRawData_reportArn :: Lens.Lens' ReportWithRawData (Prelude.Maybe Prelude.Text)
reportWithRawData_reportArn :: (Maybe Text -> f (Maybe Text))
-> ReportWithRawData -> f ReportWithRawData
reportWithRawData_reportArn = (ReportWithRawData -> Maybe Text)
-> (ReportWithRawData -> Maybe Text -> ReportWithRawData)
-> Lens
     ReportWithRawData ReportWithRawData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportWithRawData' {Maybe Text
reportArn :: Maybe Text
$sel:reportArn:ReportWithRawData' :: ReportWithRawData -> Maybe Text
reportArn} -> Maybe Text
reportArn) (\s :: ReportWithRawData
s@ReportWithRawData' {} Maybe Text
a -> ReportWithRawData
s {$sel:reportArn:ReportWithRawData' :: Maybe Text
reportArn = Maybe Text
a} :: ReportWithRawData)

instance Core.FromJSON ReportWithRawData where
  parseJSON :: Value -> Parser ReportWithRawData
parseJSON =
    String
-> (Object -> Parser ReportWithRawData)
-> Value
-> Parser ReportWithRawData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReportWithRawData"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ReportWithRawData
ReportWithRawData'
            (Maybe Text -> Maybe Text -> ReportWithRawData)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ReportWithRawData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"data")
            Parser (Maybe Text -> ReportWithRawData)
-> Parser (Maybe Text) -> Parser ReportWithRawData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reportArn")
      )

instance Prelude.Hashable ReportWithRawData

instance Prelude.NFData ReportWithRawData