{-# 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.CodeBuild.Types.S3LogsConfig where
import Amazonka.CodeBuild.Types.BucketOwnerAccess
import Amazonka.CodeBuild.Types.LogsConfigStatusType
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 S3LogsConfig = S3LogsConfig'
{ S3LogsConfig -> Maybe BucketOwnerAccess
bucketOwnerAccess :: Prelude.Maybe BucketOwnerAccess,
S3LogsConfig -> Maybe Bool
encryptionDisabled :: Prelude.Maybe Prelude.Bool,
S3LogsConfig -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
S3LogsConfig -> LogsConfigStatusType
status :: LogsConfigStatusType
}
deriving (S3LogsConfig -> S3LogsConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3LogsConfig -> S3LogsConfig -> Bool
$c/= :: S3LogsConfig -> S3LogsConfig -> Bool
== :: S3LogsConfig -> S3LogsConfig -> Bool
$c== :: S3LogsConfig -> S3LogsConfig -> Bool
Prelude.Eq, ReadPrec [S3LogsConfig]
ReadPrec S3LogsConfig
Int -> ReadS S3LogsConfig
ReadS [S3LogsConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3LogsConfig]
$creadListPrec :: ReadPrec [S3LogsConfig]
readPrec :: ReadPrec S3LogsConfig
$creadPrec :: ReadPrec S3LogsConfig
readList :: ReadS [S3LogsConfig]
$creadList :: ReadS [S3LogsConfig]
readsPrec :: Int -> ReadS S3LogsConfig
$creadsPrec :: Int -> ReadS S3LogsConfig
Prelude.Read, Int -> S3LogsConfig -> ShowS
[S3LogsConfig] -> ShowS
S3LogsConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3LogsConfig] -> ShowS
$cshowList :: [S3LogsConfig] -> ShowS
show :: S3LogsConfig -> String
$cshow :: S3LogsConfig -> String
showsPrec :: Int -> S3LogsConfig -> ShowS
$cshowsPrec :: Int -> S3LogsConfig -> ShowS
Prelude.Show, forall x. Rep S3LogsConfig x -> S3LogsConfig
forall x. S3LogsConfig -> Rep S3LogsConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3LogsConfig x -> S3LogsConfig
$cfrom :: forall x. S3LogsConfig -> Rep S3LogsConfig x
Prelude.Generic)
newS3LogsConfig ::
LogsConfigStatusType ->
S3LogsConfig
newS3LogsConfig :: LogsConfigStatusType -> S3LogsConfig
newS3LogsConfig LogsConfigStatusType
pStatus_ =
S3LogsConfig'
{ $sel:bucketOwnerAccess:S3LogsConfig' :: Maybe BucketOwnerAccess
bucketOwnerAccess = forall a. Maybe a
Prelude.Nothing,
$sel:encryptionDisabled:S3LogsConfig' :: Maybe Bool
encryptionDisabled = forall a. Maybe a
Prelude.Nothing,
$sel:location:S3LogsConfig' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
$sel:status:S3LogsConfig' :: LogsConfigStatusType
status = LogsConfigStatusType
pStatus_
}
s3LogsConfig_bucketOwnerAccess :: Lens.Lens' S3LogsConfig (Prelude.Maybe BucketOwnerAccess)
s3LogsConfig_bucketOwnerAccess :: Lens' S3LogsConfig (Maybe BucketOwnerAccess)
s3LogsConfig_bucketOwnerAccess = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogsConfig' {Maybe BucketOwnerAccess
bucketOwnerAccess :: Maybe BucketOwnerAccess
$sel:bucketOwnerAccess:S3LogsConfig' :: S3LogsConfig -> Maybe BucketOwnerAccess
bucketOwnerAccess} -> Maybe BucketOwnerAccess
bucketOwnerAccess) (\s :: S3LogsConfig
s@S3LogsConfig' {} Maybe BucketOwnerAccess
a -> S3LogsConfig
s {$sel:bucketOwnerAccess:S3LogsConfig' :: Maybe BucketOwnerAccess
bucketOwnerAccess = Maybe BucketOwnerAccess
a} :: S3LogsConfig)
s3LogsConfig_encryptionDisabled :: Lens.Lens' S3LogsConfig (Prelude.Maybe Prelude.Bool)
s3LogsConfig_encryptionDisabled :: Lens' S3LogsConfig (Maybe Bool)
s3LogsConfig_encryptionDisabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogsConfig' {Maybe Bool
encryptionDisabled :: Maybe Bool
$sel:encryptionDisabled:S3LogsConfig' :: S3LogsConfig -> Maybe Bool
encryptionDisabled} -> Maybe Bool
encryptionDisabled) (\s :: S3LogsConfig
s@S3LogsConfig' {} Maybe Bool
a -> S3LogsConfig
s {$sel:encryptionDisabled:S3LogsConfig' :: Maybe Bool
encryptionDisabled = Maybe Bool
a} :: S3LogsConfig)
s3LogsConfig_location :: Lens.Lens' S3LogsConfig (Prelude.Maybe Prelude.Text)
s3LogsConfig_location :: Lens' S3LogsConfig (Maybe Text)
s3LogsConfig_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogsConfig' {Maybe Text
location :: Maybe Text
$sel:location:S3LogsConfig' :: S3LogsConfig -> Maybe Text
location} -> Maybe Text
location) (\s :: S3LogsConfig
s@S3LogsConfig' {} Maybe Text
a -> S3LogsConfig
s {$sel:location:S3LogsConfig' :: Maybe Text
location = Maybe Text
a} :: S3LogsConfig)
s3LogsConfig_status :: Lens.Lens' S3LogsConfig LogsConfigStatusType
s3LogsConfig_status :: Lens' S3LogsConfig LogsConfigStatusType
s3LogsConfig_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3LogsConfig' {LogsConfigStatusType
status :: LogsConfigStatusType
$sel:status:S3LogsConfig' :: S3LogsConfig -> LogsConfigStatusType
status} -> LogsConfigStatusType
status) (\s :: S3LogsConfig
s@S3LogsConfig' {} LogsConfigStatusType
a -> S3LogsConfig
s {$sel:status:S3LogsConfig' :: LogsConfigStatusType
status = LogsConfigStatusType
a} :: S3LogsConfig)
instance Data.FromJSON S3LogsConfig where
parseJSON :: Value -> Parser S3LogsConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"S3LogsConfig"
( \Object
x ->
Maybe BucketOwnerAccess
-> Maybe Bool -> Maybe Text -> LogsConfigStatusType -> S3LogsConfig
S3LogsConfig'
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
"bucketOwnerAccess")
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
"encryptionDisabled")
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
"location")
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
"status")
)
instance Prelude.Hashable S3LogsConfig where
hashWithSalt :: Int -> S3LogsConfig -> Int
hashWithSalt Int
_salt S3LogsConfig' {Maybe Bool
Maybe Text
Maybe BucketOwnerAccess
LogsConfigStatusType
status :: LogsConfigStatusType
location :: Maybe Text
encryptionDisabled :: Maybe Bool
bucketOwnerAccess :: Maybe BucketOwnerAccess
$sel:status:S3LogsConfig' :: S3LogsConfig -> LogsConfigStatusType
$sel:location:S3LogsConfig' :: S3LogsConfig -> Maybe Text
$sel:encryptionDisabled:S3LogsConfig' :: S3LogsConfig -> Maybe Bool
$sel:bucketOwnerAccess:S3LogsConfig' :: S3LogsConfig -> Maybe BucketOwnerAccess
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BucketOwnerAccess
bucketOwnerAccess
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encryptionDisabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LogsConfigStatusType
status
instance Prelude.NFData S3LogsConfig where
rnf :: S3LogsConfig -> ()
rnf S3LogsConfig' {Maybe Bool
Maybe Text
Maybe BucketOwnerAccess
LogsConfigStatusType
status :: LogsConfigStatusType
location :: Maybe Text
encryptionDisabled :: Maybe Bool
bucketOwnerAccess :: Maybe BucketOwnerAccess
$sel:status:S3LogsConfig' :: S3LogsConfig -> LogsConfigStatusType
$sel:location:S3LogsConfig' :: S3LogsConfig -> Maybe Text
$sel:encryptionDisabled:S3LogsConfig' :: S3LogsConfig -> Maybe Bool
$sel:bucketOwnerAccess:S3LogsConfig' :: S3LogsConfig -> Maybe BucketOwnerAccess
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe BucketOwnerAccess
bucketOwnerAccess
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encryptionDisabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LogsConfigStatusType
status
instance Data.ToJSON S3LogsConfig where
toJSON :: S3LogsConfig -> Value
toJSON S3LogsConfig' {Maybe Bool
Maybe Text
Maybe BucketOwnerAccess
LogsConfigStatusType
status :: LogsConfigStatusType
location :: Maybe Text
encryptionDisabled :: Maybe Bool
bucketOwnerAccess :: Maybe BucketOwnerAccess
$sel:status:S3LogsConfig' :: S3LogsConfig -> LogsConfigStatusType
$sel:location:S3LogsConfig' :: S3LogsConfig -> Maybe Text
$sel:encryptionDisabled:S3LogsConfig' :: S3LogsConfig -> Maybe Bool
$sel:bucketOwnerAccess:S3LogsConfig' :: S3LogsConfig -> Maybe BucketOwnerAccess
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"bucketOwnerAccess" 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 BucketOwnerAccess
bucketOwnerAccess,
(Key
"encryptionDisabled" 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 Bool
encryptionDisabled,
(Key
"location" 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 Text
location,
forall a. a -> Maybe a
Prelude.Just (Key
"status" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LogsConfigStatusType
status)
]
)