{-# 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.SecurityHub.Types.AwsCloudFrontDistributionOriginItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsCloudFrontDistributionOriginS3OriginConfig
data AwsCloudFrontDistributionOriginItem = AwsCloudFrontDistributionOriginItem'
{
AwsCloudFrontDistributionOriginItem
-> Maybe AwsCloudFrontDistributionOriginS3OriginConfig
s3OriginConfig :: Prelude.Maybe AwsCloudFrontDistributionOriginS3OriginConfig,
AwsCloudFrontDistributionOriginItem -> Maybe Text
originPath :: Prelude.Maybe Prelude.Text,
AwsCloudFrontDistributionOriginItem -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
AwsCloudFrontDistributionOriginItem -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (AwsCloudFrontDistributionOriginItem
-> AwsCloudFrontDistributionOriginItem -> Bool
(AwsCloudFrontDistributionOriginItem
-> AwsCloudFrontDistributionOriginItem -> Bool)
-> (AwsCloudFrontDistributionOriginItem
-> AwsCloudFrontDistributionOriginItem -> Bool)
-> Eq AwsCloudFrontDistributionOriginItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCloudFrontDistributionOriginItem
-> AwsCloudFrontDistributionOriginItem -> Bool
$c/= :: AwsCloudFrontDistributionOriginItem
-> AwsCloudFrontDistributionOriginItem -> Bool
== :: AwsCloudFrontDistributionOriginItem
-> AwsCloudFrontDistributionOriginItem -> Bool
$c== :: AwsCloudFrontDistributionOriginItem
-> AwsCloudFrontDistributionOriginItem -> Bool
Prelude.Eq, ReadPrec [AwsCloudFrontDistributionOriginItem]
ReadPrec AwsCloudFrontDistributionOriginItem
Int -> ReadS AwsCloudFrontDistributionOriginItem
ReadS [AwsCloudFrontDistributionOriginItem]
(Int -> ReadS AwsCloudFrontDistributionOriginItem)
-> ReadS [AwsCloudFrontDistributionOriginItem]
-> ReadPrec AwsCloudFrontDistributionOriginItem
-> ReadPrec [AwsCloudFrontDistributionOriginItem]
-> Read AwsCloudFrontDistributionOriginItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCloudFrontDistributionOriginItem]
$creadListPrec :: ReadPrec [AwsCloudFrontDistributionOriginItem]
readPrec :: ReadPrec AwsCloudFrontDistributionOriginItem
$creadPrec :: ReadPrec AwsCloudFrontDistributionOriginItem
readList :: ReadS [AwsCloudFrontDistributionOriginItem]
$creadList :: ReadS [AwsCloudFrontDistributionOriginItem]
readsPrec :: Int -> ReadS AwsCloudFrontDistributionOriginItem
$creadsPrec :: Int -> ReadS AwsCloudFrontDistributionOriginItem
Prelude.Read, Int -> AwsCloudFrontDistributionOriginItem -> ShowS
[AwsCloudFrontDistributionOriginItem] -> ShowS
AwsCloudFrontDistributionOriginItem -> String
(Int -> AwsCloudFrontDistributionOriginItem -> ShowS)
-> (AwsCloudFrontDistributionOriginItem -> String)
-> ([AwsCloudFrontDistributionOriginItem] -> ShowS)
-> Show AwsCloudFrontDistributionOriginItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCloudFrontDistributionOriginItem] -> ShowS
$cshowList :: [AwsCloudFrontDistributionOriginItem] -> ShowS
show :: AwsCloudFrontDistributionOriginItem -> String
$cshow :: AwsCloudFrontDistributionOriginItem -> String
showsPrec :: Int -> AwsCloudFrontDistributionOriginItem -> ShowS
$cshowsPrec :: Int -> AwsCloudFrontDistributionOriginItem -> ShowS
Prelude.Show, (forall x.
AwsCloudFrontDistributionOriginItem
-> Rep AwsCloudFrontDistributionOriginItem x)
-> (forall x.
Rep AwsCloudFrontDistributionOriginItem x
-> AwsCloudFrontDistributionOriginItem)
-> Generic AwsCloudFrontDistributionOriginItem
forall x.
Rep AwsCloudFrontDistributionOriginItem x
-> AwsCloudFrontDistributionOriginItem
forall x.
AwsCloudFrontDistributionOriginItem
-> Rep AwsCloudFrontDistributionOriginItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCloudFrontDistributionOriginItem x
-> AwsCloudFrontDistributionOriginItem
$cfrom :: forall x.
AwsCloudFrontDistributionOriginItem
-> Rep AwsCloudFrontDistributionOriginItem x
Prelude.Generic)
newAwsCloudFrontDistributionOriginItem ::
AwsCloudFrontDistributionOriginItem
newAwsCloudFrontDistributionOriginItem :: AwsCloudFrontDistributionOriginItem
newAwsCloudFrontDistributionOriginItem =
AwsCloudFrontDistributionOriginItem' :: Maybe AwsCloudFrontDistributionOriginS3OriginConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCloudFrontDistributionOriginItem
AwsCloudFrontDistributionOriginItem'
{ $sel:s3OriginConfig:AwsCloudFrontDistributionOriginItem' :: Maybe AwsCloudFrontDistributionOriginS3OriginConfig
s3OriginConfig =
Maybe AwsCloudFrontDistributionOriginS3OriginConfig
forall a. Maybe a
Prelude.Nothing,
$sel:originPath:AwsCloudFrontDistributionOriginItem' :: Maybe Text
originPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:AwsCloudFrontDistributionOriginItem' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:AwsCloudFrontDistributionOriginItem' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsCloudFrontDistributionOriginItem_s3OriginConfig :: Lens.Lens' AwsCloudFrontDistributionOriginItem (Prelude.Maybe AwsCloudFrontDistributionOriginS3OriginConfig)
awsCloudFrontDistributionOriginItem_s3OriginConfig :: (Maybe AwsCloudFrontDistributionOriginS3OriginConfig
-> f (Maybe AwsCloudFrontDistributionOriginS3OriginConfig))
-> AwsCloudFrontDistributionOriginItem
-> f AwsCloudFrontDistributionOriginItem
awsCloudFrontDistributionOriginItem_s3OriginConfig = (AwsCloudFrontDistributionOriginItem
-> Maybe AwsCloudFrontDistributionOriginS3OriginConfig)
-> (AwsCloudFrontDistributionOriginItem
-> Maybe AwsCloudFrontDistributionOriginS3OriginConfig
-> AwsCloudFrontDistributionOriginItem)
-> Lens
AwsCloudFrontDistributionOriginItem
AwsCloudFrontDistributionOriginItem
(Maybe AwsCloudFrontDistributionOriginS3OriginConfig)
(Maybe AwsCloudFrontDistributionOriginS3OriginConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionOriginItem' {Maybe AwsCloudFrontDistributionOriginS3OriginConfig
s3OriginConfig :: Maybe AwsCloudFrontDistributionOriginS3OriginConfig
$sel:s3OriginConfig:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem
-> Maybe AwsCloudFrontDistributionOriginS3OriginConfig
s3OriginConfig} -> Maybe AwsCloudFrontDistributionOriginS3OriginConfig
s3OriginConfig) (\s :: AwsCloudFrontDistributionOriginItem
s@AwsCloudFrontDistributionOriginItem' {} Maybe AwsCloudFrontDistributionOriginS3OriginConfig
a -> AwsCloudFrontDistributionOriginItem
s {$sel:s3OriginConfig:AwsCloudFrontDistributionOriginItem' :: Maybe AwsCloudFrontDistributionOriginS3OriginConfig
s3OriginConfig = Maybe AwsCloudFrontDistributionOriginS3OriginConfig
a} :: AwsCloudFrontDistributionOriginItem)
awsCloudFrontDistributionOriginItem_originPath :: Lens.Lens' AwsCloudFrontDistributionOriginItem (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionOriginItem_originPath :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionOriginItem
-> f AwsCloudFrontDistributionOriginItem
awsCloudFrontDistributionOriginItem_originPath = (AwsCloudFrontDistributionOriginItem -> Maybe Text)
-> (AwsCloudFrontDistributionOriginItem
-> Maybe Text -> AwsCloudFrontDistributionOriginItem)
-> Lens
AwsCloudFrontDistributionOriginItem
AwsCloudFrontDistributionOriginItem
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionOriginItem' {Maybe Text
originPath :: Maybe Text
$sel:originPath:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem -> Maybe Text
originPath} -> Maybe Text
originPath) (\s :: AwsCloudFrontDistributionOriginItem
s@AwsCloudFrontDistributionOriginItem' {} Maybe Text
a -> AwsCloudFrontDistributionOriginItem
s {$sel:originPath:AwsCloudFrontDistributionOriginItem' :: Maybe Text
originPath = Maybe Text
a} :: AwsCloudFrontDistributionOriginItem)
awsCloudFrontDistributionOriginItem_domainName :: Lens.Lens' AwsCloudFrontDistributionOriginItem (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionOriginItem_domainName :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionOriginItem
-> f AwsCloudFrontDistributionOriginItem
awsCloudFrontDistributionOriginItem_domainName = (AwsCloudFrontDistributionOriginItem -> Maybe Text)
-> (AwsCloudFrontDistributionOriginItem
-> Maybe Text -> AwsCloudFrontDistributionOriginItem)
-> Lens
AwsCloudFrontDistributionOriginItem
AwsCloudFrontDistributionOriginItem
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionOriginItem' {Maybe Text
domainName :: Maybe Text
$sel:domainName:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: AwsCloudFrontDistributionOriginItem
s@AwsCloudFrontDistributionOriginItem' {} Maybe Text
a -> AwsCloudFrontDistributionOriginItem
s {$sel:domainName:AwsCloudFrontDistributionOriginItem' :: Maybe Text
domainName = Maybe Text
a} :: AwsCloudFrontDistributionOriginItem)
awsCloudFrontDistributionOriginItem_id :: Lens.Lens' AwsCloudFrontDistributionOriginItem (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionOriginItem_id :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionOriginItem
-> f AwsCloudFrontDistributionOriginItem
awsCloudFrontDistributionOriginItem_id = (AwsCloudFrontDistributionOriginItem -> Maybe Text)
-> (AwsCloudFrontDistributionOriginItem
-> Maybe Text -> AwsCloudFrontDistributionOriginItem)
-> Lens
AwsCloudFrontDistributionOriginItem
AwsCloudFrontDistributionOriginItem
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionOriginItem' {Maybe Text
id :: Maybe Text
$sel:id:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem -> Maybe Text
id} -> Maybe Text
id) (\s :: AwsCloudFrontDistributionOriginItem
s@AwsCloudFrontDistributionOriginItem' {} Maybe Text
a -> AwsCloudFrontDistributionOriginItem
s {$sel:id:AwsCloudFrontDistributionOriginItem' :: Maybe Text
id = Maybe Text
a} :: AwsCloudFrontDistributionOriginItem)
instance
Core.FromJSON
AwsCloudFrontDistributionOriginItem
where
parseJSON :: Value -> Parser AwsCloudFrontDistributionOriginItem
parseJSON =
String
-> (Object -> Parser AwsCloudFrontDistributionOriginItem)
-> Value
-> Parser AwsCloudFrontDistributionOriginItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsCloudFrontDistributionOriginItem"
( \Object
x ->
Maybe AwsCloudFrontDistributionOriginS3OriginConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCloudFrontDistributionOriginItem
AwsCloudFrontDistributionOriginItem'
(Maybe AwsCloudFrontDistributionOriginS3OriginConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCloudFrontDistributionOriginItem)
-> Parser (Maybe AwsCloudFrontDistributionOriginS3OriginConfig)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> AwsCloudFrontDistributionOriginItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser (Maybe AwsCloudFrontDistributionOriginS3OriginConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3OriginConfig")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> AwsCloudFrontDistributionOriginItem)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> AwsCloudFrontDistributionOriginItem)
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
"OriginPath")
Parser
(Maybe Text -> Maybe Text -> AwsCloudFrontDistributionOriginItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsCloudFrontDistributionOriginItem)
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
"DomainName")
Parser (Maybe Text -> AwsCloudFrontDistributionOriginItem)
-> Parser (Maybe Text)
-> Parser AwsCloudFrontDistributionOriginItem
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
"Id")
)
instance
Prelude.Hashable
AwsCloudFrontDistributionOriginItem
instance
Prelude.NFData
AwsCloudFrontDistributionOriginItem
instance
Core.ToJSON
AwsCloudFrontDistributionOriginItem
where
toJSON :: AwsCloudFrontDistributionOriginItem -> Value
toJSON AwsCloudFrontDistributionOriginItem' {Maybe Text
Maybe AwsCloudFrontDistributionOriginS3OriginConfig
id :: Maybe Text
domainName :: Maybe Text
originPath :: Maybe Text
s3OriginConfig :: Maybe AwsCloudFrontDistributionOriginS3OriginConfig
$sel:id:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem -> Maybe Text
$sel:domainName:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem -> Maybe Text
$sel:originPath:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem -> Maybe Text
$sel:s3OriginConfig:AwsCloudFrontDistributionOriginItem' :: AwsCloudFrontDistributionOriginItem
-> Maybe AwsCloudFrontDistributionOriginS3OriginConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"S3OriginConfig" Text -> AwsCloudFrontDistributionOriginS3OriginConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AwsCloudFrontDistributionOriginS3OriginConfig -> Pair)
-> Maybe AwsCloudFrontDistributionOriginS3OriginConfig
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsCloudFrontDistributionOriginS3OriginConfig
s3OriginConfig,
(Text
"OriginPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
originPath,
(Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
domainName,
(Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id
]
)