module Stratosphere.DataSync.Task.DestinationProperty (
        module Exports, DestinationProperty(..), mkDestinationProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.DataSync.Task.TaskReportConfigDestinationS3Property as Exports
import Stratosphere.ResourceProperties
data DestinationProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-destination.html>
    DestinationProperty {DestinationProperty -> ()
haddock_workaround_ :: (),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-destination.html#cfn-datasync-task-destination-s3>
                         DestinationProperty -> Maybe TaskReportConfigDestinationS3Property
s3 :: (Prelude.Maybe TaskReportConfigDestinationS3Property)}
  deriving stock (DestinationProperty -> DestinationProperty -> Bool
(DestinationProperty -> DestinationProperty -> Bool)
-> (DestinationProperty -> DestinationProperty -> Bool)
-> Eq DestinationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DestinationProperty -> DestinationProperty -> Bool
== :: DestinationProperty -> DestinationProperty -> Bool
$c/= :: DestinationProperty -> DestinationProperty -> Bool
/= :: DestinationProperty -> DestinationProperty -> Bool
Prelude.Eq, Int -> DestinationProperty -> ShowS
[DestinationProperty] -> ShowS
DestinationProperty -> String
(Int -> DestinationProperty -> ShowS)
-> (DestinationProperty -> String)
-> ([DestinationProperty] -> ShowS)
-> Show DestinationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DestinationProperty -> ShowS
showsPrec :: Int -> DestinationProperty -> ShowS
$cshow :: DestinationProperty -> String
show :: DestinationProperty -> String
$cshowList :: [DestinationProperty] -> ShowS
showList :: [DestinationProperty] -> ShowS
Prelude.Show)
mkDestinationProperty :: DestinationProperty
mkDestinationProperty :: DestinationProperty
mkDestinationProperty
  = DestinationProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), s3 :: Maybe TaskReportConfigDestinationS3Property
s3 = Maybe TaskReportConfigDestinationS3Property
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DestinationProperty where
  toResourceProperties :: DestinationProperty -> ResourceProperties
toResourceProperties DestinationProperty {Maybe TaskReportConfigDestinationS3Property
()
haddock_workaround_ :: DestinationProperty -> ()
s3 :: DestinationProperty -> Maybe TaskReportConfigDestinationS3Property
haddock_workaround_ :: ()
s3 :: Maybe TaskReportConfigDestinationS3Property
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::DataSync::Task.Destination",
         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 -> TaskReportConfigDestinationS3Property -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"S3" (TaskReportConfigDestinationS3Property -> (Key, Value))
-> Maybe TaskReportConfigDestinationS3Property
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskReportConfigDestinationS3Property
s3])}
instance JSON.ToJSON DestinationProperty where
  toJSON :: DestinationProperty -> Value
toJSON DestinationProperty {Maybe TaskReportConfigDestinationS3Property
()
haddock_workaround_ :: DestinationProperty -> ()
s3 :: DestinationProperty -> Maybe TaskReportConfigDestinationS3Property
haddock_workaround_ :: ()
s3 :: Maybe TaskReportConfigDestinationS3Property
..}
    = [(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 -> TaskReportConfigDestinationS3Property -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"S3" (TaskReportConfigDestinationS3Property -> (Key, Value))
-> Maybe TaskReportConfigDestinationS3Property
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskReportConfigDestinationS3Property
s3]))
instance Property "S3" DestinationProperty where
  type PropertyType "S3" DestinationProperty = TaskReportConfigDestinationS3Property
  set :: PropertyType "S3" DestinationProperty
-> DestinationProperty -> DestinationProperty
set PropertyType "S3" DestinationProperty
newValue DestinationProperty {Maybe TaskReportConfigDestinationS3Property
()
haddock_workaround_ :: DestinationProperty -> ()
s3 :: DestinationProperty -> Maybe TaskReportConfigDestinationS3Property
haddock_workaround_ :: ()
s3 :: Maybe TaskReportConfigDestinationS3Property
..}
    = DestinationProperty {s3 :: Maybe TaskReportConfigDestinationS3Property
s3 = TaskReportConfigDestinationS3Property
-> Maybe TaskReportConfigDestinationS3Property
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "S3" DestinationProperty
TaskReportConfigDestinationS3Property
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}