{-# 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 #-}
module Amazonka.IoTSiteWise.Types.ErrorReportLocation 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
data ErrorReportLocation = ErrorReportLocation'
{
ErrorReportLocation -> Text
bucket :: Prelude.Text,
ErrorReportLocation -> Text
prefix :: Prelude.Text
}
deriving (ErrorReportLocation -> ErrorReportLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ErrorReportLocation -> ErrorReportLocation -> Bool
$c/= :: ErrorReportLocation -> ErrorReportLocation -> Bool
== :: ErrorReportLocation -> ErrorReportLocation -> Bool
$c== :: ErrorReportLocation -> ErrorReportLocation -> Bool
Prelude.Eq, ReadPrec [ErrorReportLocation]
ReadPrec ErrorReportLocation
Int -> ReadS ErrorReportLocation
ReadS [ErrorReportLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ErrorReportLocation]
$creadListPrec :: ReadPrec [ErrorReportLocation]
readPrec :: ReadPrec ErrorReportLocation
$creadPrec :: ReadPrec ErrorReportLocation
readList :: ReadS [ErrorReportLocation]
$creadList :: ReadS [ErrorReportLocation]
readsPrec :: Int -> ReadS ErrorReportLocation
$creadsPrec :: Int -> ReadS ErrorReportLocation
Prelude.Read, Int -> ErrorReportLocation -> ShowS
[ErrorReportLocation] -> ShowS
ErrorReportLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ErrorReportLocation] -> ShowS
$cshowList :: [ErrorReportLocation] -> ShowS
show :: ErrorReportLocation -> String
$cshow :: ErrorReportLocation -> String
showsPrec :: Int -> ErrorReportLocation -> ShowS
$cshowsPrec :: Int -> ErrorReportLocation -> ShowS
Prelude.Show, forall x. Rep ErrorReportLocation x -> ErrorReportLocation
forall x. ErrorReportLocation -> Rep ErrorReportLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ErrorReportLocation x -> ErrorReportLocation
$cfrom :: forall x. ErrorReportLocation -> Rep ErrorReportLocation x
Prelude.Generic)
newErrorReportLocation ::
Prelude.Text ->
Prelude.Text ->
ErrorReportLocation
newErrorReportLocation :: Text -> Text -> ErrorReportLocation
newErrorReportLocation Text
pBucket_ Text
pPrefix_ =
ErrorReportLocation'
{ $sel:bucket:ErrorReportLocation' :: Text
bucket = Text
pBucket_,
$sel:prefix:ErrorReportLocation' :: Text
prefix = Text
pPrefix_
}
errorReportLocation_bucket :: Lens.Lens' ErrorReportLocation Prelude.Text
errorReportLocation_bucket :: Lens' ErrorReportLocation Text
errorReportLocation_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorReportLocation' {Text
bucket :: Text
$sel:bucket:ErrorReportLocation' :: ErrorReportLocation -> Text
bucket} -> Text
bucket) (\s :: ErrorReportLocation
s@ErrorReportLocation' {} Text
a -> ErrorReportLocation
s {$sel:bucket:ErrorReportLocation' :: Text
bucket = Text
a} :: ErrorReportLocation)
errorReportLocation_prefix :: Lens.Lens' ErrorReportLocation Prelude.Text
errorReportLocation_prefix :: Lens' ErrorReportLocation Text
errorReportLocation_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorReportLocation' {Text
prefix :: Text
$sel:prefix:ErrorReportLocation' :: ErrorReportLocation -> Text
prefix} -> Text
prefix) (\s :: ErrorReportLocation
s@ErrorReportLocation' {} Text
a -> ErrorReportLocation
s {$sel:prefix:ErrorReportLocation' :: Text
prefix = Text
a} :: ErrorReportLocation)
instance Data.FromJSON ErrorReportLocation where
parseJSON :: Value -> Parser ErrorReportLocation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ErrorReportLocation"
( \Object
x ->
Text -> Text -> ErrorReportLocation
ErrorReportLocation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"bucket")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"prefix")
)
instance Prelude.Hashable ErrorReportLocation where
hashWithSalt :: Int -> ErrorReportLocation -> Int
hashWithSalt Int
_salt ErrorReportLocation' {Text
prefix :: Text
bucket :: Text
$sel:prefix:ErrorReportLocation' :: ErrorReportLocation -> Text
$sel:bucket:ErrorReportLocation' :: ErrorReportLocation -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
prefix
instance Prelude.NFData ErrorReportLocation where
rnf :: ErrorReportLocation -> ()
rnf ErrorReportLocation' {Text
prefix :: Text
bucket :: Text
$sel:prefix:ErrorReportLocation' :: ErrorReportLocation -> Text
$sel:bucket:ErrorReportLocation' :: ErrorReportLocation -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
bucket seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
prefix
instance Data.ToJSON ErrorReportLocation where
toJSON :: ErrorReportLocation -> Value
toJSON ErrorReportLocation' {Text
prefix :: Text
bucket :: Text
$sel:prefix:ErrorReportLocation' :: ErrorReportLocation -> Text
$sel:bucket:ErrorReportLocation' :: ErrorReportLocation -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"bucket" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
bucket),
forall a. a -> Maybe a
Prelude.Just (Key
"prefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
prefix)
]
)