module Stratosphere.CloudFront.Distribution.S3OriginConfigProperty (
        S3OriginConfigProperty(..), mkS3OriginConfigProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data S3OriginConfigProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-s3originconfig.html>
    S3OriginConfigProperty {S3OriginConfigProperty -> ()
haddock_workaround_ :: (),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-s3originconfig.html#cfn-cloudfront-distribution-s3originconfig-originaccessidentity>
                            S3OriginConfigProperty -> Maybe (Value Text)
originAccessIdentity :: (Prelude.Maybe (Value Prelude.Text)),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-s3originconfig.html#cfn-cloudfront-distribution-s3originconfig-originreadtimeout>
                            S3OriginConfigProperty -> Maybe (Value Integer)
originReadTimeout :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (S3OriginConfigProperty -> S3OriginConfigProperty -> Bool
(S3OriginConfigProperty -> S3OriginConfigProperty -> Bool)
-> (S3OriginConfigProperty -> S3OriginConfigProperty -> Bool)
-> Eq S3OriginConfigProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: S3OriginConfigProperty -> S3OriginConfigProperty -> Bool
== :: S3OriginConfigProperty -> S3OriginConfigProperty -> Bool
$c/= :: S3OriginConfigProperty -> S3OriginConfigProperty -> Bool
/= :: S3OriginConfigProperty -> S3OriginConfigProperty -> Bool
Prelude.Eq, Int -> S3OriginConfigProperty -> ShowS
[S3OriginConfigProperty] -> ShowS
S3OriginConfigProperty -> String
(Int -> S3OriginConfigProperty -> ShowS)
-> (S3OriginConfigProperty -> String)
-> ([S3OriginConfigProperty] -> ShowS)
-> Show S3OriginConfigProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> S3OriginConfigProperty -> ShowS
showsPrec :: Int -> S3OriginConfigProperty -> ShowS
$cshow :: S3OriginConfigProperty -> String
show :: S3OriginConfigProperty -> String
$cshowList :: [S3OriginConfigProperty] -> ShowS
showList :: [S3OriginConfigProperty] -> ShowS
Prelude.Show)
mkS3OriginConfigProperty :: S3OriginConfigProperty
mkS3OriginConfigProperty :: S3OriginConfigProperty
mkS3OriginConfigProperty
  = S3OriginConfigProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), originAccessIdentity :: Maybe (Value Text)
originAccessIdentity = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       originReadTimeout :: Maybe (Value Integer)
originReadTimeout = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties S3OriginConfigProperty where
  toResourceProperties :: S3OriginConfigProperty -> ResourceProperties
toResourceProperties S3OriginConfigProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: S3OriginConfigProperty -> ()
originAccessIdentity :: S3OriginConfigProperty -> Maybe (Value Text)
originReadTimeout :: S3OriginConfigProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
originAccessIdentity :: Maybe (Value Text)
originReadTimeout :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudFront::Distribution.S3OriginConfig",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"OriginAccessIdentity" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
originAccessIdentity,
                            Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"OriginReadTimeout" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
originReadTimeout])}
instance JSON.ToJSON S3OriginConfigProperty where
  toJSON :: S3OriginConfigProperty -> Value
toJSON S3OriginConfigProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: S3OriginConfigProperty -> ()
originAccessIdentity :: S3OriginConfigProperty -> Maybe (Value Text)
originReadTimeout :: S3OriginConfigProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
originAccessIdentity :: Maybe (Value Text)
originReadTimeout :: Maybe (Value Integer)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"OriginAccessIdentity" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
originAccessIdentity,
               Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"OriginReadTimeout" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
originReadTimeout]))
instance Property "OriginAccessIdentity" S3OriginConfigProperty where
  type PropertyType "OriginAccessIdentity" S3OriginConfigProperty = Value Prelude.Text
  set :: PropertyType "OriginAccessIdentity" S3OriginConfigProperty
-> S3OriginConfigProperty -> S3OriginConfigProperty
set PropertyType "OriginAccessIdentity" S3OriginConfigProperty
newValue S3OriginConfigProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: S3OriginConfigProperty -> ()
originAccessIdentity :: S3OriginConfigProperty -> Maybe (Value Text)
originReadTimeout :: S3OriginConfigProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
originAccessIdentity :: Maybe (Value Text)
originReadTimeout :: Maybe (Value Integer)
..}
    = S3OriginConfigProperty
        {originAccessIdentity :: Maybe (Value Text)
originAccessIdentity = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "OriginAccessIdentity" S3OriginConfigProperty
Value Text
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
originReadTimeout :: Maybe (Value Integer)
haddock_workaround_ :: ()
originReadTimeout :: Maybe (Value Integer)
..}
instance Property "OriginReadTimeout" S3OriginConfigProperty where
  type PropertyType "OriginReadTimeout" S3OriginConfigProperty = Value Prelude.Integer
  set :: PropertyType "OriginReadTimeout" S3OriginConfigProperty
-> S3OriginConfigProperty -> S3OriginConfigProperty
set PropertyType "OriginReadTimeout" S3OriginConfigProperty
newValue S3OriginConfigProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: S3OriginConfigProperty -> ()
originAccessIdentity :: S3OriginConfigProperty -> Maybe (Value Text)
originReadTimeout :: S3OriginConfigProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
originAccessIdentity :: Maybe (Value Text)
originReadTimeout :: Maybe (Value Integer)
..}
    = S3OriginConfigProperty
        {originReadTimeout :: Maybe (Value Integer)
originReadTimeout = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "OriginReadTimeout" S3OriginConfigProperty
Value Integer
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
originAccessIdentity :: Maybe (Value Text)
haddock_workaround_ :: ()
originAccessIdentity :: Maybe (Value Text)
..}