{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeBuild.Types.ReportWithRawData where

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

-- | 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
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]
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
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. 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'
    { $sel:data':ReportWithRawData' :: Maybe Text
data' = forall a. Maybe a
Prelude.Nothing,
      $sel:reportArn:ReportWithRawData' :: Maybe Text
reportArn = 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 :: Lens' ReportWithRawData (Maybe Text)
reportWithRawData_data = 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 :: Lens' ReportWithRawData (Maybe Text)
reportWithRawData_reportArn = 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 Data.FromJSON ReportWithRawData where
  parseJSON :: Value -> Parser ReportWithRawData
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReportWithRawData"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ReportWithRawData
ReportWithRawData'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"data")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"reportArn")
      )

instance Prelude.Hashable ReportWithRawData where
  hashWithSalt :: Int -> ReportWithRawData -> Int
hashWithSalt Int
_salt ReportWithRawData' {Maybe Text
reportArn :: Maybe Text
data' :: Maybe Text
$sel:reportArn:ReportWithRawData' :: ReportWithRawData -> Maybe Text
$sel:data':ReportWithRawData' :: ReportWithRawData -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
data'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reportArn

instance Prelude.NFData ReportWithRawData where
  rnf :: ReportWithRawData -> ()
rnf ReportWithRawData' {Maybe Text
reportArn :: Maybe Text
data' :: Maybe Text
$sel:reportArn:ReportWithRawData' :: ReportWithRawData -> Maybe Text
$sel:data':ReportWithRawData' :: ReportWithRawData -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
data'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reportArn