module Stratosphere.Batch.SchedulingPolicy.ShareAttributesProperty (
        ShareAttributesProperty(..), mkShareAttributesProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ShareAttributesProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-shareattributes.html>
    ShareAttributesProperty {ShareAttributesProperty -> ()
haddock_workaround_ :: (),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-shareattributes.html#cfn-batch-schedulingpolicy-shareattributes-shareidentifier>
                             ShareAttributesProperty -> Maybe (Value Text)
shareIdentifier :: (Prelude.Maybe (Value Prelude.Text)),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-shareattributes.html#cfn-batch-schedulingpolicy-shareattributes-weightfactor>
                             ShareAttributesProperty -> Maybe (Value Double)
weightFactor :: (Prelude.Maybe (Value Prelude.Double))}
  deriving stock (ShareAttributesProperty -> ShareAttributesProperty -> Bool
(ShareAttributesProperty -> ShareAttributesProperty -> Bool)
-> (ShareAttributesProperty -> ShareAttributesProperty -> Bool)
-> Eq ShareAttributesProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ShareAttributesProperty -> ShareAttributesProperty -> Bool
== :: ShareAttributesProperty -> ShareAttributesProperty -> Bool
$c/= :: ShareAttributesProperty -> ShareAttributesProperty -> Bool
/= :: ShareAttributesProperty -> ShareAttributesProperty -> Bool
Prelude.Eq, Int -> ShareAttributesProperty -> ShowS
[ShareAttributesProperty] -> ShowS
ShareAttributesProperty -> String
(Int -> ShareAttributesProperty -> ShowS)
-> (ShareAttributesProperty -> String)
-> ([ShareAttributesProperty] -> ShowS)
-> Show ShareAttributesProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ShareAttributesProperty -> ShowS
showsPrec :: Int -> ShareAttributesProperty -> ShowS
$cshow :: ShareAttributesProperty -> String
show :: ShareAttributesProperty -> String
$cshowList :: [ShareAttributesProperty] -> ShowS
showList :: [ShareAttributesProperty] -> ShowS
Prelude.Show)
mkShareAttributesProperty :: ShareAttributesProperty
mkShareAttributesProperty :: ShareAttributesProperty
mkShareAttributesProperty
  = ShareAttributesProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), shareIdentifier :: Maybe (Value Text)
shareIdentifier = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       weightFactor :: Maybe (Value Double)
weightFactor = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ShareAttributesProperty where
  toResourceProperties :: ShareAttributesProperty -> ResourceProperties
toResourceProperties ShareAttributesProperty {Maybe (Value Double)
Maybe (Value Text)
()
haddock_workaround_ :: ShareAttributesProperty -> ()
shareIdentifier :: ShareAttributesProperty -> Maybe (Value Text)
weightFactor :: ShareAttributesProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
shareIdentifier :: Maybe (Value Text)
weightFactor :: Maybe (Value Double)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Batch::SchedulingPolicy.ShareAttributes",
         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
"ShareIdentifier" (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)
shareIdentifier,
                            Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"WeightFactor" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
weightFactor])}
instance JSON.ToJSON ShareAttributesProperty where
  toJSON :: ShareAttributesProperty -> Value
toJSON ShareAttributesProperty {Maybe (Value Double)
Maybe (Value Text)
()
haddock_workaround_ :: ShareAttributesProperty -> ()
shareIdentifier :: ShareAttributesProperty -> Maybe (Value Text)
weightFactor :: ShareAttributesProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
shareIdentifier :: Maybe (Value Text)
weightFactor :: Maybe (Value Double)
..}
    = [(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
"ShareIdentifier" (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)
shareIdentifier,
               Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"WeightFactor" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
weightFactor]))
instance Property "ShareIdentifier" ShareAttributesProperty where
  type PropertyType "ShareIdentifier" ShareAttributesProperty = Value Prelude.Text
  set :: PropertyType "ShareIdentifier" ShareAttributesProperty
-> ShareAttributesProperty -> ShareAttributesProperty
set PropertyType "ShareIdentifier" ShareAttributesProperty
newValue ShareAttributesProperty {Maybe (Value Double)
Maybe (Value Text)
()
haddock_workaround_ :: ShareAttributesProperty -> ()
shareIdentifier :: ShareAttributesProperty -> Maybe (Value Text)
weightFactor :: ShareAttributesProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
shareIdentifier :: Maybe (Value Text)
weightFactor :: Maybe (Value Double)
..}
    = ShareAttributesProperty
        {shareIdentifier :: Maybe (Value Text)
shareIdentifier = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ShareIdentifier" ShareAttributesProperty
Value Text
newValue, Maybe (Value Double)
()
haddock_workaround_ :: ()
weightFactor :: Maybe (Value Double)
haddock_workaround_ :: ()
weightFactor :: Maybe (Value Double)
..}
instance Property "WeightFactor" ShareAttributesProperty where
  type PropertyType "WeightFactor" ShareAttributesProperty = Value Prelude.Double
  set :: PropertyType "WeightFactor" ShareAttributesProperty
-> ShareAttributesProperty -> ShareAttributesProperty
set PropertyType "WeightFactor" ShareAttributesProperty
newValue ShareAttributesProperty {Maybe (Value Double)
Maybe (Value Text)
()
haddock_workaround_ :: ShareAttributesProperty -> ()
shareIdentifier :: ShareAttributesProperty -> Maybe (Value Text)
weightFactor :: ShareAttributesProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
shareIdentifier :: Maybe (Value Text)
weightFactor :: Maybe (Value Double)
..}
    = ShareAttributesProperty
        {weightFactor :: Maybe (Value Double)
weightFactor = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "WeightFactor" ShareAttributesProperty
Value Double
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
shareIdentifier :: Maybe (Value Text)
haddock_workaround_ :: ()
shareIdentifier :: Maybe (Value Text)
..}