module Stratosphere.S3.Bucket.MetricsProperty (
        module Exports, MetricsProperty(..), mkMetricsProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.S3.Bucket.ReplicationTimeValueProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricsProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html>
    MetricsProperty {MetricsProperty -> ()
haddock_workaround_ :: (),
                     -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html#cfn-s3-bucket-metrics-eventthreshold>
                     MetricsProperty -> Maybe ReplicationTimeValueProperty
eventThreshold :: (Prelude.Maybe ReplicationTimeValueProperty),
                     -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html#cfn-s3-bucket-metrics-status>
                     MetricsProperty -> Value Text
status :: (Value Prelude.Text)}
  deriving stock (MetricsProperty -> MetricsProperty -> Bool
(MetricsProperty -> MetricsProperty -> Bool)
-> (MetricsProperty -> MetricsProperty -> Bool)
-> Eq MetricsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricsProperty -> MetricsProperty -> Bool
== :: MetricsProperty -> MetricsProperty -> Bool
$c/= :: MetricsProperty -> MetricsProperty -> Bool
/= :: MetricsProperty -> MetricsProperty -> Bool
Prelude.Eq, Int -> MetricsProperty -> ShowS
[MetricsProperty] -> ShowS
MetricsProperty -> String
(Int -> MetricsProperty -> ShowS)
-> (MetricsProperty -> String)
-> ([MetricsProperty] -> ShowS)
-> Show MetricsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricsProperty -> ShowS
showsPrec :: Int -> MetricsProperty -> ShowS
$cshow :: MetricsProperty -> String
show :: MetricsProperty -> String
$cshowList :: [MetricsProperty] -> ShowS
showList :: [MetricsProperty] -> ShowS
Prelude.Show)
mkMetricsProperty :: Value Prelude.Text -> MetricsProperty
mkMetricsProperty :: Value Text -> MetricsProperty
mkMetricsProperty Value Text
status
  = MetricsProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), status :: Value Text
status = Value Text
status,
       eventThreshold :: Maybe ReplicationTimeValueProperty
eventThreshold = Maybe ReplicationTimeValueProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricsProperty where
  toResourceProperties :: MetricsProperty -> ResourceProperties
toResourceProperties MetricsProperty {Maybe ReplicationTimeValueProperty
()
Value Text
haddock_workaround_ :: MetricsProperty -> ()
eventThreshold :: MetricsProperty -> Maybe ReplicationTimeValueProperty
status :: MetricsProperty -> Value Text
haddock_workaround_ :: ()
eventThreshold :: Maybe ReplicationTimeValueProperty
status :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::S3::Bucket.Metrics", supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"Status" 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..= Value Text
status]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> ReplicationTimeValueProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"EventThreshold" (ReplicationTimeValueProperty -> (Key, Value))
-> Maybe ReplicationTimeValueProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReplicationTimeValueProperty
eventThreshold]))}
instance JSON.ToJSON MetricsProperty where
  toJSON :: MetricsProperty -> Value
toJSON MetricsProperty {Maybe ReplicationTimeValueProperty
()
Value Text
haddock_workaround_ :: MetricsProperty -> ()
eventThreshold :: MetricsProperty -> Maybe ReplicationTimeValueProperty
status :: MetricsProperty -> Value Text
haddock_workaround_ :: ()
eventThreshold :: Maybe ReplicationTimeValueProperty
status :: Value Text
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"Status" 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..= Value Text
status]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> ReplicationTimeValueProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"EventThreshold" (ReplicationTimeValueProperty -> (Key, Value))
-> Maybe ReplicationTimeValueProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReplicationTimeValueProperty
eventThreshold])))
instance Property "EventThreshold" MetricsProperty where
  type PropertyType "EventThreshold" MetricsProperty = ReplicationTimeValueProperty
  set :: PropertyType "EventThreshold" MetricsProperty
-> MetricsProperty -> MetricsProperty
set PropertyType "EventThreshold" MetricsProperty
newValue MetricsProperty {Maybe ReplicationTimeValueProperty
()
Value Text
haddock_workaround_ :: MetricsProperty -> ()
eventThreshold :: MetricsProperty -> Maybe ReplicationTimeValueProperty
status :: MetricsProperty -> Value Text
haddock_workaround_ :: ()
eventThreshold :: Maybe ReplicationTimeValueProperty
status :: Value Text
..}
    = MetricsProperty {eventThreshold :: Maybe ReplicationTimeValueProperty
eventThreshold = ReplicationTimeValueProperty -> Maybe ReplicationTimeValueProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "EventThreshold" MetricsProperty
ReplicationTimeValueProperty
newValue, ()
Value Text
haddock_workaround_ :: ()
status :: Value Text
haddock_workaround_ :: ()
status :: Value Text
..}
instance Property "Status" MetricsProperty where
  type PropertyType "Status" MetricsProperty = Value Prelude.Text
  set :: PropertyType "Status" MetricsProperty
-> MetricsProperty -> MetricsProperty
set PropertyType "Status" MetricsProperty
newValue MetricsProperty {Maybe ReplicationTimeValueProperty
()
Value Text
haddock_workaround_ :: MetricsProperty -> ()
eventThreshold :: MetricsProperty -> Maybe ReplicationTimeValueProperty
status :: MetricsProperty -> Value Text
haddock_workaround_ :: ()
eventThreshold :: Maybe ReplicationTimeValueProperty
status :: Value Text
..}
    = MetricsProperty {status :: Value Text
status = PropertyType "Status" MetricsProperty
Value Text
newValue, Maybe ReplicationTimeValueProperty
()
haddock_workaround_ :: ()
eventThreshold :: Maybe ReplicationTimeValueProperty
haddock_workaround_ :: ()
eventThreshold :: Maybe ReplicationTimeValueProperty
..}